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

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
Solution Supplier
Solution Supplier

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
Solution Supplier
Solution Supplier

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

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (7,999)