Custom Screen in Kinetic to Add/Edit records in UD16 Table

I am still fairly new to Epicor Kinetic development (Application Studio). I am trying to create a screen to insert records into UD16 table and when clicking on the save button, I repeatedly get this error:

image

I am not sure what I am doing wrong. Any help is GREATLY appreciated.

Your keys are not unique.

You need to have a combination of the”Key” fields that are unique for each record. You don’t have to use all the key fields, but the combination must be unique.

My Key1 is EmpID and Key2 is the date the record is entered. I can assure you that we do not have any records with this combination of Key1 and Key2.
Also, there is a checkbox for Key Field under the data section of the properties that I have checked for Key1, Key2, Date01 and Date02. I am not sure if I am using this field correctly. My intention was to further segregate the records to ensure that the combination of Key1, Key2, Date01 and Date02 are unique.

The key fields stuff on the form has nothing to do with the key fields of the table.

The error you have shown comes from the business object. I can assure you that you are sending a duplicate of an existing set of keys.

At this point I would run a baq on the table to see what data is in there, and run through the browser debugger to see what is actually getting passed for those fields.

Likely something isn’t getting passed like you think it is.

I am seeing that all the Key values are set to blank:

I do not understand why this is happening as I have the textbox properties set with epBinding ‘UD16.Key1’ and ‘UD16.Key2’ to handle the key fields and create the unique record. I just do not know what I am doing wrong. Are you aware of any literature/videos that walk through this type of scenario?

It looks like your row-update is setting them to blank. If you’re typing them in to fields that are already bound, THAT is adding the value to the dataview/dataset.

If you then run a row-update with empty values, it is going to over-write what you typed in the fields with… well… blank values.

If you’re typing the values into the fields… don’t do a row-update. instead, do a rest-erp to Ice.BO.UD16Svc / Update. This is what pushes the typed values from the local dataset to the server datatable.

1 Like