[英]How can I get custom property information in Commerce Server?
I'm using the following code in a CS2007 web service: 我在CS2007 Web服务中使用以下代码:
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. 我可以轻松获取ProductId
, RelatedProducts
, ParentCategories
等,但是无法获取任何自定义属性。 There are things like IsDiscontinued
and Visible
that I need to get, but aren't being returned in the result set. 我需要获取IsDiscontinued
和Visible
类的东西,但不会在结果集中返回它们。
Steve, 史蒂夫
It is possible you have not set these properties in Microsoft Commerce Server Catalog and Inventory Schema manager properly. 可能您没有在Microsoft Commerce Server目录和库存架构管理器中正确设置这些属性。 You must set the "Free Text Searchable" property to true for any property that is custom. 对于任何自定义属性,必须将“自由文本可搜索”属性设置为true。
See the documentation here: 请参阅此处的文档:
http://msdn.microsoft.com/en-us/library/ms943113(v=cs.70).aspx http://msdn.microsoft.com/zh-CN/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." “选中此复选框,以便目录中的自由文本搜索将应用于存储在此属性中的值。当您选择“ Free Text Searchable”时,Commerce Server将属性定义添加到目录的全文索引中。您必须更新全文更改目录中标记为可搜索的项目后的文本索引。”
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. 重要说明:请确保更新全文本索引,否则Catalog Web Service将查询未填充的索引,即使您将“自由文本可搜索”属性设置为true,您仍然必须更新索引。
In Case anyone else has the same problem four years later. 以防万一,四年后,其他任何人都遇到了同样的问题。
pf["IsDiscontinued"]
should serve what you were lokking for. 应该可以满足您的需求。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.