The
ProcessCustomChoice method allows you to insert, modify or delete custom lookup choices.
The
ProcessCustomChoice method is invoked using the
MethodOperation.
Parameters
Name |
Type |
Description |
ChoiceID |
Integer |
Required. This is the ID that references the drop-down field and is found in the Lookup section of the DataDictionary. |
ChoiceIndex |
String |
This is the index value of the lookup choice. This parameter is required only when you are modifying or deleting an existing lookup choice. To obtain the choice index value, you can insert a lookup choice (the choice index is included in the XML response) or you can use the GET operation. |
Description |
String |
This is the label for the lookup choice as it will appear in the SmartOffice UI. Include this parameter when inserting or updating a lookup choice. |
Operation |
String |
Required. Valid values: Insert, Update or Delete. |
Examples
Insert
The following example inserts an "Internet" choice in the Source field of contact records. The Source lookup field is referred to as ContactSource in the
DataDictionary; its ID is 178.
Request XML
<request version='1.0'>
<header>
<office>myoffice</office>
<user>jdoe</user>
<password>password</password>
</header>
<method>
<ProcessCustomChoice>
<ChoiceID>178</ChoiceID>
<Description>Internet</Description>
<Operation>Insert</Operation>
</ProcessCustomChoice>
</method>
</request>
The response includes the index value of the new choice (ChoiceIndex).
Response XML
<?xml version="1.0" encoding="UTF-8" ?>
<response version="1.0">
<header>
<sessionClosed />
</header>
<method>
<ProcessCustomChoice>
<Insert status="ok">
<ChoiceIndex>65536</ChoiceIndex>
</Insert>
</ProcessCustomChoice>
</method>
<_status>OK</_status>
<_systime>2016-12-13T20:01:35</_systime>
<!-- Cost 88 mill seconds. -->
</response>
Update
The following example updates the "Internet" choice that we previously inserted, renaming it "Web."
Request XML
<request version='1.0'>
<header>
<office>myoffice</office>
<user>jdoe</user>
<password>password</password>
</header>
<method>
<ProcessCustomChoice>
<ChoiceID>178</ChoiceID>
<ChoiceIndex>65536</ChoiceIndex>
<Description>Web</Description>
<Operation>Update</Operation>
</ProcessCustomChoice>
</method>
</request>
Response XML
<?xml version="1.0" encoding="UTF-8" ?>
<response version="1.0">
<header>
<sessionClosed />
</header>
<method>
<ProcessCustomChoice>
<Update status="ok">
<ChoiceIndex>65536</ChoiceIndex>
</Update>
</ProcessCustomChoice>
</method>
<_status>OK</_status>
<_systime>2016-12-13T20:09:54</_systime>
<!-- Cost 48 mill seconds. -->
</response>
Delete
This example deletes the lookup choice we inserted and updated in the previous examples.
Request XML
<request version='1.0'>
<header>
<office>myoffice</office>
<user>jdoe</user>
<password>password</password>
</header>
<method>
<ProcessCustomChoice>
<ChoiceID>178</ChoiceID>
<ChoiceIndex>65536</ChoiceIndex>
<Operation>Delete</Operation>
</ProcessCustomChoice>
</method>
</request>
Response XML
<?xml version="1.0" encoding="UTF-8" ?>
<response version="1.0">
<header>
<sessionClosed />
</header>
<method>
<ProcessCustomChoice>
<Delete status="ok">
<ChoiceIndex>65536</ChoiceIndex>
</Delete>
</ProcessCustomChoice>
</method>
<_status>OK</_status>
<_systime>2016-12-13T20:14:52</_systime>
<!-- Cost 39 mill seconds. -->
</response>
--
DinosLambropoulos - 13 Dec 2016