Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Answered

How to Edit Job Identification (jobId) lookUp field in the JmgCalcApprove Form AX2012R3

(0) ShareShare
ReportReport
Posted on by 44

Hi all,

I have a small -hope so- customization to make in the Calculate/approve form trans grid.

The JobId field/column has a lookup field that probably get filter depending on the JmgStampJournalTrans.JobRefype.

pastedimage1624343052119v1.png

I want to modify the LookUp field on the JobId to add two more columns (when jobRefType is of type Process:

1.The ProdRoute.OprId (shouldn't be that complicated)

2. the CostCategoryId ( which has a custom table references that links a subset of Shared CostCategoriesId with a specific OprId)

the Idea:  instead of selecting the Job Id, the costCategoryId. This because instead of stamp in a secuencial id (jobId) the worker have a predefined list of static codes (CostCategoriesId).

The issue: I don't know where to find the LoopUp method for the JobId :/ . where is that exactly built?

pastedimage1624343755088v2.pngpastedimage1624343804854v3.png

As always your Help is greatly appreciated 

thanks a lot beforehand.

  • Suggested answer
    CBNestor Profile Picture
    CBNestor 44 on at
    RE: How to Edit Job Identification (jobId) lookUp field in the JmgCalcApprove Form AX2012R3

    1. I used the LostFocus() on the forms grid field. that does the job for now. ( by Now I want this to work on this form only).

    I will use the write/insert when everything is tested. thanks for the info!

    2. Directly from the table field property. haha you have a way to explain sometimes that got me thinking

    Thanks for help!!

    I will close this thread as solved.

    thanks for your time Man!

  • Suggested answer
    ergun sahin Profile Picture
    ergun sahin 8,812 Super User 2024 Season 1 on at
    RE: How to Edit Job Identification (jobId) lookUp field in the JmgCalcApprove Form AX2012R3

    1. The methods you will use change according to the work you want to do.

    You can use the Write method, but if you want it to work the same way in more than one form, you can turn to table methods. Or if you want your code to work in the operations on the table, you can write directly to the insert/update methods.

    2. Use field name at table ; filedNum(Table,CostCategory)

  • CBNestor Profile Picture
    CBNestor 44 on at
    RE: How to Edit Job Identification (jobId) lookUp field in the JmgCalcApprove Form AX2012R3

    Hi Ergün,

    you were right I was so focus on the JmgJobLookup that I did not catch that line element.selectMode(); thanks very much!

    now is selecting properly :). I am almost there to finish!

    1. I have override the Modified() method on my custom grid Field to write the related JobId from Code (this works but..). The problem is that is only working when is "modified". how can I do to change it every time the User inserts in the custom field the first time and/or modifies it?

    pastedimage1625477019166v1.png

    2. How can I do to  make the custom field to be Editable after is inserted to the table. I see that once is written on the table I cannot change it. but the rest of the fields are easily changeable, for example: the JobId.

    pastedimage1625477359534v2.png

    3. The alternate Row color did not Show because the Datasource AllowEdit/Create/Delete were Set to Yes. I change it to No and no it looks good (Fixed)

  • Verified answer
    ergun sahin Profile Picture
    ergun sahin 8,812 Super User 2024 Season 1 on at
    RE: How to Edit Job Identification (jobId) lookUp field in the JmgCalcApprove Form AX2012R3

    In fact, if you follow the link I shared exactly, you will reach the result more easily.
    However, I think you made a mistake on one of two points.

    stoneridgesoftware.com/.../

    public void init()
    {
        super();
     
        // Returns selected value from form control
        element.selectMode(Dinosaurs_DinosaurName);
    }

    Or

    public void lookup()
    {
        // Overrides a lookup method to utilize the default lookup form
        FormRun lookup;
        Args args = new Args(formStr(DefaultLookup));
        
        args.parm("");
        args.caller(this);
        lookup = classFactory.formRunClass(args);
        lookup.init();
        this.performFormLookup(lookup);
    }

    I don't quite understand the color issue. It will be clearer if you post a picture. However, its a lookup don't expect it to open like a form.

  • CBNestor Profile Picture
    CBNestor 44 on at
    RE: How to Edit Job Identification (jobId) lookUp field in the JmgCalcApprove Form AX2012R3

    Hi Ergün,

    Thanks for replaying.

    I am trying to implement the same logic as per JmgJobLookup form. I managed to get callers' record from the Approval form and I managed to filter the custom lookup when process+prodid is selected. Now I have some issues.

    1. when I select any value from the lookup, it does not write anything to the line field of the grid, the lookup just closes and nothing happens. Do I have to override any method for that?

    2. about the Color rows, I mean that this lookup form's grid opens completely in white. there is no <blue/white/blue> background alternating row color on the grid.

  • Suggested answer
    ergun sahin Profile Picture
    ergun sahin 8,812 Super User 2024 Season 1 on at
    RE: How to Edit Job Identification (jobId) lookUp field in the JmgCalcApprove Form AX2012R3

    I did not fully understand. You are writing a custom lookup (not a form) and you want to show fields from more than one table(?).

    You can use SysMultiTableLoookup for this, but remember, it's not a standard class. I shared the link below

    kashperuk.blogspot.com/.../sysmultitableloookup-dynamic-lookups.html

  • CBNestor Profile Picture
    CBNestor 44 on at
    RE: How to Edit Job Identification (jobId) lookUp field in the JmgCalcApprove Form AX2012R3

    so I think the answer is no :(.

    Since I almost guessed that. I started making the custom. There is something annoying that I don't get it.

    why The color rows are not shown?

    pastedimage1625049756685v1.pngpastedimage1625050173499v2.png

  • Verified answer
    ergun sahin Profile Picture
    ergun sahin 8,812 Super User 2024 Season 1 on at
    RE: How to Edit Job Identification (jobId) lookUp field in the JmgCalcApprove Form AX2012R3

    You can create a custom lookup form and add it to EDT (like JmgJobIdLookup)

    stoneridgesoftware.com/.../

  • CBNestor Profile Picture
    CBNestor 44 on at
    RE: How to Edit Job Identification (jobId) lookUp field in the JmgCalcApprove Form AX2012R3

    Hi Ergün,

    Perfect! you are a genius! did not know they were so many kinds of lookups (: .

    I have been researching further and debugging the JmgJobIdLookUp form on how it gets auto filtered depending on the selected record (quite interesting by the way).

    So my Idea -not sure if the best- is actually modifying my costCategory lookup to also get filtered depending on the related ProdId (reference Column) and at the same time after the costCategory is selected by user, the JobIdentification (jobId lookup) will be automatically assigned (this last thing I am not sure how to do it).

    Here my first doubt: since my lookup comes from the table' AutoLoopup field group. Is it possible to create a method to filter that  AutolookUp?. Or I have to create separate form Lookup and then filter it using the dataSource.

    I want this lookup to work accross the system with low maintenance. Overriding methods on each form a don't think is a good idea.

    pastedimage1625034684817v1.png

    as always greatly appreciated

  • Verified answer
    ergun sahin Profile Picture
    ergun sahin 8,812 Super User 2024 Season 1 on at
    RE: How to Edit Job Identification (jobId) lookUp field in the JmgCalcApprove Form AX2012R3

    If you can't see lookup on the form, you have to look at the table first. Then to the relevant EDT. Two points on EDT are important.

    First one has table relation in old edts

    pastedimage1624354616177v1.png

    in cases where the EDT is linked with the table, you should look at the following values of the relevant table

    pastedimage1624356993379v2.png

    Secondly, you need to look at the following property on the EDT

    pastedimage1624357145015v3.png

    There are more complex lookups but in general this info will do

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,735 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,466 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans