A Result object indicating the success or failure of the save operation.
Update
Updates the attribute name with the provided value
DSApi.update(className, id, attrName, value)
or
DSApi.update(className, id, attrName, value, auditMsg)
Parameters
className: the name of class as created using the workbench
(correspond to the table)
id: str
attrName: str
value: obj
auditMsg: str
Sample Code
className = "shared.common.product"
id = "12"
attrName = "price"
value = 700
res = DSApi.update(className, id, attrName, value)
Returns
A Result object indicating the success or failure of the update operation.
UpdateMany
Update many records at a time. The class name is provided that indirectly represents a table. β
DSApi.updateMany(className, ids, attrName, value)
or
DSApi.updateMany(className, ids, attrName, value, auditMsg)
Parameters
className: the str name of class as created using the workbench
(correspond to the table)
ids: List<String> rows needed to be modified
attrName: the name of the column as str
value: the Object value of inside the column for the specific row
auditMsg: any informational message as str
Sample Code
className = "shared.common.product"
ids = ["12", "15"]
attrName = "price"
value = 700
res = DSApi.updateMany(className, ids, attrName, value)
Returns
A Result object indicating the success or failure of the update operation.
UpdateByQuery
Update by executing a query on the table. βit takes partial query which is the embellished with where clauses.
DSApi.updateByQuery(className, query, updateAttrs)
or
DSApi.updateByQuery(className, query, updateAttrs, auditMsg)
Parameters
className: the str name of class as created using the workbench
(correspond to the table)
query: the str type query represents the filtering criteria
updateAttrs: update dictionary for the attributes
auditMsg: a str type informational message