To enable Call Back Hook, add a callBackHook property to jobs.json. ()
To find {fieldName} , you are required to have access to Alpha or use Network in Developer Tools [F12].
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)