You need to sign in to do that
Don't have an account?
Pooky
using days of the week text in reporting
I have a user that wants his reports to reflect the number of opportunities created by day of week, but he wants the text ie Monday, Tuesday, Wed, to show in the report. Can anyone tell me who to do this?
Thanks
With the mindset of a developer, I would suggest that you create a custom text field and populate it with the Day of Week via a BEFORE INSERT trigger. Do something like the following:
trigger on Opportunity (before insert) { for( Opportunity oppty : trigger.new ) { oppty.Created_Day_Of_Week__c = System.now().format('EEEE'); }}
This solution is based on the assumption that the user would be using the standard reports provided by Salesforce.com. If that is not the case, then please explain the scenario a littl.
Hope this helps!
-soof
ok. I gave that a try but it didn't work. I created a text formula field in the opportunity and pasted what you have below as the formula and I am getting a syntax error on trigger. Am I doing something wrong?
Thanks
Sorry - I see what I did wrong... I didn't put the name of the trigger! Just typed the code here and didn't verify it. Here's the fixed code:
trigger updateDayOfWeek on Opportunity (before insert) {
for( Opportunity oppty : trigger.new ) {
oppty.Created_Day_Of_Week__c = System.now().format('EEEE');
}
}
-----EDITING MESSAGE-----
Apologies... didn't read your reply attentively. You don't need to create a custom "Formula" field - the code above is NOT formula code. You simply need to create a custom Text field, which will be populated by this trigger, whenever an Opportunity is created. Does that make sense? Let me know if you need me to explain more.
-soof
You'll need to create the trigger in Sandbox, then write a bit of Test Code that executes this trigger, and then deploy it to your Production instance.
-soof