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.
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
.
-
1But, 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 '20 at 11:17
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/
'005223323'
dynamiically? – Pranay Jaiswal Apr 22 '20 at 10:45