Skip to main content

Notifications

Announcements

No record found.

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

add new custom column/field (ProdTable.QtyStUp) to the JobRegistration Grid from the JmgRegistrationGridSetup

Posted on by 529

Hello,

Task very straight fordward:

I need to show the Started Quantity (ProdTable.QtyStUp) in the JobGrid at the Job Registration form and be added/Removed from the Setup of Grids form (JmgRegistrationGridSetup)

Reason: due to our small stock(inventory) space we are not allow to store to much inventory. All that is produced is to be delivered. We set a production for 1 pc but we produce 2 pcs just in case 1 pc goes wrong. if the need 100 pcs, then we produce 120 (start qty/QtyStUp) and we end up RAF the planned/estimated qty 100. That make sure that the 20 raw materials get used in the Total Production Cost. But the inventory would be 100 pcs. 20 pcs addicition will be only physical scrap. So the worker needs to know how many should be produced and this is not in the standard AX from where I can see.

pastedimage1585730713097v1.png

What is the correct/best way to add new custom column.??

I have already created a Display method in the JmgJobTable to get the QtyStUp from the ProdTable. I thought I could maybe force a StringEdit to the JobGrid in the JobRegistrationForm but no success. This grid is generated by X  

/// 
/// Gets the started Quantity (ProdTable.QtyStUp) name of the production related to the current job.
/// 
/// 
/// The QtyStUp quantity of the job.
/// 
// BP Deviation Documented
public display ProdQtyStUp QtyStUp()
{
    return ProdTable::find(this.ModuleRefId).QtyStUp;
}

I've been looking the \Classes\JmgRegistrationForm.registerAllGridFields(FormGridControl _fgc) that maybe can give me some clue but I dont know excaly how it works

pastedimage1585732170234v3.png

  • Suggested answer
    CBNestor Profile Picture
    CBNestor 529 on at
    RE: add new custom column/field (ProdTable.QtyStUp) to the JobRegistration Grid from the JmgRegistrationGridSetup

    Hi Nikolaos,

    Well that was actually pretty straight forward.

    1. add new element to JmgFieldName enum: NC_QtyStUp

    2. edit Method Classes\JmgRegistrationForm\registerAllGridFields with new case for NC_QtyStUp

    for (i = 1; i <= _fgc.controlCount(); i  )
        {
            currentControl = _fgc.controlNum(i);
            switch(currentControl.name())
            {
                /*
                    ->NestorC 01/04/2020
                */
                case formControlStr(JmgRegistration,NC_QtyStUp) :
                    this.registerGridField(JmgFieldName::NC_QtyStUp,currentControl);
                    break;
                /*
                    <-NestorC 01/04/2020
                */
                case formControlStr(JmgRegistration,jobMarked) :
                    this.registerGridField(JmgFieldName::Select,currentControl);
                    break;
     

    3. add the NC_QtyStUp as a Column in the Configure Registration form Terminal configuration (compile jobregistration and save and PLAY [:   )

    pastedimage1585741637594v1.png

    Thanks a lot for your kindly help!

  • CBNestor Profile Picture
    CBNestor 529 on at
    RE: add new custom column/field (ProdTable.QtyStUp) to the JobRegistration Grid from the JmgRegistrationGridSetup

    Hi Nikolaos,

    I am grateful for your fast response.

    looks interesting I'll try to do that.

  • Verified answer
    nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: add new custom column/field (ProdTable.QtyStUp) to the JobRegistration Grid from the JmgRegistrationGridSetup

    The FieldName lookup is not dynamic, it comes from JmgFieldName enum.

    So you need to add new value to that enum, and add handling to the new value.

    You can use cross references (right click - Add-ins - Cross-references - Used by) in the enum values to see how they are handled in code.

    At least following places need to be adjusted by you:

    Classes\JmgRegistrationForm\registerAllGridFields

    Tables\JmgRegistrationSetup\createDefaultSetup

  • WillWU Profile Picture
    WillWU 22,350 on at
    RE: add new custom column/field (ProdTable.QtyStUp) to the JobRegistration Grid from the JmgRegistrationGridSetup

    Hi CBNest,

    See the DOC:

    https://docs.microsoft.com/en-us/dynamicsax-2012/developer/walkthrough-creating-a-form-based-on-a-composite-query

    This link creates a form based on a query,is this what you need?

    Hope this helps.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans