cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
marvinbarnuevo
Level: Powered On

Patch producttypecode error CDS

Hi,

 

I am trying to update producttypecode of Quote Products in CDS but I keep on getting "The type of this argument 'producttypecode' does not match the expected type 'OptionSetValue'. Found type 'Number'.

 

Patch(
'Quote Products',
Defaults('Quote Products'),
{producttypecode: 1
}
)

 

Or if my expression is like this:

Patch(
'Quote Products',
Defaults('Quote Products'),
{producttypecode: ThisItem.Product.'Product Type'
}
)

 

the error is "Invalid argument type. Expecting a OptionSetValue value, but of a different schema

 

Thanks in advance

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Patch producttypecode error CDS

The second syntax is correct, but it looks like you're using 2 different option sets. The producttypecode option set on the Quote Product entity is not the same as the Product Type on the Product entity. The former is a global option set (also used on Order Product, Invoice Product and Opportunity Product), and by default has values 'Product', 'Bundle', 'Required Bundle Product' etc. The Product Type on the Product entity is specific to the Product entity and by default has values 'Sales Inventory', 'Services' etc. (though these values are often customised)

View solution in original post

2 REPLIES 2

Re: Patch producttypecode error CDS

The second syntax is correct, but it looks like you're using 2 different option sets. The producttypecode option set on the Quote Product entity is not the same as the Product Type on the Product entity. The former is a global option set (also used on Order Product, Invoice Product and Opportunity Product), and by default has values 'Product', 'Bundle', 'Required Bundle Product' etc. The Product Type on the Product entity is specific to the Product entity and by default has values 'Sales Inventory', 'Services' etc. (though these values are often customised)

View solution in original post

marvinbarnuevo
Level: Powered On

Re: Patch producttypecode error CDS

You are right!! It seems like I can't find the right producttypecode to any other entities. What I would like to do is populate this dynamically.

 

This producttypecode is not required when using d365 connector.

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (5,819)