You need to sign in to do that
Don't have an account?
Saurabh Kumar 284
Write an apex trigger on Account with value "cold" if the rating field is blank.
Write an apex trigger on Account to Populate the Rating field with value as "Cold" if the account record is initially created with a blank Rating value
Can you try the below trigger once and check if this works:
trigger acctri on account(before insert)
{
if(trigger.isbefore && trigger.isinsert)
{
for(Account a:trigger.new)
{
if(String.isBlank(a.rating__c))
{a.rating='cold';}}}}
I hope this helps and in case if this comes in handy can you please choose this as the best answer so that it can be useful for others in the future.
Regards,
Anutej
All Answers
Can you try the below trigger once and check if this works:
trigger acctri on account(before insert)
{
if(trigger.isbefore && trigger.isinsert)
{
for(Account a:trigger.new)
{
if(String.isBlank(a.rating__c))
{a.rating='cold';}}}}
I hope this helps and in case if this comes in handy can you please choose this as the best answer so that it can be useful for others in the future.
Regards,
Anutej
sure I will mark it as the best answer once I have to verify the same.