top of page
Search

How to create records in CDS from canvas app using PATCH function


We can create records in CDS (for that matter any Data Source) from canvas app Using a PATCH function


Now let us se how can we create a record Using a PATCH function


there are two ways that we can make use of PATCH function to create a record.

  1. Multi Form

  2. using controls to create a record

Multi Form

suppose if we want to show some data as sectional information (to let the user fill up the form in sections) we can use this Multi Forms.


scenario: if we have a data source called "Students", which has around 10 fields to create a single student entry. We wanted to show up a form (frmStudentGenInfo) as one section called "General Information" and another form (frmStudentContactInfo) as a section called "Contact Information"


Now to create a record on a button click use this below snippet

PATCH(Students, frmStudentGenInfo.Updates,frmStudentContactInfo.Updates)

using OOB controls to create a record


Scenario: if we planned to create our own UI (since we cannot customize a FORM control layout) with OOB controls to create a record in the back-end we can go with this PATCH control

Patch(
    Students,
    Defaults(Students),
    {studentName: "Power Assist", email: powerassit@gmail.com}
    )
ree
ree
ree

Refer this to check out how to create a record using a FORM Control

 
 
 

Comments


bottom of page