Screen-defined logical attributes can be updated. However, because they are not persisted directly, updated values can be saved only by changing other attributes in the subject, or by some other means. The method for doing this is to add JavaScript that validates the data and updates the fields.
To validate, an optional JavaScript function can be added to the Validation JavaScript text box of the Configure Standard Profile Screen. A FieldContext object is passed to the function when a field needs to be validated.
The object can be used to validate field values, as shown in the following code example:
function validate(FieldContext, attributeValue, changedValue, errorMessage){ if (attributeValue == "" ){ return true; } var split = attributeValue.split(" "); if ( split.length < 3 ){ errorMessage.reference="City State Zip expected"; return false; } FieldContext.setFieldValue( "City", split[0] ); FieldContext.setFieldValue( "State", split[1] ); FieldContext.setFieldValue( "Zip", split[2] ); return true; }
Copyright © 2013 CA.
All rights reserved.
|
|