Call Back
Callbacks allow to capture values returned by the server during a sync and update into Inistate records.
Primary Field
UI Name
PRIMARY-FIELD
Type
Remarks
Creditor / Debtor Account
AccNo
String
E.g.: 301-A001
, 401-A002
CallBack Field
UI Name
CALLBACK-FIELD
Remarks
Tax Entity/TIN
Tin
String
E.g.: NoTIN-00000001
To enable Call Back Hook, add a callBackHook
property to jobs.json
. (refer link)
moduleName = "{YOUR_MODULE_NAME}"
if inputs is not None and inputs['result'] is not None and inputs['result']['{PRIMARY-FIELD}'] is not None and inputs['result']['{CALLBACK-FEILD}'] is not None:
doc = Module(moduleName).find({ 'Dynamic.Extension.{fieldName}': inputs['result']['{PRIMARY-FIELD}'] })
if doc is not None:
newValue = inputs['result']['{CALLBACK-FEILD}']
if doc['{YOUR-FIELD-TO-UPDATE}'] == '' or doc['{YOUR-FIELD-TO-UPDATE}'] != newValue:
form = Module(moduleName).execute('sync', doc)
form['{YOUR-FIELD-TO-UPDATE}'] = newValue
Module(moduleName).submit(doc, form)
Last updated