Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

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

(0) ShareShare
ReportReport
Posted on by 510

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
    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
    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:

    }

    }

  • Michal Krejza Profile Picture
    on at
    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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

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

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,207 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,923 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans