Hi everybody, I have a simple code:
{
request: "crt.HandleViewModelResumeRequest",
handler: async (request, next) => {
await next?.handle(request);
const cardState = await request.$context.CardState;
if (cardState === 'add' || cardState === 'copy') {
// prepare fields
request.$context.UsrLanguage_d00q91z = {value: "6ebc31fa-ee6c-48e9-81bf-8003ac03b019", displayValue: "English (United States)"};
}
}
},
the thing is, that it correctly enters the code everytime, but fills UsrLanguage_d00q91z with the desired value only once - after the local cache was deleted (or page was refreshed). The next time code works, but on the opened page UsrLanguage_d00q91z is empty. Why?!
PS. Unfortunately I can't use for some reasons default values set for object fields.