Forum Discussion
_anomDiebolt_
7 years agoQrew Elite
Here is an demo. There are two tables Records and Ipsums. The table Ipsums contains 59 records of hilarious Lorem Ipsum themed text. For the demo you can think of these records in Ipssums as fragments of a document you may want to include into the [Document] field you are editing in the table Records. To test enter a [keyword] such as "QuickBase", "Ipsum" or a word of your choice and press the button. The [Document] field will be populated with the [Sample] field in each Ipsums record that matching your keyword.
Clone Ipsum ~ Add New Record
https://haversineconsulting.quickbase.com/db/bnsfbfx9a?a=nwr
Pastie Database
https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=663
Notes:
(1) The logic for matching Ipsums records actually are those records containing the keyword along with always including three records for "QuickBase Ipsum", "Product Manager Ipsum" and "Script Ipsum". Consider the inclusion of these three records as boilerplate.
(2) Obviously I just dreamed up this example out of thin air. Whatever your requirements are I am sure the script can be easily modified to suit your needs.
Clone Ipsum ~ Add New Record
https://haversineconsulting.quickbase.com/db/bnsfbfx9a?a=nwr
Pastie Database
https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=663
Notes:
(1) The logic for matching Ipsums records actually are those records containing the keyword along with always including three records for "QuickBase Ipsum", "Product Manager Ipsum" and "Script Ipsum". Consider the inclusion of these three records as boilerplate.
(2) Obviously I just dreamed up this example out of thin air. Whatever your requirements are I am sure the script can be easily modified to suit your needs.
- CarlosCarlos7 years agoQrew Assistant CaptainDan, For some reason I cannot get the script to run.. might there be something missing?
- _anomDiebolt_7 years agoQrew EliteMy demo works. You are not providing any information to debug what you are doing wrong.
- CarlosCarlos7 years agoQrew Assistant CaptainIndeed. Here's what I have so far. I've edited it multiple times trying to get it to work, but no luck yet.
Thanks!
Button:[iol] & "consultareserva.js" & [/iol]
&
"<a class='QBU_Button Vibrant Success' " &
" data-rid='" & [Record ID#] & "'" &
">Search and Fill [Document]</a>"
js file:(//https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=663 function(){
$("img[qbu=module]").remove();
$("a.QBU_Button").css({"margin-top": 10});
$("a.QBU_Button").parent("td").css({"border-top": 0});
var dbid = "ddwugpby3";
var dbidRecords = "ddt2xatw4";
var dbidIpsums = "ddwugpp65";
var apptoken = "apptokengoeshere";
$.ajaxSetup({data: {apptoken: apptoken}});
$("a.QBU_Button").on("click", function(event) {
var rid = this.dataset.rid;
var keyword = _fid_34.value;
$.get(dbidIpsums, {
act: "API_DoQuery",
query: '{586.CT.${keyword}',
clist: "586.10",
fmt: "structured"
}).then(function(xml) {
$("record", xml).each(function() {
_fid_25.value += $("f[id=586]", this).text();
})
});
});
})();