September 24, 200421 yr I am writing a solution where I want to post information from some records in one table to another table. An example is: I have a work order that I want to post to a General Ledger. In the GL I need to add new records from a sort in the work order table. I am having trouble getting it right. Do I create the script from the Work order table or from the GL table? Do I need multiple scripts (one finding records and the other adding new records) It feels like It should be easy but I'm not getting it. Can anyone point me in the right direction? Cindy
September 24, 200421 yr Set up a relationship from a global field in the GL table to the id in the Work Order table and a relationship from a WorkOrderID field in the GL table to the id in the Work Order table. Start your script on a layout associated with the Work Order table. Set the global field in the GL table with the first record's id. Commit the change. Move to a layout for your GL table, create a new record, and set the new record's fields with data using the relationship. Go back to the Work Order layout, move to the next record, and repeat for the remaining records. In semi-pseudocode, Go to Layout [Work Order] {find desired records} Loop Set Field [GL::globalid; id] Commit Records/Requests Go to Layout [GL] New Record/Request Set Field [WorkOrderid; globalid] Commit Records/Requests Set Field [data1; Work Order::data1] Set Field [data2; Work Order::data2] ... Go to Layout [Work Order] Go to Record/Request/Page [Exit after last; Next] End Loop
Create an account or sign in to comment