Sets the value of an attribute.
Syntax
unsigned char setAttrValue(char * name, void * newval, int type); unsigned char setAttrValue(int position, void * newVal, int type);
Parameters
BOAttrType::OBJECT BOAttrType::BOOLEAN BOAttrType::INTEGER BOAttrType::FLOAT BOAttrType::DOUBLE BOAttrType::STRING BOAttrType::DATE BOAttrType::LONGTEXT
Return values
Returns True when the operation succeeded or False when the operation failed.
Notes
You can use the name or position method to set an attribute value. These methods verify that the new value has the correct data type before changing the attribute value. If newval is a character pointer, the method sets the value. If type is OBJECT and the attribute refers to a single cardinality object, the setAttrValue() method overwrites the previous business object with the new business object. If type is OBJECT and the attribute refers to a multiple cardinality object, the setAttrValue() method appends the business object to the container.
You can set an attribute to a special value, either BusinessObject::BlankValue or BusinessObject::IgnoreValue. Blank means "clear this field; there is no data in it." Ignore means "I don't know or don't care what is in this field."
Examples
unsigned char status; if (status = pObj->setAttrValue("Interest Rate","0.065", BOAttrType::FLOAT);) == 0) // continue
See also