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
Jeffrey UyJeffrey Uy 

update field on another object

I don't have much experience with Apex so I was wondering if anybody here can help me out.
We have a custom object named OrderLine.  It has data for our Sales Order lines in our ERP which is being Dataloaded every night.  It has Order_Number__c, Account_Number__c and Part_Number__c.  I need a custom field on the QuoteLine object named Sales_Order_Number__c updated when a record in OrderLine is created or edited that meets the following criteria:
OrderLine.AccountNumber = QuoteLine.AccountNumber
OrderLine.PartNumber = QuoteLine.Product (or PartNumber)
OrderLine.CreatedDate > QuoteLine.CreatedDate.

Is this possible?  Thank you.
Anthony McDougaldAnthony McDougald
Good Afternoon Jeffrey,
Hope that your day is off to an amazing start. Can we inquire a few more details so we can better assist you with this dilemma? So far, we have the idea that a workflow or process builder will be sufficient for this request rather than APEX.
1.) What relationship exists between OrderLine and QuoteLine?
Thank you for taking the time to answer this question and we look forward to helping you. May God bless you abundantly.
Best Regards,
Anthony McDougald
Jeffrey UyJeffrey Uy
Anthony,
Sorry for the late response.  We were out the whole week last week.  I tried using workflow and process builder but there is no existing relationship between OrderLine and QuoteLine. Thank you.