+ Start a Discussion
Binh PhuBinh Phu 

Trigger to update fields on two unrelated objects

Hello everyone,

Is it possible to have a trigger that update fields on two completely unrelated custom objects? 
Both objects (Object1__c and Object2__c) share two common fields:  Date and Fiscal Month.  However, currently only the Date field on both objects are populated and I want to update the Fiscal Month field on Object1__c from Object2__c because they both have the same Date field.

Thank you very much!
Best Answer chosen by Binh Phu
Neetu_BansalNeetu_Bansal
Hi Binh,

As the Fiscal Month will be the month of the date field, You can create fiscal month as formula field on both object, so the month will be auto populated to all the records in both Object. The formula you need to use is:
MONTH(date)
Let me know, if you need any other help.

Thanks,
Neetu

All Answers

Neetu_BansalNeetu_Bansal
Hi Binh,

As the Fiscal Month will be the month of the date field, You can create fiscal month as formula field on both object, so the month will be auto populated to all the records in both Object. The formula you need to use is:
MONTH(date)
Let me know, if you need any other help.

Thanks,
Neetu
This was selected as the best answer
Binh PhuBinh Phu
Hi Neetu, Thanks for your reply. I am using a custom fiscal calendar, so that formula won't work, would it? That's why I am trying to join Object1 with Object2 on the Date field since Object2 has my custom fiscal month in it. Thanks.
Neetu_BansalNeetu_Bansal
Hi Binh,

Is it possible to share your salesforce org login credentials, so I will have a look and help you out. You can contact me either on my gmail id: neetu.bansal.5@gmail.com or Skype id: neetu.bansal.5

Thanks,
Neetu