The darkie speaks

The darkie is an Internet Business Architect with the Professional Services arm of a large computer manufacturer. His expertise is in the Microsoft .NET servers, specifically, Commerce Server, MSIB, Content Management Server and Sharepoint Portal Server. He has delivered training, and consulting on several large deployments for government and fortune 1000 companies.

Wednesday, July 28, 2004

CS2k2 - Adventures in catalog managment

I was at a client today and I ran into a problem with the Commerce Server product picker and the expression builder. It seems that when you use a property definiton that contains an "_" for your product Id, it fails when you try to define an expression.  The error that is raised reads something like, "Unable to create expression. ProductID.Product_X5F_code could not be found".
It looks as though if the product id field and/or variant id field contains an "_" character (actually the code filters other allowed characters such as "-"), the code replaces the invalid character with a "_X{ascii numeric value of character}_" in order to create the XML node name for the data island. The code is in the APP_NAME_BIZDESK\Catalogs\Editor\common.asp page inside the sReplaceSpaces function. The "_" is a valid, allowed character for a product identifier field, "product_code" in our case, so I modified the code in the file to allow the "_" character and the expressions now work correctly. I have included the fix below.

In the Function
 sReplaceSpaces (ByRef sString)
...Some code here

Change the line:
((iChar >=  91) And (iChar <=  96))

((iChar >=  91) And (iChar <=  94)) Or _ 
((iChar =  96)) Or _

...more code here
End Function


Post a Comment

<< Home