Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Create New Field in EcoResProductCreate form

(0) ShareShare
ReportReport
Posted on by 450

HI all,


I am trying to add an intenger field ( named `carat`) in EcoResProductCreate form, but after saving a new product, there is no data in the Carat field, the form is not saving it.

What method should I use to save it .and where to put it .


Thanks 
B.R

*This post is locked for comments

  • Shaik146 Profile Picture
    Shaik146 936 on at
    RE: Create New Field in EcoResProductCreate form

    I had created a new control in that form. But I did not used the createdata2control method. In which table u want to pass the data from the created control! Can you please elaborate

  • RE: Create New Field in EcoResProductCreate form

    Did anyone add New Fields in the EcoResProductCreate form using CreateData2Control()?

  • Shaik146 Profile Picture
    Shaik146 936 on at
    RE: Create New Field in EcoResProductCreate form

    Hi MazZzDaI,

    i hav similar requirrement, need to add new stringcontrol , but slight difference is, i need to update ecoresproduct.displayproductnumber field from my new string control value when i click on ok button,and details form should be opened with my modified productnumber. where can i write code. please suggest

  • Suggested answer
    RE: Create New Field in EcoResProductCreate form

    The most straightforward and obvious way is to grab values from controls and put to EcoResProduct buffer. This scenario applicable when writeMoreFields method is not working, particularly for the EcoResProduct table. Of course there are available approach to subscribe on form control's events (modified) and put the data into .productData()

    [ExtensionOf(classStr(EcoResProductCrossTableManager))]

    final class DEMO_EcoResProductCrossTableManager_Extension

    {

       public static EcoResProduct makeProductRecord(EcoResIProductCrossTableData _productCreationData)

       {

           EcoResProduct retEcoResProduct = next makeProductRecord(_productCreationData);

           FormControlName customControlName = formControlStr(EcoResProductCreate, DEMO_CustomFieldControl);

           if (customControlName)

           {

               FormRun formRun = _productCreationData as FormRun;

               if (formRun)

               {

                   FormDesign formDesign = formRun.design();

                   if (formDesign)

                   {

                       FormControl formCustomControl = formDesign.controlName(customControlName);

                       if (formCustomControl)

                       {

                           retEcoResProduct.DEMO_CustomField = formCustomControl.valueStr();

                       }

                   }

               }

           }

           return retEcoResProduct;

       }

    }

  • RE: Create New Field in EcoResProductCreate form

    Hi All,  I am having the same kind of requirement to add new field on EcoResProductCreate form but data is not saving on inventtable field.  CreateData2Control() is private so not able to create event handler for the same.  Please suggest.

    Thanks

    Kavita

  • Burim Profile Picture
    Burim 450 on at
    RE: Create New Field in EcoResProductCreate form

    hi a-kow,

    The issue is resolved,

    I have another question regarding to EcoResCreate (Form) I want to add existing field (purchase Price ) from InventTableModule to represent in EcoResCreate form,

    What method should i use to achieve this, and where to put it

    Thanks for your time and considerations

    B.R

  • Verified answer
    axk Profile Picture
    axk 925 on at
    RE: Create New Field in EcoResProductCreate form

    As Vilmos said, it will be good to get through learning materials to understand how that's working.

    For now, take a look how it's done in createData2Controls() and add your field. I guess, you have added new field in InventTable so you must map it with form control providing table name (tableStr(InventTable)), field id fieldNum(InventTable, your field) and form control name (formControlStr(EcoResProductCreate, your control) - remember to set AutoDeclaration to Yes).

  • Vilmos Kintera Profile Picture
    Vilmos Kintera 46,149 on at
    RE: Create New Field in EcoResProductCreate form

    If you are new, please check the following site where you could find documentation, learning materials, and books which explain general concepts like the one you are expecting help with now.

    msdn.microsoft.com/.../default.aspx

    Providing step-by-step instruction every time is a bit too high expectation, generally here we provide high level guidance and pointing people in the right direction if they are stuck in order to resolve their problems.

  • Zain Bokhari Profile Picture
    Zain Bokhari 3,208 on at
    RE: Create New Field in EcoResProductCreate form

    Burim like suggested above, take a look at those methods. You will see that the values are being assigned to table object.

    add another line for mapping your value just  like the existing values are being assigned.

    Get the value from your field in the form and assign it to the new field you created in the table.

  • Burim Profile Picture
    Burim 450 on at
    RE: Create New Field in EcoResProductCreate form

    Hi a-kow,

    Thank you for your help,

    I am new in ne X++ , can you explain step by step,

    Br

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... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,409 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans