Forum Discussion
MichaelTamoush
4 years agoQrew Captain
Thanks Jim, this is great! A couple of questions:
1. Where is the [StyleAdd] variable you mentioned? I am not seeing it?
2. If you use DataRefresh=True without also SaveBeforeNavigating, will it lose any changes?
3. Do you have a code page that automatically closes the popup window?
------------------------------
Mike Tamoush
------------------------------
1. Where is the [StyleAdd] variable you mentioned? I am not seeing it?
2. If you use DataRefresh=True without also SaveBeforeNavigating, will it lose any changes?
3. Do you have a code page that automatically closes the popup window?
------------------------------
Mike Tamoush
------------------------------
- JimHarrison4 years agoQrew Champion1. Where is the [StyleAdd] variable you mentioned? I am not seeing it?
Look up Quickbase Variables in the Quickbase documentation.
2. If you use DataRefresh=True without also SaveBeforeNavigating, will it lose any changes?
Good question, I didn't test. Curious to know the results of your testing.
3. Do you have a code page that automatically closes the popup window?
No, we use a JavaScript alert() with an "All Done" message which then does a window.close; when "Ok" is clicked.
------------------------------
Jim Harrison
transparency = knowledge + understanding : The Scrum Dudes
------------------------------- MichaelTamoush4 years agoQrew CaptainWould you be willing to share your JavaScript Alert 'All Done' code page? Not sure if it's something proprietary you keep for your company or not.
------------------------------
Mike Tamoush
------------------------------- JimHarrison4 years agoQrew ChampionHi Mike,
I did not write it so I don't think that would be fair use. I will tell you the general idea.
The button sends an API to the code page with parameters. Parameters is worth looking into...check mdn.
The javascript window.location() parses the parameters out of the originating URL into variables declared in the code page.
Then an API Query is sent to the template table that searches for records based upon one of the parameters (related template). API_DoQuery
The XML response is turned into a csv using a for loop in the code page.
The related parent parameter is placed into the clist.
Once the csv loop is all done it sends another API_ImportFromCSV to the desired child table.
We have just added child records from a template table to a related parent.
Additional tools are F12 to access the browser console.
console.log() to step through the code and determine why its not working.
Hope that helps.
Jim
------------------------------
Jim Harrison
transparency = knowledge + understanding : The Scrum Dudes
------------------------------