cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate II
Advocate II

boolean patch to cds

I have what used to be an easy deal with SQL patch for boolean value on a selected Gallery record:

            Patch('[dbo].[Delivery]',ThisItem,{Active:true})

I transitioned table over to CDS in order to take advantage of the attachment capability.  I created a two-option field to handle the boolean (yes/no).

However, when I reworked the functions to use new CDS table, I cannot seem to get that boolean to work.  I have tried:

          Patch(Deliveries_1,ThisItem,{Active:true})

but it gives me an error: " Invalid argument type. Expecting a optionsetvalue, but of a different schema."

I have tried replacing true with yes, "yes", "true"

 

Can anyone please tell me what I'm missing to make this work?

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Advocate II
Advocate II

Re: boolean patch to cds

I found what I think I needed here, but it's not very straightforward.

 

https://www.youtube.com/watch?v=pj7AJy_UVIw by Daniel Christian

 

I am kind of frustrated when some very workable, SQL compliant data types (e.g., autonumber for indexes and simple boolean data types) have been swept away and replaced by more complicated and obscure elements in CDS.

 

View solution in original post

2 REPLIES 2
Highlighted
Advocate II
Advocate II

Re: boolean patch to cds

I found what I think I needed here, but it's not very straightforward.

 

https://www.youtube.com/watch?v=pj7AJy_UVIw by Daniel Christian

 

I am kind of frustrated when some very workable, SQL compliant data types (e.g., autonumber for indexes and simple boolean data types) have been swept away and replaced by more complicated and obscure elements in CDS.

 

View solution in original post

Advocate IV
Advocate IV

Re: boolean patch to cds

This works for standard option sets, but how do you get the value of the Yes/No in a Two Option field type, it's not visible in the UI. Using the option set values using this syntax works for others; [@fieldname].'Option1'

 

Thanks

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Users online (1,918)