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

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Did you miss the call? Check out the recording here!

Top Solution Authors
Top Kudoed Authors
Users online (36,814)