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.

View solution in original post

@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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (2,244)