function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
BwoffBwoff 

Need help with syntax

Clearly I don't belong here, but would appreciate the help nonetheless. I am trying to write a formula that will deactivate page updates for all users after a form is submitted with the exception of two profile ids. I can get it to work for one, but not both. What am I doing wrong?

 

And(now() >  Submitted_Day_Time__c , ($User.ProfileId  <> "00eD00000015thJ") ||($User.ProfileId  <> "00eD00000016Ctb"))

Best Answer chosen by Admin (Salesforce Developers) 
Prafull G.Prafull G.

AND(
  now() > Submitted_Day_Time__c,
  AND (
    $Profile.Name <> "Profile 1",
    $Profile.Name <> "Profile 2"
  )
)

 

Use the AND operator. Also, you should avoid use of hard code ids. Instead you can use the Profile Name as Ids may change when you deploy between organisations.

 

Thanks,

Prafull

All Answers

harsha__charsha__c

Hi,

 

Just replace the OR with the AND conjunction as shown below.

 

And(now() >  Submitted_Day_Time__c , ($User.ProfileId  <> "00eD00000015thJ")  && ($User.ProfileId  <> "00eD00000016Ctb"))

 

 

 

Give Kudos if this helps you out.

Prafull G.Prafull G.

AND(
  now() > Submitted_Day_Time__c,
  AND (
    $Profile.Name <> "Profile 1",
    $Profile.Name <> "Profile 2"
  )
)

 

Use the AND operator. Also, you should avoid use of hard code ids. Instead you can use the Profile Name as Ids may change when you deploy between organisations.

 

Thanks,

Prafull

This was selected as the best answer