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 AX (Archived)

New editable Drop Down box for Approved Vendors form

(0) ShareShare
ReportReport
Posted on by 55

Hello,

We have a requirement to add a new field(drop down) to approved vendors form. I was able to add a field to the table and form. But that field is always read-only. I checked AllowEdit property and Enabled property and everything looks correct. I noticed other 2 editable fields on this form use DataMethod, instead of data source. Could you please let me know how to make my new field editable of how to write a edit method and bind via Data method?

 

Regards,

Dumindu

 

 

*This post is locked for comments

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    301,146 Super User 2025 Season 2 on at

    Hi Dumindu,

    Can you tell the exact AOT name of this form? Would be easier to find. Is it a form or web form/control?

  • Dumindu Profile Picture
    55 on at

    Hi Andre,

    AOT name is PdsApprovedVendorList

    Regards,

    Dumindu

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    301,146 Super User 2025 Season 2 on at

    Hi Dumindu,

    Did you create a field on the Item or Vendor table? These datasources are set to be read only on the form (allowedit, allowcreate, allowdelete). Then also your new field is read only on this form. I assume, you can edit the contents in a table browser.

    To solve this, you can also make use of an edit method.

  • Dumindu Profile Picture
    55 on at

    Hi Andra,

    I added new field to the PdsApprovedVendorList table and I can edit it in table browser. Since I'm new to Dynamics, I couldn't make the edit method to save the data. I tried it then drop down got editable but it doesn't save data. I think I need to add a editHandlerXXXX method to PdsFormCtrl_PdsApprovedVendorList class. Could you please help me getting this done?

    Thanks,

    Dumindu

  • André Arnaud de Calavon Profile Picture
    301,146 Super User 2025 Season 2 on at

    Hi Dumindu,

    You can have a look at the information provided by Sukrut.

  • Dumindu Profile Picture
    55 on at

    Hi Sukrut,

    Thanks for the response. I tried the edit method but it doesn't save data. As per your sample I modified my method as below but there is no Update method in this form to save the data. IsAllowedInt method also missing there.

    Here is my method and please bare with me if there any silly mistakes as I'm new to AX. By the way my field name is AMS_3TGenum and type is also AMS_3TGenum(created a base Enum). Enum contains No=0,Yes=1 and Investigating=2.

    Appropriate your help in making this to work

    public edit AMS_3TGenum Edit3TG(boolean _set, AMS_3TGenum _value)

    {

       AMS_3TGenum ret;

       int actualValue;

       if (_set)

       {

           if(_value == AMS_3TGenum::Yes)

           {

               actualValue = 1;

           }

           ttsbegin;

           this.IsAllowedInt = actualValue;

           this.update();

           ttscommit;

       }

       else

       {

           if(this.IsAllowedInt)

           {

               ret = NoYes::Yes;

           }

       }

       return ret;

    }

  • André Arnaud de Calavon Profile Picture
    301,146 Super User 2025 Season 2 on at

    Hi Dumindu,

    If your field name is AMS_3TGenum, why are you updating the field IsAllowedInt?

    Can you explain a bit more? What is the field name in the table and what is your control on the form?

    There is no evaluation for the values 'No' or 'Investigating'. Note that there are functions to convert an enumeration to an integer and vice versa.

    Did you create this edit method on the form or on the table? The table would be the best place.

  • Dumindu Profile Picture
    55 on at

    Hi Andre,

    Again I apologize as I'm so new to AX coding. I Just tried to replace names in the method given by Sukrut.

    By the way I was trying this method on the form, not in the table. But i don't mind where we write it, as far as it works correctly. My table field name is AMS_3TGenum and form control's name is AMS_3TGcmb. Please let me know if you need any more details.

    Many thanks for all your help on this.

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 AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans