You need to sign in to do that
Don't have an account?
sf ost
Field Update on Parent Record based on a field in all associated Child Records
Hi,
There are two Custom Objects, Object1 (Parent), Object2 (Child). Both are in MD relationship.
Object1 (Parent) has a picklist field "Statuc__c" with values InProgress & Completed.
Object2 (Child) has a field of CheckBox datatype "Completed__c".
Now. When the value of checkbox Completed__c is true in all the records of an associated parent record. then only the filed Status__c in Object1 should change to the value Completed.
How can I achieve this?
Your suggestion will be appreciated.
There are two Custom Objects, Object1 (Parent), Object2 (Child). Both are in MD relationship.
Object1 (Parent) has a picklist field "Statuc__c" with values InProgress & Completed.
Object2 (Child) has a field of CheckBox datatype "Completed__c".
Now. When the value of checkbox Completed__c is true in all the records of an associated parent record. then only the filed Status__c in Object1 should change to the value Completed.
How can I achieve this?
Your suggestion will be appreciated.
Create a trigger in your child object and every time after the upgrade you check these fields brethren in objects than has been updated. If all objects meet the criteria, you update the parent object.
Example:
Obs: Because it is trigger, be sure to follow in the SFDC standards (https://developer.salesforce.com/page/Trigger_Frameworks_and_Apex_Trigger_Best_Practices):
Error: Compile Error: No such column 'parentID' on entity 'Project__c'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names. at line 7 column 13
How to overcome this error?
I have field on the Order object called Total_Number_of_Canvases__c which is a Roll-Up Summary (SUM Order Product)
I have another field on the Order object called Shipping_Charges__c which is updated via workflow field update (Total_Number_of_Canvases__c * 3)
Problem is, whenever I add/remove order products, which in turn updates the Total Number of Canvases field, the Shipping Charges field is calculating based on the field's prior value.
Can I use a trigger to run when order products/Total Number of Canvases is updated so that Shipping Charges are calculated based on the current value of Total Number of Canvases?
Thanks