Roger Blanchard
447 posts
Registered:
29 Jun 2018
09 Jan 2019
Link to this post
I have a BE designed with the following tables;
PurchaseOrder
PoLine
HistoryTots
On the client side I have a form with the following;
SmartToolbar
SmartDataBrowse of PurchaseOrders
SmartViewer to add/update PurchaseOrder
All is good. I can create PurchaseOrder records, update, delete etc. My validation is working correctly in ValidateData.
If you then double-click the SmartDataBrowse I open another form that will be used to add PoLine records. It has the following;
Smarttoolbar
SmartViewer
All is good. I can create PoLine records, update, delete, etc. Most of my validation is working. I have a few issues I am not sure how to resolve except for just using the ABL FOR EACH.
Issue #1
In the BE:ValidateData I need to reference the parent PurchaseOrder record to determine what type of Order.
If I use a FOR FIRST PurchaseOrder WHERE PurchaseOrder.OrderNum = ePoLine.OrderNum I can get what I need.
If I use a FOR FIRST ePurchaseOrder WHERE ePurchaseOrder.OrderNum = ePoLine.OrderNum there is no record available.
If I create a FetchDataRequest object and use FetchData in the BE I get an error "MERGE-CHANGES run on original table ePurchaseOrder that does not match the ORIGIN-HANDLE in the GET-CHANGES table ePurchaseOrder (11923)
What is the best way for me to reference the PurchaseOrder parent record in ValidateData?
Issue #2
This is similar but in the PurchaseOrderDataClass:ePoLineCreateEndTrans. When we add a PoLine we want to update the PurchaseOrder parent record with the PoLine.Amount. What is the best way to do this?