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

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Grid not refreshing based on new selected value on form

(0) ShareShare
ReportReport
Posted on by 125

First pic       3632.s1.PNG

second pic       0574.s2.PNG

last pic 5417.s3.PNG

Hi experts,my second lookup is getting value based on default enum mango when forms opens,but when i change this enum,it is not updating and showing old values. When i uncomment RetailStoreTable_ds.ExecuteQuery()  on selection change of first,an error comes up on form opening like registeroverridemethod was called twice for the same object for method 'text change'.Someone guide me how to update second filter based on first value?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Mea_ Profile Picture
    60,284 on at
    RE: Grid not refreshing based on new selected value on form

    Hi Faran Baig,

    SysLookupMultiSelectCtrl register override method in the constructWithQuery method, so it should be called only once. Remove call from executeQuery method and move it to init(). Here is a blog with example how to use it on a form dynamicsaxgyan.wordpress.com/.../syslookupmultiselectctrl-in-dynamics-ax-6-0-ax-2012-x

  • Faran Baig Profile Picture
    125 on at
    RE: Grid not refreshing based on new selected value on form

    Hi ievgen Miroshnikov,

    In the Link,it is done with static query and used query string,i did not achieved b this way,is any way to achieve it by constructwithQuery and query written in execute query,not a static query ?

  • Mea_ Profile Picture
    60,284 on at
    RE: Grid not refreshing based on new selected value on form

    Why do you need executeQuery at all? This method executes query of a form datasource and has nothing to do with your custom query. You can create your query in init() and pass it yo multilookup once. If not please explain why. 

  • Suggested answer
    Hossein.K Profile Picture
    6,648 on at
    RE: Grid not refreshing based on new selected value on form

    Hi Faran,

    After execute query, you need to reread and refresh data in data source.

    formDataSource.reread();
    formDataSource.refresh(); 



  • Faran Baig Profile Picture
    125 on at
    RE: Grid not refreshing based on new selected value on form

    Hi ievgen,

    Because i need to set range at run time,if i change enum value in category lookup,then second lookup should filter values according to new selected value at categroy lookup.

    As i said,currently it takes default value of category lookup which is "Mango" when form opens and show values according to "Mango"  even when i change category lookup value later.

  • Faran Baig Profile Picture
    125 on at
    RE: Grid not refreshing based on new selected value on form

    Hi ievgen,

    I dont know how to refresh my range values at run time on category lookup value change and clear the first by default range value.

  • Faran Baig Profile Picture
    125 on at
    RE: Grid not refreshing based on new selected value on form

    Hi

    i write this code on from init method

    3808.a2.PNG

    and this code on modified of control 

    3808.a2.PNG

    but on running form,i am facing error below

    4064.a3.PNG

    Can you please tell me how to resolve this?

  • Mea_ Profile Picture
    60,284 on at
    RE: Grid not refreshing based on new selected value on form

    Did you create query before passing it to queryRun in init method?

  • Faran Baig Profile Picture
    125 on at
    RE: Grid not refreshing based on new selected value on form

    0537.a2.PNG

    I created query on modified method of first lookup

  • Mea_ Profile Picture
    60,284 on at
    RE: Grid not refreshing based on new selected value on form

    init happens before modified, so its null on init that's why you get this error.

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Community Member Profile Picture

Community Member 4

#2
Nayyar Siddiqi Profile Picture

Nayyar Siddiqi 2

#2
NNaumenko Profile Picture

NNaumenko 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans