cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
michealeseecc
Level 4

searchActivatableItem Custom Attribute with attribute name and value

Hi All,

 

I want to searchActivatableItem Custom Attribute with attribute name and value. My code as below, something wrong on the portion of highlighted code below. Can anyone help me on this?

searchActivatableItemDataType searchtype = new searchActivatableItemDataType();
Flexnet.Entitlement_Serv.SimpleQueryType qtype = new Flexnet.Entitlement_Serv.SimpleQueryType();
qtype.searchType = Flexnet.Entitlement_Serv.simpleSearchType.CONTAINS;
qtype.value = reader.GetString(0);
searchtype.entitlementId = qtype;
Flexnet.Entitlement_Serv.SimpleQueryType qtype2 = new Flexnet.Entitlement_Serv.SimpleQueryType();
qtype2.searchType = Flexnet.Entitlement_Serv.simpleSearchType.CONTAINS;
qtype2.value = reader.GetString(1);
searchtype.customAttributes.attributes.lineItemCustomAttributeQueryType.attributeName = "SerialNumber";
searchtype.customAttributes.attributes.lineItemCustomAttributeQueryType.stringValue = qtype2;

Please advise.

 

Thanks.

 

Regards,

Micheale

 

0 Kudos
(1) Reply
michealeseecc
Level 4

Hi,

 

I manage to modified to this:-

searchActivatableItemDataType searchtype2 = new searchActivatableItemDataType();
Flexnet.Entitlement_Serv.SimpleQueryType qtype2 = new Flexnet.Entitlement_Serv.SimpleQueryType();
qtype2.searchType = Flexnet.Entitlement_Serv.simpleSearchType.CONTAINS;
qtype2.value = reader.GetString(0);
searchtype2.entitlementId = qtype2;
searchtype2.lineItemAttributes = new lineItemCustomAttributeQueryType[]
{
new lineItemCustomAttributeQueryType {
attributeName = "SerialNumber",
stringValue = new Flexnet.Entitlement_Serv.SimpleQueryType() {
searchType = Flexnet.Entitlement_Serv.simpleSearchType.CONTAINS,
value = reader.GetString(1)
}
}
};

Below is the print screen from Report which I able to get the custom attribute for SerialNumber under field name: Entitlement Line Custom Attribute 3 Name;   Value: Entitlement Line Custom Attribute 3 Value

error2.png

 

Working Perfectly now.

Issued Closed.

 

Thanks

 

Regards,

Micheale

0 Kudos