The requirement is to given a URL in the form based on the environment. Currently its hardcoded.
To avoid duplication I suggest you this article How to launch one form from another, with prepop
and this bit of code to test within a business rule in your form:
var url = sfc.getPhaseValue("DynamicDataServiceURL");
I hope that helps.
It helps, thanks a lot for the reply Julio.
Thanks a lot for reply to my question. Appreciate a lot.
In the TM, under the Form spaces I could see the space name and next to it its corresponding URLs.
cant we directly access those values in composer? That would be a easier way to give a link to user based on which environment he opens it up.
i could see only sfc.getDynamicData() function available now which would get some Dynamic Data.
any pointers or examples would be of great help.
Thanks in advance.
There are several ways to do it. I would generate it server side (DDS service to be called from your form or prefilled in your form...)
Another quicker way can be from a rule, checking your base url, the form's base url.
Remember, in any case you must avoid redirect to any other site from your form.