You need to sign in to do that
Don't have an account?
gonzalol
How to get the ID of a recored based on a value in a field using APEX
In our integration we bring over sales orders (Master Relationship) and sales order lines (Child) both are different objects, we also bring credits and returns into the same objects.
When we right a credit or return we bring over the original sales order number and it lands on the child record (line). What I need is to convert that original sales order number into an ID so that I can link the credit or return to the original sales order. I need the ID to land in a lookup field using some type of apex code.
Any help is appreciated, new to apex coding.
When we right a credit or return we bring over the original sales order number and it lands on the child record (line). What I need is to convert that original sales order number into an ID so that I can link the credit or return to the original sales order. I need the ID to land in a lookup field using some type of apex code.
Any help is appreciated, new to apex coding.
You can write an apex trigger in the Order line item for insert and update event.
You can also use the process builder to trigger a flow to perform this action.
The following code establishes the relationship between Order(Child) and Opportunity(Parent), based on the CONC_NO__c value which is a similar field as your ordernumber in orderline item
Let me know if this helps.
As a common practice, if your question is answered, please choose 1 best answer.
Additionally you can give every answer a like if that answer is helpful to you.
Regards,
Anto Nirmal