Options

Retrieving current SalesLine record in RTC

havhav Member Posts: 299
edited 2010-03-03 in NAV Three Tier
Hi All,
I have added a new menubutton on Sales Order form/page and it has 'Edit' as one of the menu option. I have written following code in the OnPush() / OnAction() tirgger of 'Edit' menu option:
Edit - OnAction()
//Obtain the currently selected Salesline record from the Sales Line subform
CurrPage.SalesLines.FORM.GETRECORD(CurrSalesLine); //CurrSalesLine-> SalesLine record var.
.........

The purpose of this code is to fetch the currently selected SalesLine record when a user selects a salesline from the Sales Order subform of Sales Order Card/Page and do some processing based on the values it possesses.

In Classic Client, the above code execution sets CurrSalesLine var. properly to refer to the currently selected salesline on the Sales Order Card.

However in Role Tailored Client, the CurrSalesLine var. does not change according to the selection made on the Sales Order page. It always refers to the first salesline record present on the Sales Order page.

I am not sure why is the CurrSalesLine var. not set properly in RTC?
Is the GETRECORD() function not working for Page object.?

Any idea?

Regards,
Hemant
Regards,
Hemant
MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)

Answers

  • Options
    mihail_kolevmihail_kolev Member Posts: 379
    This one is kind of solution viewtopic.php?f=32&t=35876
    -Mihail- [MCTS]
  • Options
    havhav Member Posts: 299
    Thanks for your reply.

    I reviewed the topic on using Windows sendkeys to activate actions on subpages and i found it interesting.
    But i am still not sure on how to retrieve the current sales line and use it for processing.

    My 'Edit' action does not have a shortcut key and the new menubutton which i had added containing this action do appear in 'Related Information' menu of Sales Order page. It has not been Promoted nor it appears anywhere in the Lines Action flash button.
    Regards,
    Hemant
    MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)
  • Options
    havhav Member Posts: 299
    The problem is now resolved.
    I used the workaround as suggested in http://www.mibuso.com/forum/viewtopic.php?f=32&t=35876

    Thanks,
    Hemant
    Regards,
    Hemant
    MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)
Sign In or Register to comment.