I have a select field (selectField1) and two other select fields (selectField2 and selectField3) that are automatically populated based on ‘selectField1’. How do I keep these values on an update? All of the select fields are defaulting back to defaults on update which is ‘Please select value…’ for ‘selectField1’ and nothing for selectField2 and selectField3. Been fighting this for a day and a half now.
onbeforeupdate
{field1} = “xxx”;
{field2} = “{fieldx} place text”;
committrans();
if those fields are linked to a database, SC will lookup the current value.
If not you have to use the method rotrax described. Use a sc_lookup to get those values and link them to the fields on the form.
I’ve tried both ways and evidently I’m doing something wrong because I still can’t get it working. Here is what I have now.
[ATTACH=JSON]{“data-align”:“none”,“data-size”:“custom”,“height”:“217”,“width”:“702”,“data-attachmentid”:89003}[/ATTACH]
And here’s the select value not retaining it’s value. The ‘group’ will autoselect based on the ‘file category’.
[ATTACH=JSON]{“data-align”:“none”,“data-size”:“custom”,“height”:“114”,“title”:“screenshot_.PNG”,“width”:“688”,“data-attachmentid”:89004}[/ATTACH]
Hi, show me the sql you have in these two fields or take a screenshot if the options are manually inserted.
[ATTACH=JSON]{“data-align”:“none”,“data-size”:“full”,“title”:“Screenshot_7.jpg”,“data-attachmentid”:89210}[/ATTACH]
Why are you using the custom field category_category? In your event onbeforeupdate you are copying this value to the dbfield file_category. So just use file_category and the value will be saved to the db and recalled when you open the form.