Forum Discussion
JoshuaTate
8 years agoQrew Cadet
Works perfectly, i use Chrome, also used it in IE as well. Only the below code is put into a URL Button, the rest comes from the AddWR.js.
"javascript:" &
"var F3= " & URLEncode([Record ID#]) & ";" &
"var F9= '" & [Number of Store Visits Required ? ] & "';" &
"var F72= '" & [Related Project] & "';" &
"var F77= '" & [Related Site] & "';" &
"var F98= '" & [Type of Scope] & "';" &
"var F84= '" & [Project - Related customer] & "';" &
"var F100= '" & [Date of Issue] & "';" &
"var F999= '" & "Installation" & "';" &
"var F21= '" & [Visit 1 Date] & "';" &
"var F22= '" & [Visit 1 Time] & "';" &
"var F23= '" & [Visit 1 Labour Qty] & "';" &
"var F25= '" & [Visit 2 Date] & "';" &
"var F26= '" & [Visit 2 Time] & "';" &
"var F27= '" & [Visit 2 Labour Qty] & "';" &
"var F29= '" & [Visit 3 Date] & "';" &
"var F30= '" & [Visit 3 Time] & "';" &
"var F31= '" & [Visit 3 Labour Qty] & "';" &
"var F33= '" & [Visit 4 Date] & "';" &
"var F34= '" & [Visit 4 Time] & "';" &
"var F35= '" & [Visit 4 Labour Qty] & "';" &
"var F37= '" & [Visit 5 Date] & "';" &
"var F38= '" & [Visit 5 Time] & "';" &
"var F39= '" & [Visit 5 Labour Qty] & "';" &
"var F41= '" & [Visit 6 Date] & "';" &
"var F42= '" & [Visit 6 Time] & "';" &
"var F43= '" & [Visit 6 Labour Qty] & "';" &
"var F45= '" & [Visit 7 Date] & "';" &
"var F46= '" & [Visit 7 Time] & "';" &
"var F47= '" & [Visit 7 Labour Qty] & "';" &
"var F49= '" & [Visit 8 Date] & "';" &
"var F50= '" & [Visit 8 Time] & "';" &
"var F51= '" & [Visit 8 Labour Qty] & "';" &
"var F53= '" & [Visit 9 Date] & "';" &
"var F54= '" & [Visit 9 Time] & "';" &
"var F55= '" & [Visit 9 Labour Qty] & "';" &
"var F57= '" & [Visit 10 Date] & "';" &
"var F58= '" & [Visit 10 Time] & "';" &
"var F59= '" & [Visit 10 Labour Qty] & "';" &
"$.getScript('" & URLRoot() & "db/[DBID]?act=dbpage&pagename=AddWR.js');void(0);"
_anomDiebolt_
8 years agoQrew Elite
That makes more sense.
Here is another mechanism I sometimes use to pass field values to script.
Here is a Rich Text field styled as a button: that places two fields [Record ID#] and [Name] into attributes of the <a> element:
Here is another mechanism I sometimes use to pass field values to script.
Here is a Rich Text field styled as a button: that places two fields [Record ID#] and [Name] into attributes of the <a> element:
[iol] & "module.js" & [/iol]The <a> portion of the generated field looks like this:
&
"<a class='QBU_Button Vibrant Success' " &
" data-rid='" & [Record ID#] & "'" &
" data-name='" & [Name] & "'" &
">Button</a>"
<aWithin the module.js file you can gain access to the field values like this:
class="QBU_Button Vibrant Success"
data-rid="1"
data-name="Jane Doe" >Button</a>
$("a.QBU_Button").on("click", function(event) {This allows you to style the button anyway you want and provides nice isolation between the formula and script.
var rid = this.dataset.rid;
var name = this.dataset.name;
console.log("rid=", rid);
console.log("name=", name);
});