lrvtc.updateMessageIfequals

Replaces the data in a field if the current data equals a given value.

ExampleData Update Functions

Syntax

lrvtc.updateMessageIfequals ( columnName, rowIndex , value, ifEqualValue );

Arguments

nameComments
columnNameThe column to write to.
rowIndexThe number of the row. The first row has index 1.
valueThe value to set the field to.
ifEqualValueThe value to compare the current value of the field to.

lrvtc.updateMessageIfequals writes the value to the field specified with the column name and row index if the value of the field when lrvtc.updateMessageIfequals is called is equal to the ifEqualValue. If the ifEqualValue and the field value match, the field value is overwritten.

Return Values

0: If API call was successful but value was not updated.

1: If API call was successful and value was updated.

On call failure, one of the Error Codes.

Parameterization

All string input arguments can be passed using standard parameterization.

Example

    var rc;
    ....
    rc =  lrvtc.updateMessageIfequals("P_status", 18, "out of stock","instock");
    lr.logMessage("update_message rc="+ rc);