cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
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
secondImage

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

Top Solution Authors
Top Kudoed Authors
Users online (65,886)