web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

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

HowTo Add Column [CategoryName] field to a Lookup field [CostCategoryId] AX2012

(0) ShareShare
ReportReport
Posted on by 46

Hello,

I have a custom Form with two Foreign keys ProdRoute.OprId and RouteCostCategory.CostCategoryId which I am linking toghether in the custom table as well. I just want to modify the standard lookup field for the EDT RouteCostCategoryId to add the Description of that cost category which is in the Share Categories table (SharedCategory.CategoryName)

Even better make a copy of the EDT and then modify it so it can show the CategoryName

pastedimage1591362594148v1.png

Thanks a lot!

I have the same question (0)
  • Verified answer
    Sergei Minozhenko Profile Picture
    23,093 on at

    Hi CBNestor,

    I think the easiest solution (if you don't need to filter or sort by this field in lookup) is to add new display method on RouteCostCategory to return category name and added to AutoLookup field group on RouteCostCategory table as well.

    Otherwise, you will need to implement custom lookup using sysTableLookup class (check InventLocation.lookup* methods and how they used)

  • Verified answer
    Blue Wang Profile Picture
    on at

    HI CBNestor,

    As mentioned, the display method should suit your needs.

    You need to check how the lookup of the Category field is implemented, only add another field. please check this thread for the logical method.

    community.dynamics.com/.../348223

  • CBNestor Profile Picture
    46 on at

    Hi Blue,

    This is what I would like to know where is that implemented orginally where can I find the code.

  • CBNestor Profile Picture
    46 on at

    Hi Sergei,

    I have the display on RouteCostCategory. I dont see any fields in the RouteCostCategory AutoLookup fGroup. how to add that. thank you

    Display CategoryName GetCategoryName()

    {

       SharedCategory _sc;

       select CategoryName from _sc

       where _sc.CategoryId == this.CostCategoryId;

       return _sc.CategoryName;

       //return _sc.find(this.CostCategoryId).CategoryName;

    }

  • Verified answer
    Sergei Minozhenko Profile Picture
    23,093 on at

    Hi CBNestor,

    Just drop needed fields to the group (from fields node) and display method from methods node.

  • Suggested answer
    Jay Barot Profile Picture
    1,502 on at

    Hi CBNestor,

    if you don't need to filter anything on this field then I suggest to use display method.  Else you need to develop custom lookup  as suggested by sergei.

  • CBNestor Profile Picture
    46 on at

    No the CostGroupId is gone. Thats why I wanted to make some kind of copy of the lookup, customize it and the use it in my custom form. I dont want to change the whole Lookup in whole system

    pastedimage1591602986551v2.png

  • Verified answer
    Sergei Minozhenko Profile Picture
    23,093 on at

    Hi CBNester,

    You need to add fields CostCategoryId and CostGroupId to the field group as well.

  • CBNestor Profile Picture
    46 on at

    Hi Sergei,

    I know what you mean, Yes now I am change the Standar lookup field. I can show the all 3 fields now. But if I want to leave the standard lookup as it is. I make one on my own. So I can show the 3 fields just when and where I want to. Is it possible to make some kind of a copy and customize from that copy?

  • Sergei Minozhenko Profile Picture
    23,093 on at

    Hi CBNestor,

    Yes, in this case you need to use sysTableLookup class and lookup method on form datasource field. Check InventLocation.lookupBySiteId method and how it's used.

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

News and Announcements

Season of Giving Solutions is Here!

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 836 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 441 Super User 2025 Season 2

#3
Martin Dráb Profile Picture

Martin Dráb 346 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans