Forum Discussion
_anomDiebolt_
7 years agoQrew Elite
Try this using a single Rich Text Formula Field named [Button]:
if [Product] = 'sproket' open form with dfid=10
if [Product] = 'widget' open form with dfid=11
if [Product] = 'thingamajig' open form with dfid=12
Note that this formula uses the 3Q&S Technique and employs three different quote characters:
(1) double quotes are used to delimit the formula text
(2) single quotes are used to delimit the <a> elements attributes
(3) back tick quotes are used as the quote character within the JavaScript.
I did not test this but I think it is correct as is.
"<a class='QBU_Button Vibrant Success'" &
" data-rid='" & [Record ID#] & "'" &
" data-product='" & [Product] & "'" &
" onerror='
(async () => { let dbidTable = 'your table dbid';
let rid = this.dataset.rid;You will need to adjust the map to conform to your product's and dfid's. My mappings act like this:
let product = this.dataset.product;
let map = {
'sproket': '10',
'widget', '11',
'thingamajig', '12'
}; let dfid = map[product];
let url = '${dbidTable}?a=er&rid=${rid}&dfid=${dfid}';
document.location.href = url;
window.open(url);
})();
'>Button</a>"
if [Product] = 'sproket' open form with dfid=10
if [Product] = 'widget' open form with dfid=11
if [Product] = 'thingamajig' open form with dfid=12
Note that this formula uses the 3Q&S Technique and employs three different quote characters:
(1) double quotes are used to delimit the formula text
(2) single quotes are used to delimit the <a> elements attributes
(3) back tick quotes are used as the quote character within the JavaScript.
I did not test this but I think it is correct as is.