Hi How can I store the value of the field I am cre...
# suitescript
r
Hi How can I store the value of the field I am creating in beforeload of userevent on a record on create mode? I am adding field on beforeload on userevent it is getting vanished on every beforeload, it is not saviing to the record.
m
You can't store a value in field created in beforeload permanently to the records. The value will be isolated to the user currently accessing the record. The main reason you would create a field in beforeload would be to store or show a value you needed during the viewing or editing of the record. Examples: • Show calculated values that should be dynamically sourced every load. • Source a value that will later be used in a calculation. • Hold settings from script parameters to be used between client and user scripts. • Hold some sort of state, like state of validation.
r
Then how can set value on the record where I cannot fields?
m
Any body field you set with
Copy code
example_record.setValue({fieldId: '..field_id..', value: ..field_value.. });
n
Sounds like what you need is a "standard" custom field to hold the value of the dynamic field you're adding. On beforeLoad add your field. On beforeSubmit copy your field value to a regular field so it's stored on the record. @razer456
r
This is a good way, but the record is inventory count and I cannot add custom field. Other fields have their specified functionality
b
use a custom record to store the value instead
use a field on the custom record to store which inventory count it applies to