Forum Discussion
AustinK
6 years agoQrew Commander
I always just put the info I need into the URL that goes to the code page. Then you can pluck it out of there using things like window.location and parsing the URL. Just add the information you need on to the end like ?rid=xxxx and then parse it on the page.
I'm not sure that is going to do it when using an iframe though. You might still be able to send that info along.
I'm not sure that is going to do it when using an iframe though. You might still be able to send that info along.
- donaldlundgren16 years agoQrew TraineeCan you please send an example of how to do this?
- AustinK6 years agoQrew CommanderInstead of doing "var url = this.dataset.url;" you should build it outside of that. It looks like you are just using a formula field so build the URL outside of your JavaScript and insert it where ${url} is now. You want the exact same url as you currently use except you add additional things tot he end and then parse them out when you reach the destination page.
You don't have to make it exactly like this, it can be done on one line. Just an example to kind of break it out further.
var text url = "myurl.com/db/whatever/a=e?blah";
var text urlTwo = "?rid="&[Record ID#];
var text urlThree = "?date="&[Date Field];
$url&$urlTwo&$urlThree
That creates "myurl.com/db/whatever/a=e?blah?rid=14976?date=01-01-2019"
When you load that URL you then use window.location and parse the URL for the things you need.
https://css-tricks.com/snippets/javascript/get-url-and-url-parts-in-javascript/