1

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!

5
  • 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
    Commented May 11, 2017 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
    Commented May 11, 2017 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
    Commented May 11, 2017 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
    Commented May 11, 2017 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
    Commented May 12, 2017 at 19:50

0

You must log in to answer this question.

Browse other questions tagged .