weekday Archives - My Blog My WordPress Blog Mon, 21 Jan 2019 05:44:50 +0000 en-US hourly 1 How To Identify a Date Which is “X” Business Days From a Particular Date in Salesforce? https://new.infofiscus.in/blog/how-to-identify-a-date-which-is-x-business-days-from-a-particular-date-in-salesforce/ Mon, 21 Jan 2019 05:44:50 +0000 http://www.infometryinc.com/?p=1 Problem Description: Salesforce customers/users find it hard to count business days between today and a particular date as there is no function/method which lets you know the number of business days between two dates. So, if a user wants to get notified when there are exactly 'x' business days left before a particular date, there is no straightforward way of achieving it.

Challenges to User/Developer: A Suggested workaround is to create a formula field that holds a date which is exactly 'x' business days away from a particular date.

The post How To Identify a Date Which is “X” Business Days From a Particular Date in Salesforce? appeared first on My Blog.

]]>

Identify a Date in Salesforce

Problem Description: Salesforce customers/users find it hard to count business days between today and a particular date as there is no function/method which lets you know the number of business days between two dates. So, if a user wants to get notified when there are exactly ‘x’ business days left before a particular date, there is no straightforward way of achieving it.

Challenges to User/Developer : A Suggested workaround is to create a formula field that holds a date which is exactly ‘x’ business days away from a particular date.

Solution :

Approach : Use WEEKDAY() function to get values 1,7,2 depending on the date added inside the function.

Technical Solution :

Create a custom field to hold the date which is ‘x’ business days from a particular date.

    WEEKDAY(date field) returns the day of the week for the given date, using 1 for Sunday, 2 for Monday, through 7 for Saturday. Below is the formula.

CASE(WEEKDAY(Agreed_Due_Date__c),1, Agreed_Due_Date__c – 6,7,Agreed_Due_Date__c – 5,Agreed_Due_Date__c – 7)

In the above example ‘x’ is 5.This formula field counts 5 business days before a date field  “Agrees_Due_Date”.

Advantage : Easy to migrate, Not hard to implement, Scalable when business days have to be calculated for few date fields.

Issues : None.

Conclusion : This Custom formula field can now be used to notify when there is exactly ‘x’ business days from the required date field.

[evp_embed_video url="http://www.infometryinc.com/wp-content/uploads/2019/02/Rohan_X_Business.mp4" poster="http://www.infometryinc.com/wp-content/uploads/2019/01/X-days.png" template="mediaelement" width="1060" height="795" ]

The post How To Identify a Date Which is “X” Business Days From a Particular Date in Salesforce? appeared first on My Blog.

]]>