// The following code can provide you a generic way to update a table when you only have the tableId. public Common findRecord(TableId _tableId, RecId _recId, Boolean _forUpdate = false) { Common common; DictTable dictTable; ; dictTable = new DictTable(_tableId); common = dictTable.makeRecord(); common.selectForUpdate(_forUpdate); select common where common.RecId == _recId; return common; } // If you want, you can even update fields in this common record. You can Access/edit these fields by using their Name or FieldNum. The method below will update a specific field in a table. public void updateValue(TableId _tableId, RecId _recId, str _field, AnyType _value) { Common common; Int fieldId; ; ttsbegin; common = findRecord(_tableId, _recId, true); fieldId = fieldname2id(_tableId,_field); if (fieldId && _value) { common.(fieldId) = _value; common.update(); } ttscommit; }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter