cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
eauerbach
Helper III
Helper III

Saving CDS Entities: SubmitForm or Patch?

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. 

1 ACCEPTED SOLUTION

Accepted Solutions
v-yutliu-msft
Community Support
Community Support

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,

 

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yutliu-msft
Community Support
Community Support

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,

 

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@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. 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (2,435)