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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

lookup on runbase dialog based on another field value.

(0) ShareShare
ReportReport
Posted on by 240

Hi All,

My requirement is to display the corresponding lookup as follows which is similar to the lines on the create trade agreement form.

1. table--customer details lookup

2. group-- customer group lookup

2. all-- field is hidden

Refer screenshot below.

dropdown.JPG

Any suggestions how to achieve this and also can you tell where the lookup for that is written. I couldn't find the lookup on PriceDiscAdmTrans table.

*This post is locked for comments

I have the same question (0)
  • Martin Dráb Profile Picture
    239,244 Most Valuable Professional on at

    You attached a tag "RunBase", but I would recommend using SysOperation framework in AX 2012. You'll implement a custom UI builder, register an override of the lookup() method and implent the logic you need.

    There is no lookup() method in the form you're looking at; it's done by conditional relations on the table.

  • venkates Profile Picture
    240 on at

    Hi Martin,

    I've created my contract class with the required parameters.

    On proceeding further I see that a service class is also created. Is this mandatory or we can skip this service class.

    If we can skip, then what changes need to be done on the menuitem which will be mapped to the controller class.

  • Martin Dráb Profile Picture
    239,244 Most Valuable Professional on at

    I'm sorry, but I don't know what you mean by "a service class is also created". Please elaborate what you've implemented and why.

  • venkates Profile Picture
    240 on at

    Please refer link below.

    [View:https://community.dynamics.com/ax/b/faisalfareedaxlibrary/archive/2016/03/26/ax-2012-sysoperation-framework-implementation-example:750:50]

    I used this and have created parameters as follows. Which method should I modify to create lookup on selection based on the code selected.

    CONTRACT-_2D00_-Copy.JPG

  • Martin Dráb Profile Picture
    239,244 Most Valuable Professional on at

    The "service class" is the place for your business logic. I assume you want to do something with values from your dialog, don't you? Therefore the answer to your question whether you can skip it is "no".

    The dialog is constructed by a UI builder class, so that's where your lookup logic belongs.

  • venkates Profile Picture
    240 on at

    Hi Martin,

    I need to do similar lookup as below. I need to display customer number and name on the lookup.

    LOCAL_5F00_LOOKUP.JPG

    When i tried to create the lookup using code, I came to know that SysTableLookup can show lookup from only one table.

    Can I create a view and add the "Custtable" and "DirPartyTable" to the view then add the view as datasource to the lookup code. If I do so will the view get updated if some items are deleted or added.

  • Verified answer
    Martin Dráb Profile Picture
    239,244 Most Valuable Professional on at

    Views are backed by select statements to database, therefore if a record is added or deleted, the view will automatically reflect it.

    But it's not necessary in this case. It's just a field and a display method from a single datasource, so there is no problem. Display methods can be added through SysTableLookup.addLookupMethod().

  • venkates Profile Picture
    240 on at

    Yes I've added the field through display method.

    Next when i try to get the enum value from the dialog, I get the value as 0,1,2... Is there a way to get the enum name. I need to use this enum in condition checking.

  • Martin Dráb Profile Picture
    239,244 Most Valuable Professional on at

    The generic function can't return your specific enum type, but it doesn't matter at all. Enums are basically just named integer values, therefore you can easily compare them with integers or assign an integer to a variable of an enum type. Like this:

    TableGroupAll value = functionReturningInt();
  • venkates Profile Picture
    240 on at

    Hi Martin,

    CONTRACT.JPG

    I'm trying to modify the percent dialogfield. I've written a method that gets called when the percent field is modified.

    In the overridden method I'm able get the modified value but after that the percent field's value again gets changed to 0.00.

    It's not reflecting the modified value. Can you tell me what could I be doing wrong..

    I've tried the below code to set the value for the percent field in the overridden method but of no use. It's value remains 0.00.

    localPercent = percent.value();(I get the modified value here)

    percent.value(localPercent);

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 26

#2
imran ul haq Profile Picture

imran ul haq 8

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 4 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans