Subform record placement on last record

shogan@mila.ieshogan@mila.ie Member Posts: 113
Good morning everyone,

Hope all is well.

Have a small problem that I am trying to fix - purely cosmetic, but would make life easier for my users.

I have brought in the comments onto the Customer Card as a subform. I'd like for the subform to automatically scroll down to the most recent record.

So my subform properties for the Comment Sheet on The Customer Card are:

SubFormID = Comment Sheet
SubFormView = SORTING(Table Name,No.,Line No.) ORDER(Ascending)
SubformLink = Table Name=CONST(Customer),No.=FIELD(No.)

On the Comment Sheet form itself, I have changed the following properties:

SourceTablePlacement = Last

This kind-of works... If I open the Customer Card for the first time, it will land on the last record in the subform.

However, if I use the previous/next navigation buttons, the record selector eventually moves to the first record.

I am wondering if there is a way of getting the subform to focus always on the last record?

Regards,
Stephen

Comments

  • kinekine Member Posts: 12,562
    You will need to call some function of the subform where will be the FINDLAST used, and you need to call it when needed. But this could be the prolem. You can try to call it from OnAfterGetCurrRecord of the main form.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • David_SingletonDavid_Singleton Member Posts: 5,479
    kine wrote:
    You will need to call some function of the subform where will be the FINDLAST used, and you need to call it when needed. But this could be the prolem. You can try to call it from OnAfterGetCurrRecord of the main form.

    Did you try this? I am pretty sure it wont work.

    SubForms are jam packed with bugs that have been there since version 1.1, and obviously since Forms are dead will never be fixed. The most significant bugs are that cursor placement in SubForms simply does not work. Another is that you can't have SubForms in SubForms. I submitted a list of bugs in SubForms to Navision in ver 1.1, I haven't recently checked 2009, but I assume all those bugs are still there.
    David Singleton
  • shogan@mila.ieshogan@mila.ie Member Posts: 113
    I haven't tried that specifically, but I was wondering if I could do this instead?

    Create a button on the form that will be the subform, to move the record placement to the last record.

    Then in the main form, use some sort of "send keys" to press the button?
  • shogan@mila.ieshogan@mila.ie Member Posts: 113
    Saw this viewtopic.php?f=23&t=4618&view=next

    As long as I know that the Line No. for the last Comment record is for this Customer, it might just work, along with Sendkeys to the button...

    Might need your help soon guys, but any suggestions now are welcome too!
Sign In or Register to comment.