Web Services Developer's Guide → Web Services API Reference → SBM Application Web Services → Arguments → Set-Value-Method
Set-Value-Method indicates how to process values in a text field or any field that contains multiple values such as Multi-Selection, Multi-Relational, Multi-Group, or Multi-User.
Name | Type | Description |
---|---|---|
REPLACE-VALUES | string | If you choose REPLACE-VALUES, Set-Value-Method replaces the current value. Applies to all fields. If a Set-Value-Method is not specified, REPLACE-VALUES is assumed by default. |
APPEND-VALUES | string | If you choose APPEND-VALUES, Set-Value-Method appends the value to the previous entry. Applies to Text and all multi-value fields. |
REMOVE-VALUES | string | If you choose REMOVE-VALUES, Set-Value-Method removes the value. Only applies to multi-value fields. |
You can use Set-Value-Method to specify how text fields or any field that holds multiple values should process the value or values that are passed in the setValueBy argument. For example, you could use this argument to replace one or more values in a Multi-Relational field, append new text to a Journal field, or remove specified values from a Multi-Selection list. Specifying a Set-Value-Method parameter is useful if you plan to have multiple Web service calls updating the same field on the same item. By using Set-Value-Method, field values can be managed dynamically; there is no need to ensure that the last update made contains the definitive selections for a given field. Otherwise, if Set-Value-Method is not supplied, the values will be replaced or an empty value will be set, depending on how the value or values are sent.
The following XML snippets show each Set-Value-Method in the <urn:extendedField> element, with a brief description of the results.
<urn:extendedField> <urn:id> <urn:displayName>Text Field</urn:displayName> <urn:id></urn:id> <urn:uuid></urn:uuid> <urn:dbName>TEXT_FIELD</urn:dbName> </urn:id> <urn:setValueBy>INTERNAL-VALUE</urn:setValueBy> <urn:setValueMethod>REPLACE-VALUES</urn:setValueMethod> <urn:value> <urn:displayValue>11</urn:displayValue> <urn:internalValue>11</urn:internalValue> </urn:value> </urn:extendedField> <urn:extendedField> <urn:id> <urn:displayName>Text Field</urn:displayName> <urn:id></urn:id> <urn:uuid></urn:uuid> <urn:dbName>TEXT_FIELD</urn:dbName> </urn:id> <urn:setValueBy>INTERNAL-VALUE</urn:setValueBy> <urn:setValueMethod>APPEND-VALUES</urn:setValueMethod> <urn:value> <urn:displayValue>22</urn:displayValue> <urn:internalValue>22</urn:internalValue> </urn:value> </urn:extendedField>
11 22
<urn:extendedField> <urn:id> <urn:displayName>WCRS</urn:displayName> <urn:id></urn:id> <urn:uuid></urn:uuid> <urn:dbName>WCRS</urn:dbName> </urn:id> <urn:setValueBy>INTERNAL-VALUE</urn:setValueBy> <urn:setValueMethod>REPLACE-VALUES</urn:setValueMethod> <urn:value> <urn:displayValue>ZMF00026: Release Package - Construction</urn:displayValue> <urn:internalValue>1015:10</urn:internalValue> <urn:uuid>af93aad0-8245-4e49-ac91-574725f7041f</urn:uuid> </urn:value> <urn:value> <urn:displayValue>ZMF00028: Release Package - Construction</urn:displayValue> <urn:internalValue>1015:11</urn:internalValue> <urn:uuid>e16d9550-c2bc-41b9-99c6-f716cb5a7022</urn:uuid> </urn:value> </urn:extendedField>
This call would replace the current selections in the Multi-Relational WCRS field with two new records (10 and 11) from table 1015.
<urn:extendedField> <urn:id> <urn:displayName>WCRS</urn:displayName> <urn:id></urn:id> <urn:uuid></urn:uuid> <urn:dbName>WCRS</urn:dbName> </urn:id> <urn:setValueBy>INTERNAL-VALUE</urn:setValueBy> <urn:setValueMethod>APPEND-VALUES</urn:setValueMethod> <urn:value> <urn:displayValue>ZMF00032: Relase Unit - Construction</urn:displayValue> <urn:internalValue>1015:12</urn:internalValue> <urn:uuid>15ce4bc2-347e-41bb-acaf-f3dd434a9633</urn:uuid> </urn:value> <urn:value> <urn:displayValue>ZMF00033: Relase Unit - Construction</urn:displayValue> <urn:internalValue>1015:13</urn:internalValue> <urn:uuid>5e8d1cb0-b177-4aa5-ae8c-bd169e31f6da</urn:uuid> </urn:value> </urn:extendedField>
This call would add two additional selections to the Multi-Relational WCRS field. Records 12 and 13 from table 1015 would now be selected in this field along with the previous selections that were made in the field.
<urn:extendedField> <urn:id> <urn:displayName>WCRS</urn:displayName> <urn:id></urn:id> <urn:uuid></urn:uuid> <urn:dbName>WCRS</urn:dbName> </urn:id> <urn:setValueBy>INTERNAL-VALUE</urn:setValueBy> <urn:setValueMethod>REMOVE-VALUES</urn:setValueMethod> <urn:value> <urn:displayValue>ZMF00032: Relase Unit - Construction</urn:displayValue> <urn:internalValue>1015:12</urn:internalValue> <urn:uuid>15ce4bc2-347e-41bb-acaf-f3dd434a9633</urn:uuid> </urn:value> <urn:value> <urn:displayValue>ZMF00026: Release Package - Construction</urn:displayValue> <urn:internalValue>1015:10</urn:internalValue> <urn:uuid>af93aad0-8245-4e49-ac91-574725f7041f</urn:uuid> </urn:value> </urn:extendedField>
This call would simply remove records 10 and 12 from the Multi-Relational WCRS field.
<urn:extendedField> <urn:id> <urn:displayName>Colors</urn:displayName> <urn:id></urn:id> <urn:uuid></urn:uuid> <urn:dbName>COLORS</urn:dbName> </urn:id> <urn:id>178</urn:id> <urn:setValueBy>INTERNAL-VALUE</urn:setValueBy> <urn:setValueMethod>REMOVE-VALUES</urn:setValueMethod> <urn:value> <urn:displayValue>Red</urn:displayValue> <urn:internalValue>5</urn:internalValue> </urn:value> <urn:value> <urn:displayValue>Green</urn:displayValue> <urn:internalValue>6</urn:internalValue> </urn:value> </urn:extendedField>
This call would remove the "Red" and "Green" selections from the Multi-Selection "Colors" field.
Copyright © 2007–2015 Serena Software, Inc. All rights reserved.