function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sugandhi VermaSugandhi Verma 

how to update 2 fields of 2 different object if the condition is true in 1 workflow?

Hiii Experts,

I want to know that how to update 2 fields of 2 different object when the if condition is true in 1 workflow in salesforce????
 
if condition is==> if(system.date()==custom_object3__c.field3__c)

 if condition is true==> want to perform:
custom_object2__c.field2__c=(custom_object2__c.field2__c-1) custom_object1__c.field1__c=(custom_object1__c.field1__c-1)

if condition is false==> want to perform:
custom_object2__c.field2__c=custom_object2__c.field2__c custom_object1__c.field1__c=custom_object1__c.field1__c

how to do this in 1 workflow in formula editor????
 
sandeep sankhlasandeep sankhla
HI

You can create a workflow rule and in that you can keep your condition and when it evaluates to true you can add two workflow action as field update..

You can create 2 field update actions related to 1 workflow and then you can update the fields..

User-added image

Please check adn let me know if you are unable to achieve this..

Thanks,
Sandeep
Sugandhi VermaSugandhi Verma
@sandeep, thanks for answering.

Can i update the fields in the formula editor of workflow instead of adding action in workflow?
NagaNaga (Salesforce Developers) 
Hi Sugandhi,

User-added imagePlease let me know if this helps

Best Regards
Naga Kiran
Sugandhi VermaSugandhi Verma
@Naga, read my question again.
Sugandhi VermaSugandhi Verma
@Sandeep,

My custom_object1__c is the master and custom_object2__c is it's child.
Similarly, custom_object2__c is the master and custom_object3__c is it's child.
I am adding workflow on custom_object3__c ,but action doesn't allow me to update the field of custom_object1__c as it's only showing the custom_object2__c in the picklist. Please help.
Robert ZentgrafRobert Zentgraf
Hi Sugandhi,

in this case you should try the Lightning Process Builder. It'a very good tool, you can use instead of a trigger.

Regards
Robert

(mindforce: http://www.mind-force.de)
Sugandhi VermaSugandhi Verma
Hi @Robert ,

Can you explain in detail with steps. I am using developer account.

Thanks and Regards
Sugandhi VermaSugandhi Verma
Hi Robert,

I have tried to do it but when the condition is true, it's allowing only 1 object to update their fields. I want to update the fields of 2 different object when the condition is true.Please Reply.