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)

Field is Dirty

(0) ShareShare
ReportReport
Posted on by

Hi Experts,

i have 2 fields,

1. ) Two option : Yes/No

2.) Lookup

Rule

- If two option value is No, set Lookup field a value. Else another value.

Problem

Existing record, there is a value for the lookup, user accidentally clock to No, another value is set to the lookup field, user set it back to Yes, set it back to original field, the field become dirty. Any ideas?

I am using JS.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Alex Fun Wei Jie Profile Picture
    33,628 on at

    Hi,

    I think you are using below JS to achieve the requirement. Am i right?

    [View:https://community.dynamics.com/crm/b/magnetismsolutionscrmblog/archive/2017/09/20/how-to-get-and-set-a-lookup-field-using-javascript-in-dynamics-365:750:50]

    The root cause would be you are missing many properties while setting the lookup field.

    I made some sample for you to compare.

    1538.Untitled3.png

    1538.Untitled3.png

  • Community Member Profile Picture
    on at

    Hi Wei,

    Yes, i am using that method. Any ideas how to solve it?

  • Verified answer
    Alex Fun Wei Jie Profile Picture
    33,628 on at

    Hi,

    There are few approaches, see which one is ok for you.

    1. Workflow

    - because it required user to save.

    - if immediate result is not required.

    2. JS

    - write a webapi to get the record and then set to the field using lookup object from the result you retrieved from webapi.

    - I havent try on this one, so i cant 100% confirm this is working.

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