You need to sign in to do that
Don't have an account?
Sunny Sohail
Hello,
im fairy new to triggers and im having some issues creating a trigger that will make a field mandatory. I tried to do this with a basic Validation rule however i beleive this exceeds salesforce point and click capabilities.
Case:
Im trying to create a validation rule where a user would be required to fill out the "Distributor_Name__c" name on the quotes object if "silver" is slected from the "Proofpoint_Advantage_Program_Level__c" field on the accounts object.
"Distributor_Name__c" is a lookup field that looks up accounts and "Proofpoint_Advantage_Program_Level__c" is a picklist.
i have tried creating a cross object validation rule however on the quotes object account fields do not show up. Is this possible? if not would this be done via trigger? This is what i attempted however iv had little success. Any help would be appreciated.
trigger Requiredistyfield on Quotes (Before insert,before update) {
for (account quoteloop: Trigger.New){
if (quoteinloop.Proofpoint_Advantage_Program_Level__c== 'silver'l)
accountinloop.Distributor_Name__c!=NULL;
}
}
Cross Object Trigger to make a filed Mandatory
Hello,
im fairy new to triggers and im having some issues creating a trigger that will make a field mandatory. I tried to do this with a basic Validation rule however i beleive this exceeds salesforce point and click capabilities.
Case:
Im trying to create a validation rule where a user would be required to fill out the "Distributor_Name__c" name on the quotes object if "silver" is slected from the "Proofpoint_Advantage_Program_Level__c" field on the accounts object.
"Distributor_Name__c" is a lookup field that looks up accounts and "Proofpoint_Advantage_Program_Level__c" is a picklist.
i have tried creating a cross object validation rule however on the quotes object account fields do not show up. Is this possible? if not would this be done via trigger? This is what i attempted however iv had little success. Any help would be appreciated.
trigger Requiredistyfield on Quotes (Before insert,before update) {
for (account quoteloop: Trigger.New){
if (quoteinloop.Proofpoint_Advantage_Program_Level__c== 'silver'l)
accountinloop.Distributor_Name__c!=NULL;
}
}
Please find the below code sample,
Thanks,
Vinoth
All Answers
Please find the below code sample,
Thanks,
Vinoth
this code actually gave me some syntax errors however i was able to do this via validation rule.
thank you so much for your help.