locked
Accessing 3rd party javascript source RRS feed

  • Question

  • Can you do something like this in form javascript for CRM 2016 onpremise & online:

    <script type="text/javascript" src="https://www.test.com?parem=TEST_PARAM"></script> 

    I will then want values to be passed back from www.test.com and for those values to populate some fields on my form.

    Should scrip tags be in a html web resource?

    Thanks.

    Monday, July 31, 2017 3:49 PM

Answers

  • Hey!!

    the statement "<script type="text/javascript" src="https://www.test.com?parem=TEST_PARAM"></script>"will not return anything, but just load the script code of the url which you mention in "src" into your html - if that is a script file.

    In your case, "https://www.test.com?parem=TEST_PARAM" seems a web api, so using ajax or xmlhttprequest you can call that url with a parameter and get the result and finally populate fields of your form.

    • Marked as answer by MOTO1978 Thursday, August 17, 2017 9:39 AM
    Thursday, August 3, 2017 5:29 AM

All replies

  • Hey!!

    the statement "<script type="text/javascript" src="https://www.test.com?parem=TEST_PARAM"></script>"will not return anything, but just load the script code of the url which you mention in "src" into your html - if that is a script file.

    In your case, "https://www.test.com?parem=TEST_PARAM" seems a web api, so using ajax or xmlhttprequest you can call that url with a parameter and get the result and finally populate fields of your form.

    • Marked as answer by MOTO1978 Thursday, August 17, 2017 9:39 AM
    Thursday, August 3, 2017 5:29 AM
  • Thanks for your help
    Thursday, August 17, 2017 9:40 AM