Create a filter in a variable option

marmar Member Posts: 17
Hi

I want to set a filter to custumer ledger entry to select only invoices and bills with remaining amount.
Next i want to copy this to a new table.

how can i do this? Please, i need help! :cry:

Comments

  • krikikriki Member, Moderator Posts: 9,110
    Something like this:
    PS : if an entry has a remaining amount, it is Open. So I put a filter (and currentindex) on Open. This should give better reading performance.
    recCustLedgerEntry.RESET;
    recCustLedgerEntry.SETCURRENTKEY(Open);
    recCustLedgerEntry.SETRANGE(Open,TRUE);
    recCustLedgerEntry.SETFILTER("Document Type",'%1|%2'
      recCustLedgerEntry."Document Type"::Invoice,
      recCustLedgerEntry."Document Type"::Bill);
    IF recCustLedgerEntry.FINDSET THEN
      REPEAT
         CLEAR(recNewTable);
         recNewTable.TRANSFERFIELDSrecCustLedgerEntry);
         or
         recNewTable."Field 1" := recCustLedgerEntry."Field 1";
         recNewTable."Field 2" := recCustLedgerEntry."Field 2";
         ...
    
         recNewTable.INSERT(FALSE);
      UNTIL recCustLedgerEntry.NEXT = 0;
    
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • marmar Member Posts: 17
    thanks a lot!

    Could you tell me where should i put that?
    i munst confess that i'm not a programer.. i'm trying to...

    O:)
  • krikikriki Member, Moderator Posts: 9,110
    You can create a codeunit and put it in the OnRun-trigger.
    Or a report and put it in the OnPreReport or OnPostreport trigger.
    Or in a form in the OnOpen-trigger. Or in a function that is called by a button on the form.
    There are so many possibilities.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.