Call Function on PagePart (Former SubForm)

ASK_ITGASK_ITG Member Posts: 30
edited 2013-04-05 in NAV Three Tier
Hi,

I am trying to make a PagePart in my Page - but it will not make the Filter that I would like.

I have in the Classic Client som code that makes a Filter by calling a Function og the Subform - which I am trying to doublicate to my Page - but it doesn't work. :oops:

The Code:


Can anyone help me?
/Allan

Comments

  • deV.chdeV.ch Member Posts: 543
    Please post the code of the function you are calling.

    And: have you tried CurrPage.Update; after calling the function?
  • ASK_ITGASK_ITG Member Posts: 30
    Hi,

    The Function:
    SetActSubscriber(pNo : Code[20])
    ActSubscriberNo := pNo;

    SETRANGE("Subscriber No.", ActSubscriberNo);

    Have tried to call CurrPage.Update - got an error saying something like:
    "You can not make a change to the databasen before a transaction has started"
    /Allan
  • mihail_kolevmihail_kolev Member Posts: 379
    try CurrPage.UPDATE(FALSE)
    -Mihail- [MCTS]
  • ASK_ITGASK_ITG Member Posts: 30
    Hi,

    No effect.

    Have inserted some Messages - and I can se that the code on the function is processed - but doesn't take effect, or at least doesn't update the subpage...
    /Allan
  • BernardJBernardJ Member Posts: 57
    Try this: don't set the SETRANGE in the function you're calling from the 'headerpage', but put that line in the OnAfterGetRecord of the subpage (don't know if that trigger exists in pages, I only work with forms).

    [edit]
    oops, if the user wants to change this filter he won't like this :oops:
    In this case a check is needed whether the filter has to be set or not, something like
    SetActSubscriber(pNo : Code[20])
    ActSubscriberNo := pNo;

    FilterHasBeenSet := FALSE;
    OnAfterGetRecord()
    IF NOT FilterHasBeenSet THEN SETRANGE("Subscriber No.", ActSubscriberNo);

    FilterHasBeenSet := TRUE;
    [/edit]

    And what about SubFormLink / SubPageLink?

    Regards
  • kabrocokabroco Member Posts: 111
    :P I've been searching for a solution, my page with filtered subpage, did not update the subpage. When I pressed F5 on my key-board, the sub page /subform was updated. When I pressed with the mouse: actions from the mainpage, refresh (= F5) the subform was not updated.

    The solution was simple: change the pagetype from the main page to worksheet.

    :-$ I should have known, made worksheets before....but the filtering was done with an action and not with a field with options in the main page. :-$
Sign In or Register to comment.