I am trying to automate the DMT PO receipt Combined Process. The route I’ve been taking is using Power Automate and then calling an API that runs a function. I convert the json Data into Erp.Tablesets.UpdExtReceiptTableset using a custom code function and then call the Erp.Receipt.UpdateExt BO Method to submit the data.
What’s going wrong is when the data is sent to the BO Method caller… Here is a snippet of what I am receiving back as the API response:
I went to the trace logging file to monitor the Update Ext Profile and noticed that the data is being taken in by the system but once it notices that a record doesn’t exist to update, it tries to create a new record with an empty dataset (using none of the data I submitted). Hence why I’m getting the errors I’m getting.
I’m just putting this out there because I have struggled with DMTing the vendor ID on the PartPlant records. It would not provide an error/message but failed uploading via DMT. I needed to provide both VendorNum and VendorID but needed to call that VendorNumVendorID. Any chance you have a fail due to the vendor not getting uploaded properly?
I believe that I am taking care of that part in the custom code function that I built where I query the database to get the vendorNum by VendorID… see coding below:
switch(this.typeOfDmt)
{
case "PO Receipt Combined":
// Search Vendors to find the correct VendorNum
var vendorNums = (from h in Db.Vendor where h.VendorID == this.vendorId select h.VendorNum);
// Add the VendorNum to the DataSet and Update the RowMod fields to "A" for add
JObject obj = JsonConvert.DeserializeObject<JObject>(this.jsonData);
obj["RcvHead"][0]["VendorNum"] = vendorNums.First();
obj["RcvHead"][0]["RowMod"] = "A"; //coworker thought I needed this
obj["RcvDtl"][0]["RowMod"] = "A"; //coworker thought I needed this
// Convert the dataset to The proper Business Object for loading
this.data = JsonConvert.DeserializeObject<Erp.Tablesets.UpdExtReceiptTableset>(obj.ToString());
break;
}
for a bit more insight… this is the type of data that I am feeding the system from the API call through Power Automate: