I am trying to populate an unbound fields in a repeating section in a dialog2 when I open the dialog from a grid in order to edit the existing record. Overall, the dialog works fine except in a repeating section where I want to display the factory name in an unbound field.
My objective is to fill in the factory fields using an sql lookup from the factory number. I can obtain the factory name from the factory number, as proved by the debugger. I would like to build a dynamic string and then use that string in the e.javascript to populate the factory name fields in the repeating section.
I started by creating a hard-coded javascript string (even though I can build it dynamically):
e.javascript = "{dialog.object}.setValue('FACTORY_NAME:1','Widget Works');{dialog.object}.setValue('FACTORY_NAME:2','Thingamajig Industries');"
This works fine in working and live preview modes, but will not work in the browser, either in a pop-up window or when opened on a separate pane.
I tried putting the javascript on a button an clicking on the button after the window opens, and the fields are populated, so I know that my javascript is ok.
I have also tried using the server side e.control.vendor_name_a5instance1 = "Widget Works", which works if I hard code the row numbers, but I need to have this work dynamically, and cannot get the row numbers to increment as I roll through the values in the result set from the SQL table.
If worse comes to worse, I can add the factory name fields (in addition to the factory number fields which are already there) to the table in the repeating section, but that violates the rules of database normalization.
I am using build 2549-3903 (tried newest build, but it throws an A5 script error - array out of bounds, even when I comment out all server-side events and Xbasic functions, so I went back)
Any thoughts?
Thanks,
Jay
My objective is to fill in the factory fields using an sql lookup from the factory number. I can obtain the factory name from the factory number, as proved by the debugger. I would like to build a dynamic string and then use that string in the e.javascript to populate the factory name fields in the repeating section.
I started by creating a hard-coded javascript string (even though I can build it dynamically):
e.javascript = "{dialog.object}.setValue('FACTORY_NAME:1','Widget Works');{dialog.object}.setValue('FACTORY_NAME:2','Thingamajig Industries');"
This works fine in working and live preview modes, but will not work in the browser, either in a pop-up window or when opened on a separate pane.
I tried putting the javascript on a button an clicking on the button after the window opens, and the fields are populated, so I know that my javascript is ok.
I have also tried using the server side e.control.vendor_name_a5instance1 = "Widget Works", which works if I hard code the row numbers, but I need to have this work dynamically, and cannot get the row numbers to increment as I roll through the values in the result set from the SQL table.
If worse comes to worse, I can add the factory name fields (in addition to the factory number fields which are already there) to the table in the repeating section, but that violates the rules of database normalization.
I am using build 2549-3903 (tried newest build, but it throws an A5 script error - array out of bounds, even when I comment out all server-side events and Xbasic functions, so I went back)
Any thoughts?
Thanks,
Jay
Comment