Forum Discussion
GeorgeBramhall2
Qrew Cadet
Not sure if I was clear. I want the button on the form to update the record (check a checkbox) and then close the form (pop-up)
------------------------------
George Bramhall
------------------------------
------------------------------
George Bramhall
------------------------------
MarkShnier__You
3 years agoQrew Legend
I think that this would require a code page. But I'm not that kind of a coder.
------------------------------
Mark Shnier (YQC)
mark.shnier@gmail.com
------------------------------
------------------------------
Mark Shnier (YQC)
mark.shnier@gmail.com
------------------------------
- MikeTamoush3 years agoQrew CommanderIf you go to this link:
https://resources.quickbase.com/db/bq8kmgrcq
Then click on the examples. The second example is titled : Add Child in Popup w/ Auto Close on Save - Rich Text
It gives you a code page, and then a NextURL statement to call that code page. Admittedly, I haven't tried it, but I told myself I need to experiment with that as soon as I have the need again!
To me, this solution only will work in instances where &NextURL will work. I know NextURL works in conjuction with the add record api, but not sure about edit record?
------------------------------
Mike Tamoush
------------------------------- GeorgeBramhall23 years agoQrew CadetOk I built the close window page per the site you shared.
but
I get this error
<qdbapi><action>API_EditRecord</action><errcode>0</errcode><errtext>No error</errtext><rid>7484</rid><num_fields_changed>1</num_fields_changed><update_id>1645809864144</update_id></qdbapi>
...when I click the rich text button with this code:
var text Update = URLRoot() &"db/" & Dbid() & "?act=API_EditRecord"& "&rid=" & [Record ID#]
& "&_fid_1046=1";
var text RefreshPage = "&NextURL=" & URLEncode(URLRoot() & "db/" & AppID() & "?a=dbpage&pageid=21&z=");
"<a class='Vibrant Danger OpenAspopup' href='" & If([Ready for Dispositions]=false,$Update
& $RefreshPage)& "' data-height=500 data-width=500 data-refresh=true title='Clicking this button will open a popup'>Confirm EM/DD Removal</a>"
and pop doesn't close.
Any ideas?
------------------------------
George Bramhall
------------------------------- MikeTamoush3 years agoQrew Commander
Technically as it says there is 'no error' which likely just means the redirect (close pop up) is not working. My guess is you have pageid 21 in your code. That is the page id from the sample code.
Be sure that matches what your actual code page id is. Hopefully that will fix it. Like I said, I haven't actually tested this myself so I can't confirm it even works, but it looks promising. Let me know if fixing the code page works!
Oh, also I dont think you need the &z= at the end. The sample shows it ending after the 21 (or your code page number)
------------------------------
Mike Tamoush
------------------------------
- GeorgeBramhall23 years agoQrew CadetCoincidentally my page is also #21.
...got rid of the &z= ... but alas, same error.
------------------------------
George Bramhall
------------------------------- MikeTamoush3 years agoQrew CommanderHmm. Ill try to test sometime. The only other thing I can think of is, maybe NextURL doesnt work with the Edit Record API?
Perhaps try NextURL with a simple redirect to anywhere (the record?) just to test if the next URL redirect is working.
------------------------------
Mike Tamoush
------------------------------
- GeorgeBramhall23 years agoQrew CadetThis code does it all in one shot (creates pop, checks box and then closes the window). However I want to have the user manually check the box on the pop up form (giving the user a moment to think about what they are about to do) and then save the record and have the pop up close.
var text url = URLRoot() &"db/" & Dbid() & "?act=API_EditRecord"& "&rid=" & [Record ID#]
& "&_fid_1046=1"&
"&rdr=" & URLEncode(URLRoot() & "db/" & AppID() & "?a=dbpage&pageid=21") ; // Open code page 21 to close the popup
// data-height/width dictate the size of the popup
// data-refresh refreshes the source page once the popup is closed
// title provides the tooltip
If([Ready for Dispositions]=false,"<a class='Vibrant Danger OpenAsPopup' href='" & $url & "' data-height=500 data-width=500 data-refresh=true title='Clicking this button will open a popup'>Remove</a>")
------------------------------
George Bramhall
------------------------------- MarkShnier__You3 years agoQrew LegendTry this for us :)
var text url = URLRoot() &"db/" & Dbid() & "?a=er"& "&rid=" & [Record ID#]
& "&_fid_1046=1"&
"&NextURL=" & URLEncode(URLRoot() & "db/" & AppID() & "?a=dbpage&pageid=21") ; // Open code page 21 to close the popup
------------------------------
Mark Shnier (YQC)
mark.shnier@gmail.com
------------------------------