What is the recommended method for creating/updating CDS entities: SubmitForm or Patch? For my forms, I'm trying to use SubmitForm for its simplicity, but keep running into issues with default values on creation ("The specified column is generated by the server and can't be specified") and assigning owner/user records. I've got Patch setup for a silent update, but it seems cumbersome to use for a larger entities.
Solved! Go to Solution.
Hi @eauerbach ,
Using submitform and patch function to update CDS entity is both ok.
If you want to use submitform function, you need to use form.
In this way, you will submit all the data in the form at the same time.
If you want to use Patch function, you could use form or controls.
In this way, you need to enter every fields' data one by one in the formula.
In your issue, you met that error is because that you inserted columns that their value should be generated by the server.
You could not enter data manually in this kind of fields.
Please check which fields are this kind of fields and delete them in the form.
Best regards,
Hi @eauerbach ,
Using submitform and patch function to update CDS entity is both ok.
If you want to use submitform function, you need to use form.
In this way, you will submit all the data in the form at the same time.
If you want to use Patch function, you could use form or controls.
In this way, you need to enter every fields' data one by one in the formula.
In your issue, you met that error is because that you inserted columns that their value should be generated by the server.
You could not enter data manually in this kind of fields.
Please check which fields are this kind of fields and delete them in the form.
Best regards,
@v-yutliu-msft Thanks for the reply. Errors were due to state/status codes, so we had to rework the entity to get it to work properly. Sticking with patch in this scenario for some customization I don't see as being possible with SubmitForm since not all fields are present.
User | Count |
---|---|
24 | |
4 | |
4 | |
3 | |
3 |
User | Count |
---|---|
26 | |
10 | |
9 | |
9 | |
7 |