JS Function:
| Name | Type | Description |
|---|---|---|
| hotrow | number | Current grid row number |
| hotcol | number | Current grid column number |
| colname | string | Current grid column field name |
| oldval | any | Existing value before the field was edited |
| newval | any | New value after the field was edited |
Return
- Nothing: This function does not return a value but updates related fields directly within the grid.
Application in Merciglobal Cloud ERP
This function type is integral in modules like Sales, Purchase, and Inventory where real-time calculations (like Amount = Rate * Quantity) are crucial for accuracy. By automatically updating dependent fields, it reduces manual errors and ensures seamless data coherence across forms and tables.
Best Practices
- Use
eval(newval)cautiously; consider sanitizing inputs to avoid malicious scripts. - Always validate the existence of dependent fields (
qty,amount) before applying logic. - Avoid triggering recursive validations by utilizing flags like
'AUTOSET'.