Is it possible? Can I save data from my field reco...
# suitescript
t
Is it possible? Can I save data from my field record without triggering the save button? I was thinking during field changed I can call a function that submits record. But I'm wondering if there is any ideas around.
n
If you run submit field on the same record, and then you make changes to the record it will not be saved and throw an error that record has been changed.
what's your use case?
t
well I'm trying to save the current selection of the user without them triggering the save button...
c
But why ?
t
let say you have 2 category that is under a drop downlist.. category A items has common item on Category B with some additional items on it. What the user wanted is. If suddenly the user change her mind and wanted to switch to Category B, the common items that has been selected on Category A will still remain selected when switched to Category B
n
So do this instead: When the category field changes, get the selected common items and store them in variable. When the category changes, use the variable and restore the common item selection.
t
how are you going to save that variable? I was thinking to force the user to save it if there's no other choice
n
create a global variable. It's a client script.
t
I see.. thank you guys for the brainstorming haha thumbs up
n
anytime batman 😄
😎 1
🤭 1