Hello everyone. I am currently working on customizing an API to add customer data one by one into a new screen. I have created the necessary table in the database and the screen to display the data. Everything seems to be functioning correctly. However, I have encountered an issue where adding a new record results using PUT API in the deletion of the old record from both the database and the screen. What steps should I take to address this issue? I have attached a screenshot below for reference.
This is screen.
Page 1 / 1
I’d assume you have some issues with how the key fields are defined for the record and it just overwrites the old record. But it’s impossible to say without the actual code.
I am using Post man right now. I did not code yet. Just trying to make sure everything works fine Then I will start doing code. I will use python
@tahayabali I mean the code for the custom screen/DAC for the new screen.
@Dmitrii Naumov I have created screen using Customization project and then using add new code I have added new dac in it.
So in this DAC I do not see any fields marked as ‘IsKey’. Without that, there can only be one record at a time in this table. So, you should fix the DAC.
yeah But the problem is still same. even after adding IsKey=true and publishing project. Do i need to add iskey in all fields that i am selecting using API?
@tahayabali You need to define which fields are the Primary key of the record and set it to these fields. It should also be done for the DB table itself.
Yeah That’s what I did.
Any on please guide me I am still stuck. The problem is in all screens that i have created. Even database deletes the old one andadding new only.
@tahayabali please attach the customization package. It’s hard to say without looking at the actual screen/DAC structure
Just a simple screen.
@tahayabali the package does not contain the SQL table definition. It would be nice to see that as well.
But overall, I do not understand what you are trying to achieve here.
Do you want a screen that displays a list of records and you send PUT requests to insert a record for different agdc_packing_id ?
Yes. I am trying to insert data for different agdc_packing_id using PUT request
There is no PK in this DB table definition.
You must have a PK defined and it also must have CompanyID column as a part of the primary key.
I have already tried with that. Again I have added PK in company id and packing_id but still When i put data using API is changes the record I dont know what’s happening.
Hi @tahayabali were you able to find a solution? Thank you!