How do I obtain the value of a menu type system attribute using the SOAP API functionality?
Environment
Oracle B2C Service, All versions
Resolution
When retrieving a menu type system attribute using the SOAP API functionality, one must use either the NamedID value or NamedID ID to identify the position of the value within the system attribute menu list.
The SOAP envelope should look like one of the 2 below:
======================================================================
<ns2:GenericFields dataType="OBJECT" name="CO">
<ns2:DataValue>
<ns2:ObjectValue xsi:type="ns2:GenericObject">
<ns2:ObjectType>
<ns2:TypeName>ObjectCustomFieldsPackage</ns2:TypeName> *
</ns2:ObjectType>
<ns2:GenericFields dataType="NAMED_ID" name="Name">
<ns2:DataValue>
<ns2:NamedIDValue>
<ID id="1" xmlns="urn:base.ws.rightnow.com/v1_4"/> **
</ns2:NamedIDValue>
</ns2:DataValue>
</ns2:GenericFields>
</ns2:ObjectValue>
</ns2:DataValue>
</ns2:GenericFields>
===========================================================================
<ns2:GenericFields dataType="OBJECT" name="CO">
<ns2:DataValue>
<ns2:ObjectValue xsi:type="ns2:GenericObject">
<ns2:ObjectType>
<ns2:TypeName>ObjectCustomFieldsPackage</ns2:TypeName> *
</ns2:ObjectType>
<ns2:GenericFields dataType="NAMED_ID" name="Name">
<ns2:DataValue>
<ns2:NamedIDValue>
<Name xmlns="urn:base.ws.rightnow.com/v1_4">ValueText</Name> **
</ns2:NamedIDValue>
</ns2:DataValue>
</ns2:GenericFields>
</ns2:ObjectValue>
</ns2:DataValue>
</ns2:GenericFields>
=============================================================================
* 'Object' is the actual object for which the system attribute has been created and 'Package' is the name of the package under which the system attribute got created, so these will need to be replaced in the sample code as per each site configuration.
** There are cases in which either the ID or the Name of the NamedID value will work, not both.
For further information on how to use the SOAP API functionality with Oracle B2C Service, please check our documentation available at Connect Web Services for SOAP.