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)

SetValue of textbox in Dynamic Field using HTML web resource,but getting null in setValue.

(0) ShareShare
ReportReport
Posted on by 492

2016_2D00_07_2D00_07-at-14_2D00_55_2D00_28.png

Java Script 

function SetData(schema_name, id) {
debugger;
var id_ = document.getElementById(id).value;
window.parent.Xrm.Page.getAttribute(schema_name).setValue(id_);
}

<td><input type="text" id="h_r_cxr1_es_id" onchange="SetData('qsc_c_r_cxr1_es_id','h_r_cxr1_es_id')"></td>

Please suggest how to read textbox value in dynamics?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    Hi,

    Read the value in the same way you are setting it like :

    var value = window.parent.Xrm.Page.getAttribute(schema_name).getValue();

    schema_name replace with your attribute name

  • AbhiCode Profile Picture
    492 on at

    Hi Mohit,

    Error is comes when I am Pass the HTML TextBox value into CRM Field,

    Set value in dynamics.

  • Suggested answer
    Community Member Profile Picture
    on at

    i think you are getting null in this window.parent.Xrm.Page.getAttribute(schema_name)

    Can you please try window.top.parent.Xrm.Page.getAttribute(schema_name) or window.parent.top.Xrm.Page.getAttribute(schema_name)

  • AbhiCode Profile Picture
    492 on at

    Still same in both case

    function SetData(schema_name, id) {

               debugger;

               var id_ = document.getElementById(id).value;                        

            window.parent.top.Xrm.Page.getAttribute("qsc_c_r_cxr1_es_id").setValue("dfz");

           }

  • Suggested answer
    Community Member Profile Picture
    on at

    Try this:

    parent.Xrm.Page.getAttribute(FIELD)

    Same but without window

  • AbhiCode Profile Picture
    492 on at

    Uriy...same error

  • Suggested answer
    Community Member Profile Picture
    on at

    Also try below :

    window.parent.Xrm.Page.data.entity.attributes.get(FIELD).setValue(Value);

  • Verified answer
    Community Member Profile Picture
    on at

    Check settings of iframe in your form, make sure that you disabled security option about iframe and scripts (not sure how it called in English). If it already disabled try to enable and disable it again and publish changes.

  • AbhiCode Profile Picture
    492 on at

    Thank you Uriy

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