Hello Tammy,
Hope youâre doing well.
This actually just took me all afternoon to figure out. Got stuck at the office over 2 hours after closing because it was driving me nuts. But, I finally got it.
Hereâs a breakdown of whatâs going on, as well as the steps you can take to trouble shoot this yourself if you run into a similar issue in the future:
Firstly, there is nothing wrong with the way youâve set this up. If your UD Column Maintenance is showing tables in sync, you are good to go. You have added the fields correctly, and correctly set the EpiBinding.
Should look like this:
Your next steps should have been to open the dev tools (F12), and enable debugging (ctrl+alt+8). After updating your âTotal Inspection Time (Hours)â field and saving, you will be able to see all of the method calls/event calls that are occurring when you press save. Youâll see something like this:
After can then go into application studio â events, and follow all of this as well.
After following the logs (similar to trace logs in classic), we will see that a method called âInspectInventory2â gets called:
When troubleshooting, your best bet is to try to hit the REST API directly, that way you know there arenât any application level errors going on. To do this, navigate to the Swagger interface/Rest API Help interface.
The link to get there is as follows: https://[YourEpicorServer]/EpicorERP/api/help/v2/
If you go to the âInspProcessingSvcâ, and find âInspectInventory2â, youâll see this with the text:
"To process an inspection of Inventory-related non conformances (NonConf dataset). Corresponds to the Inventory tab of the Inspections Processing screen in Vantage v6.10.
Use this method where you would typically use the Update() method, when the item being inspected is an Inventory Material.":
I was unable to get this to work to update the InspecTime_c UD field. I was able to change other fields, such as the âInspected Byâ, but not the UD field. This is why you are getting the problem you are experiencing. The âInspectInventory2â method does not seem to update UD fields.
The solution: Update your field via the âErp.BO.NonConfSvc - Updateâ method instead
The Inspection Processing menu is just a view into many other tables. We created the field on the NonConf table, so we can just update that value via itâs Svc Update method. This will require some customization. You have two options, you can do this all via Application Studio, or use a function call it from Application Studio. However, most people on the forum recommend processing on the backend when touching data. Therefore, the best approach is to create a function, and then call your function via the Kinetic-Function widget:
In an application studio event, or your function, all you need to do is call the âErp.BO.NonConfSvc - GetByIDâ method. Once you have your DataSet, youâre going to set the âRowModâ field to âUâ, and youâre going to update the âInspecTime_câ to whatever the user input. Once you have the dataset teaâd up, you can call the âErp.BO.NonConfSvc - Updateâ method, passing that previous dataset we created, and modified. This will now update the NonConfSvc table. VoilĂ , you will see that data populated, and saved as youâre expecting.
If you have any issues with your function, you can also directly call it from the Rest API Help/Swagger UI as well. I usually test here before finishing the build out in Application Studio as a sanity check.
TLDR Steps:
1 - Create a function library to handle the logic.
1a - This function will need access to the Erp.BO.InspProcessingSvc, and the NonConf table.
2 - Create a function with that takes in 2 inputs:
Input 1 - This input will be the value the users types into the âInspecTime_câ field.
Input 2 - This input will be the âtranIDâ of the NonConf record. You will need this value as an input for the âGetByIDâ method.
3 - Create a variable called NonConfTS, and set it to a NonConf Dataset data type.
(note, if you create the GetByID, then go to the parameters, you can create the variable there as well. This will just store the Dataset for the Update method later)
4 - In your function, call the GetByID, passing Input 2.
5 - Next, update your dataset (there are several ways to do this), and update RowMod â âUâ, and InspecTime_c â Input 1.
6 - Call the Update method, and pass your NonConfTS variable.
7 - Go to application studio, and create a new event. This event will call your function. You will pass it the Input 1 and Input 2 it needs. The trigger can run after the âPerformUpdateâ event is finished.
After that, youâre done! When the user presses save, the data will now be committed to the NonConf table, and will be there after the refresh.
I know this was a long winded explanation, so if you have any questions, feel free to let me know. I would have setup the function, and provided screenshots or the files for it, but Iâm late on some obligations. This is all of the info you need to set this up on your own though. If you havenât built a function yet, this will be a great foray into functions, as they are super helpful to know how to use.
Have a great weekend~