Hi all,
I have a customer need when opening a case the user has to choose which is the next status for going on.
I followed this article: https://customerfx.com/article/opening-a-record-for-edit-in-a-specific-…
I implemented successfuly on case record opening the popup for choosing the next status when status is new or reopened, ....
It is working fine for opening first record but when closing the record and opening an other record then having an issue on opening the record the variable are not set.
When doing a full refresh in the browser then the record is opening correctly. Do I need to invoke any destroy method after the popup ?
Here is the code of the handler:
{
request: "crt.HandleViewModelResumeRequest",
handler: async (request, next) => {
const handlerChain = sdk.HandlerChainService.instance;
const recId = await request.$context.Id;
const statusStr = await request.$context.PDS_Status_47jug57;
const dspStatus = statusStr.displayValue;
if(dspStatus=="New" || dspStatus=="Reopened"||dspStatus=="In progress" || dspStatus=="Waiting for response"){
await handlerChain.process({
type: "crt.OpenPageRequest",
$context: request.$context,
scopes: [...request.scopes],
schemaName: "s4aCaseStatus_ModalPage",
modelInitConfigs: [
{
action: "edit",
recordId: recId
}
]
}
);
}
return next?.handle(request);
}
}
Thanks in advance