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)

Checking field value after clicking some ribbon button

(0) ShareShare
ReportReport
Posted on by 320

I had to check that some attribute isn't empty after the user click on ribbon button.

I've register the ribbon button event to something like:

if(Xrm.Page.getAttribute("new_test").getValue() != null)

{

alert("aaaaa");

1) User clicks the ribbon button when the attribute is empty

2) Get's alert

3) User insert text to the attribute and clicks again 

3) Get's alert

I've found that if the user isn't getting out (clicks out side) of the attribute's textbox the value remains the old value (in this case empty) but if he does It works.

 

After changing the code to the old (CRM 4) javascript syntact somethig like:

if(crmForm.all.new_test.DataValue != null)

{

alert("AAAA");

}

 

Everything worked great! Even if the user didn't get out of the textbox focus.

 

Is it a bug? is there a workaround?

Waiting for an answer.

*This post is locked for comments

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

    Try this: codingrandommusings.wordpress.com/.../crm-2015-get-your-field-values-without-losing-focus

    CRM creates a temporary HTML input element with the typed text that disappears when you lose focus on the field.

  • Community Member Profile Picture
    on at

    On which version of CRM you are working on ?

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