Initializes attributes that do not have values set, but are marked as required, with their default values.
public static void initAndValidateAttributes(
BusinessObjectInterface theBusObj);
None.
The initAndValidateAttributes() method has two purposes:
In case of failure, no value exists some attributes (those without default values) after initAndValidateAttributes() finishes default-value processing . You might want to code your connector's application-specific component to catch this exception and return CxStatusConstants.FAIL.
The initAndValidateAttributes()method looks at every attribute in all levels of a business object and determines the following:
If an attribute is required and UseDefaults is true, initAndValidateAttributes() sets the value of any unset attribute to its default value. To have initAndValidateAttributes() set the attribute value to the special Blank value (CxBlank), you can set the attribute's default value to the string "CxBlank". If the attribute does not have a default value, initAndValidateAttributes() throws the SetDefaultFailedException exception.
The initAndValidateAttributes() method is usually called from the business-object-handler doVerbFor() method to ensure that required attributes have values before a Create operation is performed in an application. In the doVerbFor() method, you can call the initAndValidateAttributes() method for the Create verb. You can also call it for the Update verb, before it performs a Create.
To use initAndValidateAttributes(), you must also do the following: