Dataport (G/L Entries table)

ykcheongykcheong Member Posts: 32
Hello,

I want to export data from G/L Entries table. I also want to be able to sum the "amount" by "G/L Account Code" and "Global Dimension 1" before the data being export to excel file.

Can this be done? Please help.

Thank you very much.

Have a nice day.

Comments

  • MalajloMalajlo Member Posts: 294
    Create dataport with new variable Amount and GLAcc (as rec T:15).

    code (without setting dinamicaly filter to Dim1):
    G/L Entry - OnBeforeExportRecord()
    GLAcc.setrange(GLAcc."No.","G/L Entry"."G/L Account No.") ;
    GLAcc.setfilter(GLAcc."Global Dimension 1 Filter",GLdim1) ; //you can use getfilteR("Global dimension 1) ;
    amm := 0 ;
    if GLAcc.findfirst then GLAcc.calcfields("Balance at Date") ;  //otherwise calcfield returns 0
    Amm := GLAcc."Balance at Date" ;
    

    And you have to add dataport filed Amm
Sign In or Register to comment.