Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Answered

Want to execute a method if a field is blank previously but now entered with a new value.

Posted on by 502

Hi all,

Want to execute a method if a field is blank previously but now entered with a new value.

And that new value is used in that method.

How can i do this and on which method of the table i should write the code to do this.

Thanks and regards

Siddhant Singh

  • Verified answer
    Mea_ Profile Picture
    Mea_ 60,278 on at
    RE: Want to execute a method if a field is blank previously but now entered with a new value.

    Hi Siddhant Singh,

    As mentioned here you need to override modifiedField  field on the table level and add your logic there, if you want to check that field was blank before you can this.orig() nuxulu.com/.../Understanding_modifedField_Table_method_in_DAX_2012.html

  • Mahmoud82 Profile Picture
    Mahmoud82 50 on at
    RE: Want to execute a method if a field is blank previously but now entered with a new value.

    I hope I understood you correctly 

    you can use the modifiedField method to do this

    • you can use switch case or if statment to check which field exactly changed 
    • make sure that the super method is before the new code to get the new value of the modified field 

    public void modifiedField(fieldId _fieldId)

    {

    super(_fieldId);

    switch(_fieldId)

    {

    case fieldnum(MyTable, custAccount):

        this.CurrencyCode="";

        break;

    default:

    }

    }

  • RE: Want to execute a method if a field is blank previously but now entered with a new value.

    Hi Siddhant,

    In which area do you need to prepare such a solution ?

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans