简体   繁体   English

如何在Commerce Server中获取自定义属性信息?

[英]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. 我可以轻松获取ProductIdRelatedProductsParentCategories等,但是无法获取任何自定义属性。 There are things like IsDiscontinued and Visible that I need to get, but aren't being returned in the result set. 我需要获取IsDiscontinuedVisible类的东西,但不会在结果集中返回它们。

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.

相关问题 如何获得自定义属性的值? - How can i get the value of the custom property? 如何在自定义控件的属性网格中获取OpenFileDialog? - How can I get an OpenFileDialog in a custom control's property grid? 如何通过带有反射C#的属性获取类信息 - How can I get class information by property w/ reflection C# 如何在.net中获取cpu信息? - How can i get the cpu information in .net? 如何获取属于自定义属性的属性? - How to I get the property belonging to a custom attribute? 如何从Commerce Server获取折扣的开始和结束日期? - How to get Discount Start and End Date from Commerce Server? (Commerce Server)如何在不实例化新的MarketingContext对象的情况下获取PageGroup [] - (Commerce Server) How to get the PageGroup[] without instancing a new MarketingContext object 我可以将Dictionary类型用作自定义服务器控件的(persistet)属性吗? - Can I use the Dictionary type as a (persistet) property of a custom server control? 如何使自定义属性出现在属性管理器中? - How do I get a custom property to appear in the property manager? 如何获取具有自定义属性的类的每个属性,然后在下拉列表中显示它们? - How can I get each property of class that has custom Attribute then show them in dropdown?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM