Suppress rows on subform without markedonly

FaulconFaulcon Member Posts: 19
I was wondering if someone might be able to suggest a method to suppress rows with a value of 0 on 3 given amount columns on a subform without using the markedonly function. This function does the job but the performance hit it creates is quite frustrating especially since we currently want to move our database onto SQL but the form takes twice as long to update there and it's very heavily used. Any ideas I'd love to hear them.

Thanks

Comments

  • ara3nara3n Member Posts: 9,257
    Add a new field called Hide. Onmodify trigger

    hide := (amount1 + amount2 + amount3) = 0;

    set a filter on hide = false.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • FaulconFaulcon Member Posts: 19
    I should clarify further I guess. The form is basically an analysis tool used to filter on the G/L Account table. It shows Net Change, Budget, and a Commitment Amount (calculated from open purchase orders). Filters are entered for two global dimensions, resource and/or date.

    If all three of the columns are equal to zero after those filters have been applied then we don't want to show the row on the subform.
  • dbdb Member Posts: 82
    Another solution can be done, by using form trigers OnFindRecord, OnNextRecord. Put there code that, skips unwanted records.
  • ara3nara3n Member Posts: 9,257
    Here is the code example. On open form write the records to temp record. As they are setting filters, you have set filters on temp variable as well.
    Form - OnFindRecord(Which : Text[1024]) : Boolean
    TempCL.COPY(Rec);
    Found := TempCL.FIND(Which);
    Rec := TempCL;
    EXIT(Found);
    
    Form - OnNextRecord(Steps : Integer) : Integer
    TempCL.COPY(Rec);
    ResultSteps := TempCL.NEXT(Steps);
    Rec := TempCL;
    EXIT(ResultSteps);
    
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
Sign In or Register to comment.