Application Studio View not saving data for UD field

On the inspection processing page under inventory detail, I have added a UD field for the QA department to document the Total Inspection time. The data is not saving😔

It’s bound to the invView

The UD field is showing up correctly in the view.

But when I enter data into the field and save the change but it’s not saving the data. What am I missing?

I’ve done a regen, its showing in my InvView, I’ve bound the data.
I’m on Kinetic, on prem, version 2023.2

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~

2 Likes

Thank you for the very in-depth explanation of what is going on with my data not saving. It is very much appreciated. I’ll work on that function and reach out if I have any questions. Thank you again.

1 Like