Skip to main content

Notifications

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

Invent journal create form modified method ovveride

(0) ShareShare
ReportReport
Posted on by

pastedimage1683283108281v1.png

on Invent journal create form when name of move journal is changed description changes accordingly to name. here 

pastedimage1683283243448v2.png

here i have customized this site fields , now it should also be changed according to movement journal name as description is changing above.

  • Mohit Rampal Profile Picture
    Mohit Rampal 12,552 Super User 2024 Season 1 on at
    RE: Invent journal create form modified method ovveride

    Have you debugged the code? Put breakpoint on 'add' method in 'Info' class and check call stack to find from where error is thrown. Also, please share the code you have written on initValue method in table extension class.

  • RE: Invent journal create form modified method ovveride

    used this code but still referrnce object error is coming !!

  • GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    RE: Invent journal create form modified method ovveride

    You have added same code as that of modified field. No need to mention the field num in the initvalue method. 

    Only modified field will have field id which is used to identify which field is modified in the form.

    public void initValue()
    {
        next initvalue();
        if (this.JournalNameId)
        {
            InventJournalName journalName = InventJournalName::find(this.JournalNameId);
            this.InventSiteId = journalName.OABSiteId;
        }
    }
    
    

    Thanks,

    Girish S.

  • RE: Invent journal create form modified method ovveride

    pastedimage1683294970644v1.png

    void initValue()
    {
    case fieldNum(InventJournalTable, JournalNameId):
    if (this.JournalNameId)
    {
    InventJournalName journalName = InventJournalName::find(this.JournalNameId);
    this.InventSiteId = journalName.OABSiteId;
    }
    next initvalue();
    }

    this comes written  this code

  • Suggested answer
    GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    RE: Invent journal create form modified method ovveride

    I think you need to create Name right then only the description and site will be autopopulated right?

    How the name field will be defaulted while opening the form?

    If you still need it, you need to add the code at table level initValue method.

    Add the same logic you had written in the modifiedField at table level.

    Thanks,

    Girish S.

  • Suggested answer
    Mohit Rampal Profile Picture
    Mohit Rampal 12,552 Super User 2024 Season 1 on at
    RE: Invent journal create form modified method ovveride

    Write same code in initValue method of table. When creating new record if Name field value is defaulted then initValue method will work. 

  • RE: Invent journal create form modified method ovveride

    when i am opening then form pastedimage1683294108914v1.png site is coming blank it should also be filled as per journal name , how this can be done ?

  • RE: Invent journal create form modified method ovveride

    yes its workking

  • Mohit Rampal Profile Picture
    Mohit Rampal 12,552 Super User 2024 Season 1 on at
    RE: Invent journal create form modified method ovveride

    Great, just remove one semi column from here below code.

    journalName.OABSiteId;;

  • GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    RE: Invent journal create form modified method ovveride

    Code seems to be okay. Have you checked that? is that working?

    Thanks,

    Girish S.

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,965 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,817 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans