Symptoms
How to get the current URL as a value in SmartForms
Diagnoses
This was logged as a feature request, however there are workaround. See resolution.
Resolution
Workaround1
---------------
This workaround will give the form name, but not the full URL
1. Add a parameter to the View
2. On the form, add a rule that when the view initializes - On the input mappings set the View Parameter to tFormName] -> Detail -> Name found in the context browser
3. The View can then use this to determine on which form the user is currently working on.
Workaround2 (using JavaScript)
------------------------------------
1. Add a textbox to the view and give it a name, ex urlTextBox (this textbox can be marked as hidden)
2. Add a data label to the view
3. Set the data label's text to "GetUrl <script>$("$name=urlTextBox]").focus().text(document.URL).val(document.URL).blur()</script>
4. Make sure the Literal flag is selected on the data label - The label can be hidden too
Now you can use the textbox value in the view to determine what the URL is