SetAttrValue(String,Object,String,String,String,String,String,String,String,Boolean) Method
- Last UpdatedNov 06, 2025
- 2 minute read
The SetAttrValue() method adds an attribute or updates the value of an existing attribute. A flag indicates whether the value is being added or updated. The method includes a lastEdit DateTime parameter that can be used for optimistic concurrency control. This overload of the method uses the attribute name and two filter items to specify the attribute.
'Declaration
Public Overloads Shared Function SetAttrValue( _
ByVal attrName As String, _
ByVal attrVal As Object, _
ByVal lastEdit As String, _
ByVal modId As String, _
ByVal tableName As String, _
ByVal filterField As String, _
ByVal filterValue As String, _
ByVal filterField1 As String, _
ByVal filterValue1 As String, _
ByVal bAdd As Boolean _
) As Boolean
public static bool SetAttrValue(
string attrName,
object attrVal,
string lastEdit,
string modId,
string tableName,
string filterField,
string filterValue,
string filterField1,
string filterValue1,
bool bAdd
)
Parameters
- attrName
- Required. Holds the name of the attribute whose value is being added or updated.
- attrVal
- Required. Holds the attribute value.
- lastEdit
- Required. Holds a DateTime value to avoid data contention. The passed value must match the lastEdit value in the database for the update to succeed.
- modId
- Required. Holds the mod ID.
- tableName
- Required. Holds the attribute table name to be read; for example, "item_attr" for item attributes.
- filterField
- Required. Holds the first filter field to be used; for example, "item_id".
- filterValue
- Required. Holds the filter value associated with the first filter field.
- filterField1
- Optional. Holds the second filter field to be used.
- filterValue1
- Optional. Holds the filter value associated with the second filter field.
- bAdd
- Optional. Holds a flag that, if set to true, indicates that the attribute is being added. If the flag is set to false, it indicates that the attribute is being updated.
Return Value
Returns true if setting the attribute value succeeds and false if setting
the attribute value fails.