Going to be as thorough as possible here, just need to know if this is even possible..
I have a component that is bound to tables, what I am attempting to achieve is loading data from a record in the tables but then saving this data into the tables with a new primary key ID (which I am getting using some xbasic in the onDialogInitialize event). I obviously ran into a problem using the "populate controls for bound UX" as the text box that holds the primary key gets overwritten from the one in the tables. I then thought a genius idea might be to use the "populate controls of an unbound UX" just to get the values, but the issue is I need to go get a lot of values from multiple tables (which are all linked nicely together on the higher primary key). When I attempted this I immediately hit a road block as I knew I'd need to use the query method but when I try to actually bind the controls it pops up an alert saying "no table was selected", which seems strange has I had built the query...?
So, first I'm not sure if using the unbound javascript action will even work as I need to populate data in repeating sections, is this possible?
If not I am thinking about using the populate bound ux action and I will save the primary key I generate into a window variable so I can easily just replace the populated id, but I believe when I go to save this table I am going to need to do a check if data was loaded in as I believe the dialog will try to update the old entry into the table but just put in the new ID where I actually need it to do an insert statement so I was thinking if I checked for if data had been loaded (easy enough with a logical text box, set the value to one on the load data button click) then I could divert the usual save method to using the javascript action save method, but not sure all this work is necessary if I can populate repeating sections with the unbound method?
Thanks for the help!
I have a component that is bound to tables, what I am attempting to achieve is loading data from a record in the tables but then saving this data into the tables with a new primary key ID (which I am getting using some xbasic in the onDialogInitialize event). I obviously ran into a problem using the "populate controls for bound UX" as the text box that holds the primary key gets overwritten from the one in the tables. I then thought a genius idea might be to use the "populate controls of an unbound UX" just to get the values, but the issue is I need to go get a lot of values from multiple tables (which are all linked nicely together on the higher primary key). When I attempted this I immediately hit a road block as I knew I'd need to use the query method but when I try to actually bind the controls it pops up an alert saying "no table was selected", which seems strange has I had built the query...?
So, first I'm not sure if using the unbound javascript action will even work as I need to populate data in repeating sections, is this possible?
If not I am thinking about using the populate bound ux action and I will save the primary key I generate into a window variable so I can easily just replace the populated id, but I believe when I go to save this table I am going to need to do a check if data was loaded in as I believe the dialog will try to update the old entry into the table but just put in the new ID where I actually need it to do an insert statement so I was thinking if I checked for if data had been loaded (easy enough with a logical text box, set the value to one on the load data button click) then I could divert the usual save method to using the javascript action save method, but not sure all this work is necessary if I can populate repeating sections with the unbound method?
Thanks for the help!
Comment