You need to sign in to do that
Don't have an account?
shoba shoba
Can we calculate the holidays for an opportunity using visual flow
My scenario is to calculate the holidays for an opportunity. For this i have created an custom field(DateType: Integer) in opportunity called "Holidayslist__c"(This field i want to display no of holidays).
1.If my opportunity is in "Open" , i want to calculate the holidays between the opportunity CreatedDate field to TODAY.
2.If Opportunity is "Closed", i want to calculate the holidays between the CreatedDate field to ClosedDate.
I wrote a trigger its working , is there anyother option to do this scenario in configuration part like using visual flow. Can anyone give me suggestion how to do this please.
1.If my opportunity is in "Open" , i want to calculate the holidays between the opportunity CreatedDate field to TODAY.
2.If Opportunity is "Closed", i want to calculate the holidays between the CreatedDate field to ClosedDate.
I wrote a trigger its working , is there anyother option to do this scenario in configuration part like using visual flow. Can anyone give me suggestion how to do this please.
You can do the above work using WorkFlow.Follow the steps below:
1) For this you have to type workflow in quickfind box.
2) Create a Workflow on Opportunity Object and tick on "created, and every time it's edited".
3) Select the criteria as given in Snapshot.
4) Then Add workflow action and select "New fieldUpdate" option and select field to update ="Holidayslist__c".
5) Select "Use a formula to set the new value" and in formula field write following formula:
IF(ISPICKVAL( StageName , "Closed Won" ) ||(ISPICKVAL( StageName , "Closed Lost") ) , CloseDate - DATEVALUE(CreatedDate) , TODAY() - DATEVALUE( CreatedDate ) )
6) Lastly Activate your workflow rule.
Regards,
Ajay
I have a requirement like we have to calculate working days between two dates (e.g. CONTRACT END DATE and CONTRACT END DATE in a custom object) excluding WEEKENDS and PUBLIC HOLIDAYS. For excluding weekends, there is a formula. But for excluding public holidays ,I am not sure how to write a formula. SO now, I request for your advice. Given below are my questions:
1) Which object are you using to register holidays, is it standard "Holiday" object or a custom object.
2) Can you please share the code snippet which you wrote.
Currently to calculate current business day excluding weekends, I am using the formula (retrieved from Salesforce Help) given below: Is there any possibliity to incorporate the logic to exclude public holidays defined either in standard holiday object or custom object.
Waiting for your response.
Thanks in Advance.
Prabhata