Close a pop up form after a button is clicked on the form
I have a button that sits on a report that is on a user page that creates pop up to a special form that also has a button that that acts on a checkbox and then refreshes the page. Here is my formula that sits on the pop up form: var text Update = URLRoot() &"db/" & Dbid() & "?act=API_EditRecord"& "&rid=" & [Record ID#] & "&_fid_1046=1"; var text RefreshPage = URLRoot() & "db/" & Dbid() & "?a=doredirect&z=" & Rurl(); If([Ready for Dispositions]=false,$Update & "&rdr=" & URLEncode($RefreshPage)) What do I need to add to my formula to close the pop up after the button is clicked? ------------------------------ George Bramhall ------------------------------36Views0likes16CommentsSave and Keep Working behavior in a Custom button
The native behavior of Save & Keep Working will save Both the edit made to embedded child records and whatever changes made in the form to the parent record. The code below Does Not do that. I found the below at: Alternatives to common JavaScript Insertion techniques var text rid = If([Record ID#]>0, ToText([Record ID#]), "%%rid%%"); var text url = URLRoot() & "db/" & Dbid() & "?a=er&rid=" & $rid; "<a class=\"Vibrant Primary SaveBeforeNavigating\"data-replaceRid=\"true\"href=\"" & $url & "\">Save & Keep Working - Rich Text</a>" My endeavor is to have a Custom Button behave the same way as the Native "Save & Keep Working" button. Save both parent and child record edits, redisplay in edit mode. Why a custom button? you may ask. Because the other options "Save & Close" and "Save & Next" I do not want to be available to the end user. Any assistance is appreciated. Thank you, CGreene ------------------------------ Christopher Greene ------------------------------24Views0likes8CommentsURL Formula Button w/ Two API Calls
I am working with 3 tables: Parent Table: Work Orders--> Intermediary (Child) Table: Subcontractor Quotes--> Child Table: Status History. I have an embedded report on my Work Order form which displays the Subcontractor Quotes. I have a Formula-URL button displayed on the report called [Subcontractor Dispatched]. When the button is clicked, I need two things to happen: I need to create a record in the Status History Table. I've successfully accomplished this with the following formula: var bool show = If(Contains([Quote Status], "Approved by PM"),true,false); If($show=true, URLRoot() & "db/" & [_DBID_STATUS_HISTORY] & "?a=API_AddRecord&_fid_16=" & URLEncode ([Record ID#])& "&_fid_10=Subcontractor Dispatched" & "&_fid_11=Subcontractor Quote Status" & "&_fid_9=" & URLEncode(User()) & "&apptoken=xxxxxxxxxxxxx" & "&rdr=" &URLEncode ( URLRoot() & "db/" & Dbid() &"?a=doredirect&z=" & Rurl()),"") I need to update the related parent Work Order record by checking a checkbox field. However, I have two problems: A.) I can't seem to figure out how to denote which record to update in my formula. I've tried using the formula below but it returns an error stating >No such record< and >Missing "rid" parameter< (I assume it must be because the field [Related Work Order] actually exists in the Subcontractor Quotes table, not the Work Orders table): URLRoot() & "db/" & [_DBID_WORK_ORDERS] & "?a=API_EditRecord&_rid=" & URLEncode([Related Work Order]) & "&_fid_155=true" & "&apptoken=xxxxxxxxxxx" & "&rdr=" &URLEncode ( URLRoot() & "db/" & Dbid() &"?a=doredirect&z=" & Rurl()) B.) Once I get the API_EditRecord formula correct, I'm not really sure how to structure my formula with the two API calls together and make it work. Any help, advice, or resources would be much appreciated! ------------------------------ Thanks, Aleisha ------------------------------Solved23Views0likes2CommentsButton to edit existing record and create / copy all information to new record
I currently am using an "Approve" button that is functioning to change one field in an existing record, however, I would love for that one button to not only edit the existing record but also create a new record with mostly the same information as the existing record minus a few fields one of which will need to be changed as the button is pressed and the others can be left blank if they vary from the existing form. When using the API_AddRecord is there a way to tell that record to pull field information off the current record and populate it on the new record? Current button code: URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&rid=" & [Record ID#] & "&_fid_26=Approved" & "&rdr="&URLEncode(URLRoot() & "db/" & Dbid() & "?a=doredirect&z=" & Rurl()) Currently stuck on new button code: URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&rid=" & [Record ID#] & "&_fid_26=Approved" & "&rdr=" & URLEncode(URLEncode( URLRoot() & "db/"& Dbid() & "?a=API_AddRecord" (Fields here) "&rdr="&URLEncode(URLRoot() & "db/" & Dbid() & "?a=doredirect&z=" & Rurl()) Thank you in advanced for any assistance or help! ------------------------------ Peter Krasznekewicz ------------------------------19Views0likes3CommentsConfirm button to show pop up message box
I am unable to figure this out. I was able to create the button itself, but not sure what code is needed to open a pop up message box. Here is what I have so far: "<a style=\"background: #4285f4; border-radius: 5px; padding: 8px 20px; color: white; display: inline-block; font: normal 700 24px; text-decoration: none;\">Confirm</a>" I need the button to also open a pop up box to display a message before the user actually saves the record. The button does not need to actually save the record, just display a message and have an 'OK' box to click. All I can find is Javascript and I know that can't be used anymore. ------------------------------ Amy Gosz ------------------------------19Views0likes10CommentsAdd a button to open a specific form?
I have a table that everyone has access to. Lets call it "Products". For the purposes of this discussion, every role has the same access. I want to be able to add products through two separate buttons on the home page. The first is already there. It takes us to our current add form. We want to keep this. The second, is not. Right now we have it set up on the current add form through dynamic form rules, but you have to answer about 3 different drop downs before you get to it and it is confusing to users. What I want is to have a second button, that when clicked, takes you to a different form I have created to add these specific products. It would be the same for every role. Is this possible, without setting form rules with the roles? Every role would need access to both. ------------------------------ mtn mtn ------------------------------15Views0likes3CommentsAPI Edit Record, Mailto, and a rdr or nexturl?
Hi everyone, I am trying to create a button via rich text field that will process an API call to update a record, open an email via a mailto, and redirect back to the record page I was on in one click. I understand there is no way to confirm the email was sent, but opening in the browser will be okay by me. Here is the code I have, which shows a white blank page after running. How do I continue the rdr back to the url? You can see I commented out code as it was not working: var text baseurl = URLRoot() & "db/"& Dbid(); var text purchTbl = $baseurl & [_DBID_PURCHASE_ORDERS]; var text editRecord = "?a=API_EditRecord&apptoken=" & [EliteApptoken] & "&rid=" & [Record ID#]; var text LABEL = "Executive Approval"; var text decoration = "text-decoration: none;"; var text bgColor = "background: #0044cc;"; var text txtColor = "color: white;"; var text txtAlign = "text-align: center;"; var text txtShadow = "text-shadow: none;"; var text border = "border-radius: 5px;"; var text padding = "padding: 8px 20px;"; var text display = "display: inline-block;"; var text font = "font: normal 700 24px/1 'Calibri', sans-serif;"; var text styleOptns = List("", $decoration, $bgColor, $txtColor, $txtAlign, $txtShadow, $border, $padding, $display, $font); var text mailto = "mailto:" & [Manufacturer - PO Submission Email] & "?subject=Purchase Order&body=Please review the attached Purchase Order and confirm receipt."; If([Old PO], "", If(IsNull([Executive Review On]) and IsNull([Project Review On]), "<span style= 'font-family:Calibri;color:#57a3f0;font-size:14px'><Strong>Requires Executive Approval</Strong><br /></span>", "<div><a style='" & $styleOptns & "' class='Vibrant' href='" & $baseURL & $editRecord & "&_fid_40=" & Today() & "&rdr=" & URLEncode($mailto) & //URLEncode("&rdr=" & //URLEncode(URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & [Record ID#]) & "'>Submit PO</a></div>"))//) ------------------------------ Ivan Weiss ------------------------------14Views0likes8CommentsRedirecting back to the current form after executing a formula url button
Hello, I have a few buttons that at the end redirect the user after execution the action to the "default" form for the table. How do I change this so the redirect goes to the current form the user is on? The button is on multiple forms and I want to redirect them back where they came from. Thanks! ------------------------------ Ivan Weiss ------------------------------14Views0likes6CommentsFormula-URL button with API_AddRecord, then API_EditRecord (need to edit the record just added)
I am working with two tables: Parent Table: Work Orders Child Table: Status History I have a formula-URL button that is supposed to do multiple things: Add a record in the Status History table: [Type]=Work Order Status, [Status]=Closed, [Status Changed By]=Current User If [QC/QA Status] Contains "QC/QA Fail", then Add a record in the Status History table: [Type]=QC/QA Status, [Status]=Revision Complete - QC/QA Needs Review, [Status Changed By]=Current User Open Code Page 9, Prompt User for Comments, then Edit the record added in step 2 by populating [QC/QA: Work Order Review/Revision Comments] with User Prompted Input. Everything works perfectly, except the User Prompted Input doesn't populate the [QC/QA: Work Order Review/Revision Comments] field on my Status History record (created in Step 2). I've tried including a formula query (as a variable) and referencing it in my formula to use as the Record ID from the record added in Step 2 above but it didn't work. Then I tried using another formula field [Max QC/QA RID for Comments], which I created on the Work Order form to run the query and I referenced it in my formula to use as the RID but it didn't work. I guess the API-EditRecord isn't working which I can only speculate it's related to the Record ID? Does anyone know if there is a better way to do this? Here is a link to the code page I used: Code Pages - PromptAndRefresh.html (quickbase.com) Here is my formula below: var bool show = If(Contains([W/O Status],"Received") or Contains([W/O Status],"Created") or Contains([W/O Status],"Dispatched")or Contains([W/O Status],"Pending Review") or Contains([W/O Status],"Pending Revision"),true,false); var bool QCQAFail= If(Contains([QC/QA Status],"QC/QA Fail"),true,false); var text WOStatus= URLRoot() & "db/" & [_DBID_STATUS_HISTORY] & "?a=API_AddRecord&_fid_6=" & URLEncode ([Record ID#]) & "&_fid_10=Closed" & "&_fid_11=Work Order Status" & "&_fid_9=" & URLEncode(User()) & "&apptoken=xxxxxxxxx"; var text QCQAStatus= URLRoot() & "db/" & [_DBID_STATUS_HISTORY] & "?a=API_AddRecord&_fid_6=" & URLEncode ([Record ID#]) & "&_fid_10=Revision Complete - QC/QA Needs Review" & "&_fid_11=QC/QA Status" & "&_fid_9=" & URLEncode(User()) & "&apptoken=xxxxxxxxx"; //var Text qcqaID = ToText(GetFieldValues(GetRecords("{10.EX.'Revision Complete - QC/QA //Needs Review'} AND {6.EX."&[Record ID#]&"}",[_DBID_STATUS_HISTORY]),3)); //var text MAXID= //ToText(Max(ToNumber(Part($qcqaID,1,";")), //ToNumber(Part($qcqaID,2,";")), //ToNumber(Part($qcqaID,3,";")), //ToNumber(Part($qcqaID,4,";")), //ToNumber(Part($qcqaID,5,";")), //ToNumber(Part($qcqaID,6,";")), //ToNumber(Part($qcqaID,7,";")))); //var Number MAXID= //Max(ToNumber(Part($qcqaID,1,";")), //ToNumber(Part($qcqaID,2,";")), //ToNumber(Part($qcqaID,3,";")), //ToNumber(Part($qcqaID,4,";")), //ToNumber(Part($qcqaID,5,";")), //ToNumber(Part($qcqaID,6,";")), //ToNumber(Part($qcqaID,7,";"))); var text urlToExecute = URLRoot() & "db/" & [_DBID_STATUS_HISTORY] & "?a=API_EditRecord&apptoken=" & "&apptoken=xxxxxxxxx" & "&rid=" & [Max QC/QA RID for Comments] & "&_fid_28="; // Field to Populate with the user prompted input var text Page= URLRoot() & "db/" & AppID() & "?a=dbpage&pageid=9" // Open code page 9 & "&url=" & URLEncode($urlToExecute); // Pass in the URL to execute var text RefreshPage = URLRoot() & "db/" & Dbid() & "?a=doredirect&z=" & Rurl(); var text DoBoth= $WOStatus & "&rdr=" & URLEncode($QCQAStatus) & URLEncode("&rdr=" & URLEncode($Page)) & URLEncode("&rdr=" & URLEncode("&rdr=" & URLEncode($RefreshPage))); var text DoOne= $WOStatus & "&rdr=" & URLEncode($RefreshPage); If($show=true and $QCQAFail=true, $DoBoth, $show=true, $DoOne,"") Any help or advise would be much appreciated! Thanks, ------------------------------ Aleisha Aldrich ------------------------------14Views0likes0CommentsPossible to download a report as a csv (or xls) with a button push?
I have a button that allows a user to open a report, and then if they want save as spreadsheet. Is there any way the button can download the report as a spreadsheet automatically? ie, skip the go the the report stage? Essentially, I want my users to be able to download a template, but this template isnt static. It may change periodically based on data in the system, so I can't simply upload a template file. Also, I want the user to get the template on demand, so I can't set it up as a subscription. Ideas? ------------------------------ Mike Tamoush ------------------------------14Views1like4Comments