Options

ListPage - Code selecting record

Troubles_In_ParadiseTroubles_In_Paradise Member Posts: 588
edited 2011-04-19 in NAV Three Tier
Hi guys!

I'm wondering if anyone of you has already faced a problem like this.
I've a List Page in Nav 2009 R2 and I need to execute a specific code when I pass from one record to another using arrows or selecting one record with mouse (so I select a record and I want to execute the code that will be different according to record selected).
I thought that OnAfterGetRecord() could be the right trigger but, first of all when I launch the page execute the code according to the number of records, and however it's not executed "navigating" in the list with arrows or mouse.

Please let me know if there's a way to do this :D
I would thank you in advance!
~Rik~
It works as expected... More or Less...

Comments

  • Options
    frost_amofrost_amo Member Posts: 22
    I can suggest you the work around your issue. But I am not sure this way of solving will be suitable for you.

    You should create new function on you page. This function should return some Text/Code value, otherwise it will not work.
    Assign this function to the DataCaptionExpr property of the page.

    After that, this function will be called each time when you move from one record to another, and you will be able to put your specific code there.

    If my explanation is not clear, I can provide you more detailed info.
  • Options
    Troubles_In_ParadiseTroubles_In_Paradise Member Posts: 588
    frost_amo wrote:
    I can suggest you the work around your issue. But I am not sure this way of solving will be suitable for you.

    You should create new function on you page. This function should return some Text/Code value, otherwise it will not work.
    Assign this function to the DataCaptionExpr property of the page.

    After that, this function will be called each time when you move from one record to another, and you will be able to put your specific code there.

    If my explanation is not clear, I can provide you more detailed info.
    Thx for reply! I tried what you suggest but it does not do what I would.
    I show you what I did so you can tell me if I did any mistake.

    1. this is my simple function with return value code.
    FunctionTest() : Code[20]
    MESSAGE("No.");
    
    2. I put FunctionTest as value of the DataCaptionExpr of the page.

    now if I run the page it prints all "no." of all records before showing me the page.
    I would message be printed when I select a record.
    ~Rik~
    It works as expected... More or Less...
  • Options
    frost_amofrost_amo Member Posts: 22
    Yes, you are right. It seems that it doesn't work for List pages. NAV firstly cashes some set of results.
    Sorry for wrong suggestion. :(

    In my case such solution works for Worksheet page.

    Also you can take a look on how General Journal page works (I mean, updating of the Account Name, Balance etc. fields on the buttom of the page).

    It might be helpful.
  • Options
    Troubles_In_ParadiseTroubles_In_Paradise Member Posts: 588
    frost_amo wrote:
    Yes, you are right. It seems that it doesn't work for List pages. NAV firstly cashes some set of results.
    Sorry for wrong suggestion. :(

    In my case such solution works for Worksheet page.

    Also you can take a look on how General Journal page works (I mean, updating of the Account Name, Balance etc. fields on the buttom of the page).

    It might be helpful.

    You do not have to apologize! :D Thx again for suggestions!
    I'll take a look to General Journal!
    ~Rik~
    It works as expected... More or Less...
Sign In or Register to comment.