Select first record in dataset when updating page

sorenhinrupsorenhinrup Member Posts: 136
Hello all

I have made a cardpage with a subpage. This subpage is a listpage, which is filtering on a dataset.
On the the cardpage I have added the PingPong function, which updates the cardpage and through that the listpage. That is working as required.
mw74onnvcbnz.png


My issue is that on the listpage, new records are displayed above the sidebar slider. See attatched picture as example.
2eu70y6n9uuy.png

I would like the currpage.update to also automaticly select/mark the first record in the dataset on the subpage.
Are there anyway to achive this?

Answers

  • lyngelynge Member Posts: 85
    Have you tried a simple
    IF FINDFIRST() THEN ;
    ...before the
    currpage.update(false);
    ?
  • sorenhinrupsorenhinrup Member Posts: 136
    That doesn't work unfortunately.
  • lyngelynge Member Posts: 85
    edited 2016-05-11
    Ahh - off cause not. Sorry.
    It is a findfirst in the card page which is not the correct Rec to FindFirst on...

    What about creating a function trigger in the listpart (subpage) with
    ---
    if findfirst() then ;
    currpage.update(false)
    ---

    ...and then calling that function from the card page insted of the currpage.update(false) - something like this:
    CurrPage.<the subpages control name in the card page>.PAGE.<the name of the new function trigger>();
  • sorenhinrupsorenhinrup Member Posts: 136
    We just tried this, and it doesn't seem to have helped either.
  • martonnmartonn Member Posts: 29
    What version? Because from NAV 2015 onwards you can use the UpdatePropagation property
  • sorenhinrupsorenhinrup Member Posts: 136
    This is 2015, and changing this property did not help :(
  • Peter+is1Peter+is1 Member Posts: 174
    Hi,

    You could try SendKeys, and send a CTRL-Home. Seems to work here.
    However I could not get it to work in my 2016 CU4 :/

    DotNet System.Windows.Forms.SendKeys.'System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'

    Good luck, I am curious about your result..
    \\
    The truth exists in seven versions.
  • sorenhinrupsorenhinrup Member Posts: 136
    We tried this Peter, but the issue was that this only sent the keys of the page we were actively in. At the moment they have 2 list pages to be updated automaticly.

    The solution was the FINDFIRST - but placed on the OnAfterGeteCurrRecord trigger.
  • Peter+is1Peter+is1 Member Posts: 174
    Ok, good find. Will try to keep that in the back of my mind. :)
    \\
    The truth exists in seven versions.
Sign In or Register to comment.