web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to send data from html web resource to crm form using javascript in crm 2015

(0) ShareShare
ReportReport
Posted on by 262

Hi,

I have a html web resource that the user can select checkboxes. I put the checked values to an array. I want to send this array from this html web resource to crm form using javascript. How can ı do this. Can anyone help me please?

*This post is locked for comments

I have the same question (0)
  • balakrishna uppala Profile Picture
    570 on at

    Hi,

    Whatever logic you wanted to perform on CRM using this checkbox results, the same you can do from javascript on html.

    other approach:

    You can create some field on the CRM form, you can update that field from html webresource with this array using java script parent.Xrm.page.getAttribute.setValue()  or using REST update.

  • altun8tr Profile Picture
    262 on at

    I tried this:   parent.Xrm.page.getAttribute("new_multiline").setValue(favorite) ;

    when ı control it on browser it gives me the error:

    TypeError: Cannot read property 'getAttribute' of undefined

    /Boydak/%7B636118802740000053%7D/WebResources/new_chk3?Data=564b50ac-3d47-e511-80c3-0050569f563c:71

    What can i do in this situation. Is the library missing or what?

  • Suggested answer
    TNS Profile Picture
    1,197 on at

    Hi check out this article...might it will be helpful:

    msdn.microsoft.com/.../gg327945.aspx

  • altun8tr Profile Picture
    262 on at

    Hi, I checked this page before, but it wouldn't help me. I want to pass parameter from html web resource to crm form.

  • am462 Profile Picture
    110 on at

    I think you are missing window at front, try

    window.parent.Xrm.Page.getAttribute("new_multiline").setValue(favorite);

  • altun8tr Profile Picture
    262 on at

    I tried lots of things. The error turns out to be :TypeError: Cannot read property 'setValue' of null.

    favorite is an array and new_multiline is a text are.

    I tried this code to write to a text field and insert one value not an array. The erro was same.

    For example ı wrote :

    var t="test";

    window.parent.Xrm.Page.getAttribute("new_testtext").setValue(t);

    does not work.

    Is there another way to pass value from html web resource to form field? Can you help me please?

  • Inogic Profile Picture
    703 on at

    Hi,

    We have also stumbled across such scenario once.

    After long hours of RnD, at the end, we updated the record through rest instead of using the XRM.Page method.

    HTH!

    Thanks,
    Sam

  • TNS Profile Picture
    1,197 on at

    Hi,

        if I am not wrong then you are sending the information from html web resource to your javscript web resource which will set the data in the crm form, If this is your scenario then...you can try it like .....

    pass   your data to js and then from the js connect with your entity and then you can set the attribute value ...

  • altun8tr Profile Picture
    262 on at

    Hi,

    I tried this and worked for a single value but not for an array and ı want to set an array to text field:

    var t="test";

    window.parent.opener.Xrm.Page.getAttribute("new_testmultiline").setValue(t) ;

    How can I send the array and set it to multiline text?

  • balakrishna uppala Profile Picture
    570 on at

    Hi,

    You can either concatenate into a string and set on multiline text. like in HTML take arra[0], array[1]...etc and you can concatenate using comma or some special char. After that from CRM field you should need to split the string.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans