cancel
Showing results for 
Search instead for 
Did you mean: 

Attributes values with COM API

Former Member
0 Kudos

Hi,

While using the COM API to fetch records, i am not able to access the attributes values of a associated taxonomy table.

I am add the taxonomy filed to the ResultDefinition and i am able to get the list of attributes from the field. the AttributeEX contain the Attribute and the AttributeValue classes. i am able to see the attribute meta data but the AttributeValue only contain the method AttributeValueType.

How i can identify in my recordset what are the values of the associated taxonomy attributes for each record in the rs.

I have searched the forum but i didn't find the answer.

appreciate your help.

Thanks,

Noam

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Cast the AttributeValueType to a string and then retrieve the attribute values based on the type:



foreach (AttributeEx prodAttribute in prodAttributes)
{			
string attribType = prodAttribute.Values.Item(0).AttributeValueType.ToString();

 if (attribType == "xcFeatureValueType")
 {
     GetLimitedFeatureValues(...,...,...);
 }
 else if (attribType == "xcCharacteristicValueType")
 {
 }
 else if (attribType == "xcCoupledValueType")
 {
 }

Former Member
0 Kudos

Hi Mike,

Thanks for the reply. As i understand, the GetLimitedFeatureValues return the list of available attributes values without relationship to the master record. how i can associate it to the master table recordset i am currently reading.

My goal is to get the attributes values for each recordset row.

Thanks,

Noam

Former Member
0 Kudos

Its relative to the search parameters.

If you wanted to retrieve attributes for a particular record you would do the following:


XCATCOMLib.AttributesEx prodAttributes = new XCATCOMLib.AttributesExClass();
			prodAttributes = catalog.GetLinkedAttributes(PRODUCT_TABLE, CATEGORY_FIELD, productID, -1,false,null);

			XCATCOMLib.Search search = new XCATCOMLib.SearchClass();
			search.SearchTable = PRODUCT_TABLE;

			XCATCOMLib.TableParameter lp = search.Parameters.NewTableParameter(PRODUCT_TABLE);
			lp.RecordIDs.Add(productID);

//loop thru the attributes using the code from my other post

Answers (0)