You need to sign in to do that
Don't have an account?
Home Page Component
Hi,
I am not sure it i am heading in the right direction. Any inputs are highly appreciated on this.
i am trying to design a tool called "Tip of the day" that would display on the Home Page with a scrolling text to the users.
I have created a custom object called Tip, which would hold all the tips. It contains the following columns, Tip, Start date, end date and a Link column to the external system as well.
I would then display the tip based on the start date and end date.
Can any one help me how can i embed this page in the home component as a scrolling text?Do i need to use any fancy javascripting?
Thanks,
Sales4ce
You couldn't use "BETWEEN" in this case, because SOQL doesn't support that syntax. In SQL, it would be:
Since you can't use that syntax, you'll have to deal with the SOQL version:
The reason why your query wouldn't work before is because your inequalities were backwards; the start date would have to be before today, and the end date would have to be after today.
You may want to change it to a List<Tip__c> variable so that you won't get the "no rows for assignment" error. Then, you can determine if the list is empty, and if so, tell the user that there is no current tip available.
All Answers
You can use the marquee tag if you want to trust a non-standard tag; this results in an easy way to make moving text. JavaScript is the correct way to make text move, since not all browsers support marquee, at least not as well as JavaScript. jQuery can make your life really easy in this case, as it has built-in animation code (might be overkill for your purpose, but I thought I'd throw that out there).
The real question is, how are you planning on loading those Tip of the Day entries? Will you use the AJAX Toolkit? A Visualforce page? There are a few ways to go about this, and your decision will ultimately impact how long it will take you to build this. Visualforce is likely easier to build, but not using Visualforce avoids an iframe tag, which means you can directly script the size of the frame dynamically, etc.
The best way is to add the Visualforce in Iframe inside the home pagecomponent
And do whatever u want to do Inside that Visualforce Page . It will be displayed In Your Home Page Component
<iframe height="0" src="/apex/YourPageName" frameborder="0" width="0" bgcolor="#CFEEF8"></iframe>
Thanks for you timely feedback.
I am planning to load these tips using a visualforce page. I have a roadblock on pulling out the Tips based on the criteria.
Every tip has a start date and end date and should display only during those dates.
My query is returning "No Rows" exception.
I know that we cannot use "between" keyword in SOQL query. How can i overcome this limitation?
Any ideas is greatly helpful.
Thanks,
Sales4ce
You couldn't use "BETWEEN" in this case, because SOQL doesn't support that syntax. In SQL, it would be:
Since you can't use that syntax, you'll have to deal with the SOQL version:
The reason why your query wouldn't work before is because your inequalities were backwards; the start date would have to be before today, and the end date would have to be after today.
You may want to change it to a List<Tip__c> variable so that you won't get the "no rows for assignment" error. Then, you can determine if the list is empty, and if so, tell the user that there is no current tip available.