+ Start a Discussion
Chinna SfdcChinna Sfdc 

Need new Trigger help

Hi All,

We have one requirement when Account having OLD,NEW and OLD&NEW partner accounts that time "License Type" should be automatically changed based on below scenario’s.
We have one Picklist field called "License Type" with the values like 
1. OLD Partner
2. NEW Partner
3. OLD & NEW Partners


1. If Account "is partner"(Checkbox) is enabled or updated, and any existing accounts in the hierarchy enabled or they all are “OLD Partners" then that time (License Type) picklist value should be automatically set the "OLD Partner".
2. There are no existing accounts in the hierarchy then (License Type) picklist value should be automatically set to "NEW Partners".
3. There are no OLD Partners and there is no "NEW Partner Account" then picklist value should be set the "OLD&NEW".

Please help me to create new trigger for above requirement that would be great help.

Hi Chinna,

Still your requirment is not clear ,Please explain wiith bit clarity .

I understood like you have a picklist in Account named Licence Type  and Is Partner .
Now Question is if Account 1 has relationship with Account2 and Account3 ,and I am enabling ispartner for Account 1 what will be Licence type for Account 1 and Account2/Account 3 .

As per second point when u will enable partner and no other account is related to that account ,then that accont licence type willbe new Partner .
Please clarify 3rd point also .
Once you will clarify then I will help you to write the trigger .