web
You’re offline. This is a read only version of the page.
close
Skip to main content
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

I have the same question (0)
  • Vilmos Kintera Profile Picture
    46,149 on at
    RE: AX 2012 R3 Create New Field in EcoResProductCreate form

    Did you check the caller object of the form in Right click > Personalization > Information tab, or what classes are used by the form itself (most likely instantiated in the init() method of the form)? That should get you closer to finding the answer.

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

    Hey Burim,

    Check createData2Controls() and writeMoreFields() methods on EcoResProductCreate form. If you add control to the form, you should map it with table field in the first method, that should help.


  • Burim Profile Picture
    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

  • Zain Bokhari Profile Picture
    3,208 Moderator 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.

  • Vilmos Kintera Profile Picture
    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.

  • Verified answer
    axk Profile Picture
    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).

  • Burim Profile Picture
    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

  • Community Member Profile Picture
    on at
    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

  • Suggested answer
    Community Member Profile Picture
    on at
    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;

       }

    }

  • TestBot Profile Picture
    950 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

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
Priya_K Profile Picture

Priya_K 4

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 3

#3
Scott_itD Profile Picture

Scott_itD 2 Community Manager

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans