Change marker on Sales Order Subform

ellusiveladyellusivelady Member Posts: 23
Hi,

When I click the Next blue button on top navigation bar, it will bring me to the next record right? And each time it will update both the main form and subform.

My question is how do I reset the marker to always point at the first record on the subform?

If you guys noticed, let's say you point the marker at 3rd line for SO#10001. And when you click Next Record, the point marker will remain at 3rd line for SO#10002.
(note: both SO#10001 & SO#10002 must have more than 3 items)

Is there any way I can make it be defaulted as 1st record?

Thanks

Answers

  • SteveSteve Member Posts: 81
    On the main form that is in the subform try changing the property -> SourceTablePlacement. change to FIRST

    Give it a try.
    Steve
  • ellusiveladyellusivelady Member Posts: 23
    Hi Steve,

    I tried but it's not working. When SO#10001, I point to 3rd line and click Next record, it still points to 3rd line of SO#10002.

    Any other suggestions perhaps? [-o<
  • DenSterDenSter Member Posts: 8,305
    Check that property on the subform.

    When I point to the 3rd line on the subform, and I hit next, it jumps to the next order, but the marker is on the first line of the subform, it does not keep the marker on the 3rd line. Try the Invoice form and see if it does the same thing, then try the blanket order, the receipt, the return order, check multiple header/line forms to see if it happens everywhere.
  • ellusiveladyellusivelady Member Posts: 23
    Hi DenSter,

    Thanks for your alert.

    Turns out that it should be property of subform and not main form. My bad. :oops:

    However, my current system I added a field Sub Order (integer) and always default setrange SubOrder #1 on open subform.

    Once I setrange another number (maybe Sub Order #4) for SO#10001, and I click NEXT record, following are the outcomes.

    ~ If SO#10002 consist of Sub Order #4, then marker will point at 1st line.

    ~ If SO#10002 do not have Sub Order #4 and last line belongs to Sub Order #3, then marker will point at a new line and not 1st line.

    Thus, I just want the marker to consistently place at 1st line and not a new line.

    Any luck on that perhaps? [-o<

    Thanks.
  • DaveTDaveT Member Posts: 1,039
    Hi ellusivelady,

    One way to solve this is to force the first line of the subform. You can acheive this by creating a function in the subform as....
    gotofirst()
    CurrForm.UPDATE( TRUE );
    IF FINDFIRST THEN;
    CurrForm.UPDATE( FALSE );
    

    You can then call this function from the main form e.g.

    CurrForm.Subform.FORM.gotofirst;

    the first update is to save uncommitted changes and the second to refresh the form
    the IF on the findfirst is to avoid an error when there are no lines.

    you can delete the first update if the subform is ineditable

    Not the most elegant solution but it works :wink:
    Dave Treanor

    Dynamics Nav Add-ons
    http://www.simplydynamics.ie/Addons.html
  • ellusiveladyellusivelady Member Posts: 23
    Hi DaveT,

    Thanks so much for your suggestion. However, it does not work. Probably due to the customization that i did with the setrange of suborders. ](*,)

    Anyways, I did tried an update(false) previously. What basically happens is when I click Next, it will jump to the last record. And when I click Previous, it just refuses to go previous.

    I consulted my colleague from India. It's puzzling but I really believe must be due to my customization. So what I basically did is create a refresh function with a shortcut key. Hence, each time user go to a new record, he/she have to consistently refresh all the forms.

    Can't seem to find any other way to workabout it. With that said, I shall just consider it as solved. Thanks guys for your contribution.
  • DaveTDaveT Member Posts: 1,039
    Hi ellusivelady,

    Have you tried to debug the form and see if it's the sequence of calls that effects it. I tried the example on a Cronus sales order and got it to work so check your call sequence
    Dave Treanor

    Dynamics Nav Add-ons
    http://www.simplydynamics.ie/Addons.html
Sign In or Register to comment.