cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Perumal
Continued Contributor
Continued Contributor

Create new Sales Invoice Line record

I am trying to create a new "Sales invoice line" record in new CDS, which has "Status" field of enumeration which has values["Active", "Invoice",....]. I got struck with Patch() function which creates a new create record and don't know how to set the "Status" field with any of the enumeration values.

 

 

2 REPLIES 2
murali
Power Apps
Power Apps

You should be able to do this

 

Patch('Sales invoice line', Defaults('Sales invoice line'), {Status: "Active"})

 

If you want user to select the status, you should be able to bind allowed values for status to say a dropdown and get the selection from there

 

Dropdown1.Items = DataSourceInfo('Sales invoice line', AllowedValues, "Status)

 

Patch('Sales invoice line', Defaults('Sales invoice line'), {Status: Dropdown1.Selected.Value})

 

Hope this helps.

 

Thanks

Murali

@Perumal - did the provided solution work for you?

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,140)