Skip to main content

Notifications

Microsoft Dynamics NAV (Archived)

Insert Record on action click one page to another table

Posted on by Microsoft Employee

I want to fetch some columns from the selected row and insert it into another tables on action click . I have added one action on list page.

*This post is locked for comments

  • Suggested answer
    RockwithNav Profile Picture
    RockwithNav 6,562 on at
    RE: Insert Record on action click one page to another table

    And what did you tried so far?

  • Bodhi Profile Picture
    Bodhi 554 on at
    RE: Insert Record on action click one page to another table

    If only select one raw, define a variable: l_anotherTable link  to anther table

    Under <XX> - OnAction()

    l_anotherTable.RESET;

    l_anotherTable.INIT;

    CLEAR(l_anotherTable);

    l_anotherTable.FIELD := Rec.FIELD;

    ...

    l_anotherTable.INSERT(TRUE);

    IF SECTECT MORE THAN ONE LINE, we need to define a variable link to currenct page source table: l_currenctTable

    Under <XX> - OnAction()

    l_anotherTable.RESET;

    l_currenctTable.RESET;

    CurrPage.SETSELECTIONFILTER(l_currenctTable);

    if l_currenctTable.FINDFIRST THEN

     REPEAT

       l_anotherTable.INIT;

       CLEAR(l_anotherTable);

       l_anotherTable.FIELD := l_currenctTable.FIELD;

       ...

       l_anotherTable.INSERT(TRUE);

     UNTIL   l_currenctTable.NEXT = 0;

  • Suggested answer
    I Gusti Made Ari Profile Picture
    I Gusti Made Ari 3,594 on at
    RE: Insert Record on action click one page to another table

    You can use SETSELECTIONFILTER to get selected record  and then do the insert

    docs.microsoft.com/.../setselectionfilter-function

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans