Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Finance forum / Modifying a dialog fie...
Finance forum
Unanswered

Modifying a dialog field value at run time

Posted on by 110
Hi.. this question has been answered before but I get a different error! In my form class I tried to override modified method of dfCustomerId but the second argument gives me error: The 'QuotationTable' argument of the 'methodStr' compile-time function does not specify a known class. I tried to put the name of form class instead and still getting the same error!
The dfCustomerId_modified is public and written under runDialog method directly
 
  • Abdullah_Ahmed Profile Picture
    Abdullah_Ahmed 110 on at
    Modifying a dialog field value at run time
    Thank you.. it simply worked!
    I faced the problem that I can't set the value of dfCustomerName so I created the static method and assigned the dfCustomerName from the form to my private dialogField.
     
     
     
    and this is the line code in the form class in runDialog method:
     
  • Martin Dráb Profile Picture
    Martin Dráb 228,683 Most Valuable Professional on at
    Modifying a dialog field value at run time
    1) You'll need to describe your problem before we can help you. Creating an instance of a class is the most basic step of object-oriented programming; I wonder what you may be struggling with there. Note that in F&O, you can't create a class embedded to a form; you need to add a class to your project.
    2) The third arguments provides the object of which the method (the second argument) will be executed.
  • Abdullah_Ahmed Profile Picture
    Abdullah_Ahmed 110 on at
    Modifying a dialog field value at run time
    Thanks for your response Mr. Martin... I'm a little bit confused about a couple of things:
    1- I created a class in the form class but I tried many times to create an instance but it always gives me error.. making the new class public doesn't help either.
    2- The third argument of registerOverrideMethod represents what? it should be overrideObject but which object will be overriden? the dialog instance?
     
     
     
  • Martin Dráb Profile Picture
    Martin Dráb 228,683 Most Valuable Professional on at
    Modifying a dialog field value at run time
    methodStr() checks if such a class and method exist and you indeed don't have the method in a class called QuotationTable. I also don't think that you can define the overriding method in a form data source. Instead, create a class for your method, create an instance in runDialog() and pass the instance as the third parameter of registerOverrideMethod().

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,570 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,683 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans