You need to sign in to do that
Don't have an account?
lakshman.matti
dates comparison
Hi All,
Can someone suggest me how to write trigger for the below scenario?
I have one Account, which can have many contacts.
there are custom fields on contact object 1.Event date(date) 2. Active(Checkbox).
so whenever I'm adding a contact to the account, I need to make it active, here i have one condition if have multiple contacts for the same account i need to check the event date field on contact and if there two contact events with the same year i need to make one contact as active and another as inactive.
Eg: Account A got 2 Contacts, all are active
-cont1 Event date is 01/01/2016
-cont2 event date is 01/01/2017
If a new contact is created (cont3) with event date 01/02/2017
- cont1 will remain active
- cont2 will be inactivated
- cont3 will become active
Hope my question is clear.
Thanks in advance.
Can someone suggest me how to write trigger for the below scenario?
I have one Account, which can have many contacts.
there are custom fields on contact object 1.Event date(date) 2. Active(Checkbox).
so whenever I'm adding a contact to the account, I need to make it active, here i have one condition if have multiple contacts for the same account i need to check the event date field on contact and if there two contact events with the same year i need to make one contact as active and another as inactive.
Eg: Account A got 2 Contacts, all are active
-cont1 Event date is 01/01/2016
-cont2 event date is 01/01/2017
If a new contact is created (cont3) with event date 01/02/2017
- cont1 will remain active
- cont2 will be inactivated
- cont3 will become active
Hope my question is clear.
Thanks in advance.
Have you tried to use "Visual Flow" or "ProcessBuilder" ?
Thanks