Edit

ChangePrimaryKeyCode (table, oldCode, newCode)

Result type:  Boolean

Definition:  Change a tax rate's identifying code and update all usages in the database. Requires single user mode.

Returns true on success. On failure (false return), check GetLastErrorMessage() for an explanation.

In MoneyWorks 9.1.5, this function supports only changing tax codes. It will be expanded in future.

Example:  ChangePrimaryKeyCode("taxrate", "N", "G")

Updates every instance of N tax code in the database to be G. This may take some time.

Availability:  MWScript in MoneyWorks 9.1.5 and later.