1

I've been trying to determine in process builder what date of the week the created date is but I keep getting an invalid formula error without details on what is incorrect.

If I try either of the following I receive "The formula expression is invalid: Syntax error". I'm trying to set a DateTime value.

Note I'd prefer not to use DATEVALUE as I gather this defaults back to GMT and my record could be created anywhere worldwide and it should be based off this.

IF(
     OR(MOD(([SM_Problem__c].CreatedDate + 4320/1440) – DATE(1900,1,6), 7) = 0,
           MOD(([SM_Problem__c].CreatedDate + 4320/1440) – DATE(1900,1,6), 7) = 1,
           MOD(([SM_Problem__c].CreatedDate + 4320/1440) – DATE(1900,1,6), 7) = 2),
     [SM_Problem__c].CreatedDate + 7200/1440,
     [SM_Problem__c].CreatedDate + 4320/1440
)


IF(
     OR(MOD(DATEVALUE([SM_Problem__c].CreatedDate + 4320/1440) – DATE(1900,1,6), 7) = 0,
           MOD(DATEVALUE([SM_Problem__c].CreatedDate + 4320/1440)  – DATE(1900,1,6), 7) = 1,
           MOD(DATEVALUE([SM_Problem__c].CreatedDate + 4320/1440)  – DATE(1900,1,6), 7) = 2),
     [SM_Problem__c].CreatedDate + 7200/1440,
     [SM_Problem__c].CreatedDate + 4320/1440
)

Note, no errors occur in a non Process Builder formula field if I try

IF(
     OR(MOD(DATEVALUE(CreatedDate + 4320/1440) - DATE(1900, 1, 7), 7) = 0,
        MOD(DATEVALUE(CreatedDate + 4320/1440) - DATE(1900, 1, 7), 7) = 1,
        MOD(DATEVALUE(CreatedDate + 4320/1440) - DATE(1900, 1, 7), 7) = 2),
     (CreatedDate + 7200/1440),
     (CreatedDate + 4320/1440)
) 

Any tips on what I can do for this in my process builder field would be appreciated. Basically I want to set an end date and need to determine if I should add weekend hours or not. I want to find out if in 72 hours time that the date will be in a weekend or not.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.