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
Mahesh Tandan 6Mahesh Tandan 6 

if Custom Checkbox is checked when custom setting is requred

Hello guys

I have a custom checkbox field On Campaign object.
and a custom setting called ManageData__c with 4 fields.
While creating Campaign if this checkbox is checked I want to make sure custom setting ManageData__c 's fields are filled.

if ManageData__c 's fields is not filled then while creating campaign a form will appear where I can fill the ManageData__c's filleds

please help
thank you.
Best Answer chosen by Mahesh Tandan 6
Shubham_KumarShubham_Kumar
Hi Mahesh
if this a heirachy Custom Setting then you can write a validation rule like this
AND(
YourCampaignField,
OR(
ISBLANK($Setup.YourCustomSetting__c.field1__c),
ISBLANK($Setup.YourCustomSetting__c.field1__c),
ISBLANK($Setup.YourCustomSetting__c.field1__c),
ISBLANK($Setup.YourCustomSetting__c.field1__c)
)
)
but if your custom setting setting is list type then you will have to write trigger on before insert.
Do let me know if you have any query.

P.S: Mark this as the best answer if this helped.

Thanks and Regards
Shubham Kumar

All Answers

Shubham_KumarShubham_Kumar
Hi Mahesh
if this a heirachy Custom Setting then you can write a validation rule like this
AND(
YourCampaignField,
OR(
ISBLANK($Setup.YourCustomSetting__c.field1__c),
ISBLANK($Setup.YourCustomSetting__c.field1__c),
ISBLANK($Setup.YourCustomSetting__c.field1__c),
ISBLANK($Setup.YourCustomSetting__c.field1__c)
)
)
but if your custom setting setting is list type then you will have to write trigger on before insert.
Do let me know if you have any query.

P.S: Mark this as the best answer if this helped.

Thanks and Regards
Shubham Kumar
This was selected as the best answer
Mahesh Tandan 6Mahesh Tandan 6
thank you Shubham_Kumar
Yup that's worked.
but how can I open a form where I can fill the custom setting fields