Options

You Can't Call a function present on the lines of a Document

PureHeartPureHeart Member Posts: 190
edited 2012-03-12 in NAV Three Tier
I'm trying to call a function present on the lines (subform of a page) from the header.....it is possible but it's not picking up the selected record of the lines!
For Example you can have a look at the "Show Lines Dimensions" of a Sales Order...it is not like before you can't call the function of the subform from the header...
you have to call it from the actions of the subform!!!
Have you had the same problem??
:(:(:( Is that true??
That's really Bad!

Thanks
Why don't you try my compare tool?
http://www.mibuso.com/dlinfo.asp?FileID=1123

Comments

  • Options
    freddy.dkfreddy.dk Member, Microsoft Employee Posts: 360
    I can answer one of the questions (not that it will help you at all :( ): Yes, it is true for NAV 2009.
    Whether this will change in the future, I can't tell - but I know that the Dev team has this problem on the radar.
    Freddy Kristiansen
    Group Program Manager, Client
    Microsoft Dynamics NAV
    http://blogs.msdn.com/freddyk

    The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.
  • Options
    PureHeartPureHeart Member Posts: 190
    Ok Thanks... :(
    I was thinking that maybe with a key shortcut to call an action in the subform and and action in the header to send the shortcut key could resolve the problem....?
    I Tried with a windows shell automation and the sendkeys command without any luck...
    Do you think is possible?

    p.s.
    Yout blog is the best Freddy :)
    Why don't you try my compare tool?
    http://www.mibuso.com/dlinfo.asp?FileID=1123
  • Options
    kinekine Member Posts: 12,562
    PureHeart wrote:
    Ok Thanks... :(
    I was thinking that maybe with a key shortcut to call an action in the subform and and action in the header to send the shortcut key could resolve the problem....?
    I Tried with a windows shell automation and the sendkeys command without any luck...
    Do you think is possible?

    p.s.
    Yout blog is the best Freddy :)

    D not forget that when you are using the shell automation, it is running on the service tier and not on the client if not specified differently during CREATE... ;-)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Options
    Marc_Hansen_[MSFT]Marc_Hansen_[MSFT] Member, Microsoft Employee Posts: 12
    To add a bit more details to Freddy’s answer.

    You can call a function on a subpage no problem. But you are not able to use the current record, selected or marked records in subpage when this function is invoked from parent page.

    In the new architecture all of the application logic is executed on the server and to invoke this code the client calls the server with all the state of the current page but this doesn’t include records selected in subpages, factboxes etc.

    You need to move this action from parent page (header) to the subpage:
    - The intension is that all actions related to subpages should go into the lighting menu of the subpage and that works fine.
    - The current version of the transformation tool should be able to move the action to the subpage automatically based on an existing Form and subform relationship.

    If you would like to make the action more accessible you can add a shortcut to the action, like Dimensions (Shift + Ctrl + D) on the “Sales Order Lines”.

    Do you have a special reason to place this action on the Header and not on lines?

    /Marc
    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Options
    freddy.dkfreddy.dk Member, Microsoft Employee Posts: 360
    I Tried with a windows shell automation and the sendkeys command without any luck...
    Do you think is possible?
    An action on the main form with the following code
    CREATE(WshShell,TRUE,TRUE);
    WshShell.SendKeys('+^D');
    
    actually works fine - but it is kind of a hack.
    What if you change the shortcut key?
    What if another action gets that shortcut key?
    etc.
    Freddy Kristiansen
    Group Program Manager, Client
    Microsoft Dynamics NAV
    http://blogs.msdn.com/freddyk

    The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.
  • Options
    PureHeartPureHeart Member Posts: 190
    Well yes Freddy you are right but that would be true with every shortcut key...
    I want to put the function on the header because it looks much better and the user have to press a big button instead of having to go on the actions of the lines to call a function subform related....
    I hope this limitation will be removed in the next version of NAV........
    Why don't you try my compare tool?
    http://www.mibuso.com/dlinfo.asp?FileID=1123
  • Options
    funky_bfunky_b Member Posts: 1
    Hello!

    In the current release of NAV 2009 (R2 6.0.33046.0) it is possible to call functions of the subpage in the mainpage. You can do so by using CurrPage.PAGENAME.FORM.FUNCTION.

    Currently there is a sideffect using this solutions:
    Example: Sales Header - Sales Line
    Sales Line 1 - Item A - Qty 10
    Sales Line 2 - Item B - Qty 5

    After selecting Sales Line 2 and pressing a button in the the mainpage to call a fuction in the subpage, you won't find yourself on Record Sales Line 2 - instead the Rec will still be on Sales Line 1. If you press the Button in the mainpage a second time, the Record will be correctly on Sales Line 2.


    One solution to fix this, is to use a (hidden) factbox (which is linked to the line-table) instead of the subpage. Just place the function into the factbox and call it in the mainpage. This works well - even when the fact box is not visible.
Sign In or Register to comment.