NGS - How to autopopulate fields from rest call?
Summary:
We are creating debrief from workorder object.
when we click create debrief from work order it is defaulting some fields from work order.
for defaulting fields we have used on create event.
below code:
define([
'vb/action/actionChain',
'vb/action/actions',
'vb/action/actionUtils',
], (
ActionChain,
Actions,
ActionUtils
) => {
'use strict';
class onCreateCallbackChain extends ActionChain {
/**
* @param {Object} context
* @param {Object} params
* @param {{row:object,parentRow:object,mode:string}} params.event
* @param {(previous: {row:object,child:object[],related:object[],deDuplicateConfig:object}) => void} params.done
* @return {(previous: {row:object,child:object[],related:object[],deDuplicateConfig:object}) => void}
*/
async run(context, { event, done }) {
const { $layout, $extension, $responsive, $user } = context;