How can I get custom property information in Commerce Server?

397 views Asked by At

I'm using the following code in a CS2007 web service:

F.Product pf = FMJ.GetProduct("XXX", productId.Trim() + "(VIRTUAL)","en", pc);

I can easily get the ProductId, RelatedProducts, ParentCategories and so on, but am unable to get any of the custom properties. There are things like IsDiscontinued and Visible that I need to get, but aren't being returned in the result set.

2

There are 2 answers

0
flo1411 On

In Case anyone else has the same problem four years later.

pf["IsDiscontinued"] 

should serve what you were lokking for.

0
RazorEdge On

Steve,

It is possible you have not set these properties in Microsoft Commerce Server Catalog and Inventory Schema manager properly. You must set the "Free Text Searchable" property to true for any property that is custom.

See the documentation here:

http://msdn.microsoft.com/en-us/library/ms943113(v=cs.70).aspx

As stated in the documentation for the Free Text Searchable property:

"Select this check box so that free text searching on the catalog will apply to values stored in this property. When you select Free Text Searchable, Commerce Server adds the property definition to the full-text index for the catalog. You must update the full-text index after changing items in the catalogs that are marked as searchable."

IMPORTANT NOTE: Make sure to update the full text index, otherwise the Catalog Web Service will be querying an index that is not populated, even if you have set the "Free Text Searchable" property to true, you still have to update the index.