Best practices and tips on creating records using Patch Function and Form Controls
- Sai Krishna
- Aug 4, 2020
- 1 min read
Make sure the "Default Mode" property of a FORM control is set to "New" in case its used to create a new record
Make user the Form control is reset after each new record creation/submission. Otherwise due to old data cache the FORM can't be visible on the screen
Performance of the below expression is slow because every time the Defaults() function is invoked, there is a call to the server where MyTable is stored. The above expression would then make at least two calls, one for the Defaults() and one for the Patch().
Patch(
Student,
Defaults(Student),
{studentName: "Power Assist", email: "powerassist@gmail.com"})The only columns that are really needed are the ones that participate in the primary key. Normally this is just an id column. So actually in a lot of cases, something like this will work for creating a new record:
Patch(Student,
{ID: Blank()},
{studentName: "Power Assist", email: "powerassist@gmail.com"})


Comments