0

I want to implement validation rule whew i need to check organisation id. My validation rule contains (organisation.id='005223323') Can anybody tell me is there any way to take the organisation id dynamically.

  • you mean to take hard coded value '005223323' dynamiically? – Pranay Jaiswal Apr 22 at 10:45
  • yes.pranay..... – akkhi Apr 22 at 11:06
2

Look at the global variable documentation, it has Organization variable which you can use to get the information of company information dynamically. Org Id can be fetched with $Organization.Id.

| improve this answer | |
  • 1
    But, a word of caution... when cloning an org, the value in the string can be modified if the hard-coded org Id matches the org Id being cloned. – sfdcfox Apr 22 at 11:17
2

You can use Hierarchical Custom settings in validation. This ensures your metadata is not hardcoded.

Thus your validation will looks something like

$Organization.Id=$Setup.YourHierachicalCustomSetting__c.CustomOrgId__c

https://salesforceprofs.com/hierarchy-custom-setting-in-validation-rules/

| improve this answer | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.