reptar
03/13/2024, 1:39 PMpageInit
, but it's a terrible solution. The page fully loads and then jerks the user into reloading the page. Has anyone come up with a better solution for forcing users onto a new form without setting it as preferred? I've added an alert letting the user know they can bookmark the page they get redirected to, but I don't like this UX. at all.James Pak
03/13/2024, 1:50 PMcustomform
on beforeLoad works. I'm assuming you've already tried this but I need to see lolJames Pak
03/13/2024, 1:52 PMerictgrubaugh
03/13/2024, 1:52 PMbeforeLoad
, I believe you can use redirect.toRecord and set cf
to the desired custom form in the parameters
option.James Pak
03/13/2024, 1:53 PMJames Pak
03/13/2024, 1:55 PMbeforeLoad: function(scriptContext) {
if (scriptContext.newRecord.getValue('customform') != 115) {
redirect.redirect({
url: '/app/accounting/transactions/vendbill.nl?whence=',
parameters: {
'cf': MY_FORM
}
});
}
},
here's what I didJames Pak
03/13/2024, 1:56 PMJames Pak
03/13/2024, 1:56 PMerictgrubaugh
03/13/2024, 1:57 PMredirect.redirect()
with:
redirect.toRecord({
...context.newRecord,
parameters: {
cf: MY_FORM
}
})
erictgrubaugh
03/13/2024, 1:58 PMredirect.toRecord({
type: context.newRecord.type,
id: context.newRecord.id,
parameters: {
cf: MY_FORM
}
})
reptar
03/13/2024, 2:05 PMerictgrubaugh
03/13/2024, 3:10 PMredirect.toRecord()
approach work in a beforeLoad
? That should avoid the page reload issue since it happens server-side.reptar
03/13/2024, 3:10 PMreptar
03/13/2024, 3:11 PMreptar
03/13/2024, 3:11 PMerictgrubaugh
03/13/2024, 3:57 PMmichoel
03/14/2024, 12:28 AM&record.employee=123