0

Hi, I have a Materials Table that has a sub-table with different costs by Suppliers. Now I'm creating a Purchase Order and selecting the Material in the line item and I would like to populate the proper cost by matching the record with the Purchase order Supplier. can anyone help me with the proper select syntax ?

Thank you

2 replies

null
    • John_Halls
    • 2 yrs ago
    • Reported - view

    Hi Rocco

     

    Your data model should look something like this

     

    Orders

     

    In the Lines table the Trigger after update can have something like

     

    Trigger

     

    The fields ending ID are my reference fields.

     

    Regards John

    • US Sign & Mill Corporation
    • Rocco
    • 2 yrs ago
    • Reported - view

    Thanks John. this is my data model looks like this :

     

    and thanks to your help this works:

    if not Materials.Id then
    'PO Cost Each' := null
    else
    let x := this;
    'PO Cost Each' := first(select 'Supplier Costs' where Materials.Id = x.Materials.Id and Supplier.Id = x.'Purchase Orders'.Suppliers.Id).Cost
    end

    Now I need help with the for loop syntax to change all the PO line items (Po Cost Each) to change when I update the PO supplier

    thank you

Content aside

  • 2 yrs agoLast active
  • 2Replies
  • 304Views