Is it possible to call a custom record form when t...
# suitescript
t
Is it possible to call a custom record form when trying to create new one on different record. For example, we have a button in Opportunity, then when the button is click it will redirect you to the custom record form
a
... so you want to create.. like a SO with a predefined customform set? or its a custom record? and I'm assuming you don't want the "preferred" form
t
A custom record. Yes don't want to use preferred
a
hmm, I don't think there's a simple way to do that... Could you have the button call a suitelet then use the suitelet response to load a new instance of the record with the form set? pass the form id as param on the button click, not sure it works, but seems like it would in theory
t
I see.. I was trying to search also N/url or N/redirect. But it seems they load an already created record 😅
a
right with a newly created doesn't seem there's a way to do that in the UI, obv very easy in the backend 🙂
thankyou 1
t
Currently what I am doing now is a suitelet that will save the record and then redirect you to the custom record using the custom form
Thanks Anthony, I am just wondering if that is possible actually. great talk!
a
the button saves the opportunity record? or it creates a custom record and saves it with the form set? and then redirects?
t
the 2nd one, it creates a custom record using some of the opportunity record details 🙂 then redirects (or remove this if it looks annoying hehe)
a
ok then it should be easy to modify what you have to load the record in the UI instead of saving and redirecting.. .most of the pieces are there already 🙂
again, idk if it'll work, but seems like it would
👍 1
t
yeah i think it will work too 🙂
a
👍 good luck, let us know how it turns out
b
you can use url.resolveTaskLink to generate the url, but expect to fill out a bunch of the query paramaters
t
Just quick update. I create a suitelet which is called whenever a button is click on a record. Suitelet gets the data from the opportunity record + other information need to be populated by a user then save it, I use the code below, to load the record recently created using SL.
redirect.toRecord({
*type*: 'customrecord_xxx,
*id*: id,
*isEditMode*: *false*,
*parameters*:{
*cf*: 1863 // custom form that is not preferred
}
});
thanks again for the help keanu thanks
👍 1