I’d like to create an ephemeral set of fields that...
# suitescript
j
I’d like to create an ephemeral set of fields that appears or disappears on a Custom Record form when a user takes certain actions (makes a selection from a dropdown and clicks link). I’d like these fields to look and behave like regular NS fields. I don’t want these fields to exist at all on the Custom Record itself, not should they exist on page load (even hidden --- they should ONLY come into existence when the triggering JS is called). They just show up when requested, are used for some calculations, then go away when the user clicks something else. I’ve tried adding a “container” that is an iFrame or a div, and creating a Suitelet to render the fields, and then using jQuery to do a callback to the Suitelet and embed the resulting data into the div. However, then the rest of the main page breaks (CSS issues....) I think because the embedded HTML is a full page rather than just a chunk of fields. Is there anyway to generate the HTML for just a set of NS custom fields WITHOUT all the surrounding HTML <body> tags and whatnot?
watching following 1
I’m literally thinking I might need to add an InlineHTML field at the start of my fields_i_want called STARTHERE and one at the end called ENDHERE and using those to chop off everything before/after.
desperation sets in
if only portlets were actually useful outside of dashboards
d
I'm invested in this rabbit hole, keen to see where it goes 😄
j
Use Case (for those who might be interested): we have a custom record with >1200 fields. I need to add clumps more fields for various products, to run various calculations. Instead of adding more and more, I’ll put these into singleton child records on the custom record. However, I want the user to be able to interact with the child record fields in the “main form”. I actually go this working with a popup window but was asked to see if I could make it just kinda appear in the same window in a particular area.
too many fields for a sublist to be user friendly
plus I want to layout the fields how I want.
I can use ephemeral fields as the “work area” then when user is ready they “submit” or “go”' or whatever and I use JS to close that area and move the values into the sublist child record.
b
pick your favorite popup library( like sweetalert2)
iframes for suitelets are a risky choice when select fields are involved, they have specific functionality relating to the parent window
opening a new window to a suitelet is much safer than an iframe
j
they don’t want a popup tho
sigh
I got it working with popup, and sending data back to main window
did it like the “set options” popup in item lines
b
if you dont want a separate window/tab, then you choose a popup box
which is what something like sweetalert2 is
j
ah
nah, we still want it in the page itself rather than popping at all
like a hide/show of fields
except….the fields are NOT on the record actually
and also I don’t want to add them via userevent…. cuz really there will be potentially thousands
😮 1
and only a few to be added at a time.
e
1200 fields sadblob
d
what about a handful of reusable fields added in UE BL? Then reusing them by toggling visibility, position, renaming? 🫳💡🧱
and would this be better suited to/easier to do in a dedicated suitelet page, instead of the custom record itself?
j
Existing custom record is already heavily in use for over a decade
👍 1
and the reusable fields …. they will all be so different each time
it’s basically rating models for different types of products we sell
some quite complex
good times
d
apart from your ephemeral fields idea, I think the only thing I can add is the number of a good therapist
j
HAH
you going to SW, @David B? You can help me wipe away my tears then.
d
no... and my company is moving to SAP in Q3... 😥
🤔 1
j
wahhhh
e
Use div tags. Inject them into the page and then use your client script to display and hide them...
Or use a slider bar that displays based on an event and then goes away when the user clicks anywhere on the page
s
this is where we'd probably use a custom webapp - complete freedom of expression for the UI - none of these suitelet limitations.
s
Why not create "custpage_" fields in beforeload context to do custom actions/fields? They can still be client-script interactive, and beforeLoad UE means you can add stuff (like dropdown options) without worrying about permissions.