alternative to Marked Only on Forms?

knightknight Member Posts: 45
edited 2004-05-19 in Navision Attain
Just completed a project for a client where there is a form similar to the one below. It contains a tabcontrol for filtering and a subform based on table 15. The client requires the ability to enter filters in the tabcontrol and when the flowfields are calculated, only if at least one of the following fields (“Net Change","Budgeted Amount",Commitment) is not equal to 0 then the line should be displayed in the subform. Now l have this working as seen the code below, but the problem l have is MARKEDONLY seems to be very very very slow when used on larger amounts of data and as a result the client is complaining.

Is there another way around this without using MARKEDONLY?


Sample code:
CurrForm.SubForm.FORM.ClearMarks;
rGLAcc.CLEARMARKS;
rGLAcc.COPYFILTERS(Rec);
IF rGLAcc.FIND('-') THEN REPEAT
  rGLAcc.CALCFIELDS("Net Change","Budgeted Amount",Commitment);
  IF (rGLAcc."Net Change" <> 0) OR
     (rGLAcc."Budgeted Amount" <> 0) OR 
     (rGLAcc.Commitment <> 0) THEN
    rGLAcc.MARK(TRUE);
UNTIL rGLAcc.NEXT = 0;

CurrForm.SubForm.FORM.SETTABLEVIEW(rGLAcc);
CurrForm.SubForm.FORM.MarkedOnly;
<- Custom Function to set Marked Only to Subform

Comments

  • micheldoggermicheldogger Member Posts: 21
    Maybe you can add a extra Boolean Field to your Table.
    e.g. "Selected" (Don't make this field visible on the form en set the
    property Editable on False).

    After you have set your filters you can check your lines.
    If a line meets your criteria you can set the field: "Selected" on TRUE.
    After you have checked all your records you can change your sorting
    to "Selected" (if you have made a key from this field) and then
    set the Tabbleview again.

    If this functionality is not used a lot, then adding a extra key may not
    be a option, because of the performance of the database. :!:

    You also have to reset the "Selected" fields again. When you start checking the lines they have to be FALSE
    :!:
  • RobertMoRobertMo Member Posts: 484
    it looks like you have a lot of gL entries behind ? a lot of calculations are done behind.
    am I correct that After applying more filters the calculations gets even slower.
    how many filters do you apply, which are they ?

    can be improved with new keys with only fields that you use for filters, but this key must be as high as possible in key definitions...
               ®obi           
    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Sign In or Register to comment.