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

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

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

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

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.

Top Solution Authors
Top Kudoed Authors
Users online (2,449)