Working with Process Builder, have a nice flow that checks the case for certain data elements, and then creates a new object if it couldn't find one automatically when the case was first created. (Depends on how case was created)

Looks good other than this object has a validation rule (inherited app, still finding all these quirks) on creation..only users in two offices are allowed to create new records. This is checked in validation rule formula via $User.office__c value checks for the two allowed offices.

My issue is since Process Builder is now also trying to create a new one of this object, system isn't in one of those offices, so the validation fails and stops object record creation. How can I add to see if the "user" is system?

I hunted around here and success community but wasn't finding anything solid...thanks!

  • 2
    Idea 1, Idea 2, Idea 3, or Idea 4 might be what you want. Or something else. Any way you slice it, I don't think there's a convenient way to do this today.
    – sfdcfox
    May 11 '17 at 19:27
  • @sfdcfox thanks, I'll look at those and sometimes you find a gem or workaround in the comments. Salesforce does some really great stuff, but also has many weird gaps
    – curtisk
    May 11 '17 at 19:35
  • "I hunted around here and success community but wasn't finding anything solid" I would have liked to see the links you checked in your question for reference purposes. It might be helpful for others. Thanks!
    – glls
    May 11 '17 at 20:40
  • 2
    can you create a checkbox called system insert and set it to true when the process builder creates the record and add an extra criteria in your validation rule/rules to allow insert if system_insert__c = true ? You can hide the System insert checkbox on the pagelayout so that it is not editable by anyone.
    – Rao
    May 11 '17 at 21:04
  • @Rao That workaround got the task at hand done, thanks for suggesting it! Doesn't address core question here about identifying "system" in code, but easy way to work around that limitation in this case...Thanks!
    – curtisk
    May 12 '17 at 19:50

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.