Posting Routine problem

aliennav
aliennav Member Posts: 449
Guys!
There's a problem.
I have added a field(Decimal) in the sales line table.While making sales order I am inserting some thing in that field.Now I want that field to get reflected in G/L Entry.

Any suggesstions?
Early response is solicited.
Thanx in advance

Comments

  • ufuk
    ufuk Member Posts: 514
    Create the same field in Gen. Jnl. Line and then search for "Post sales and VAT to G/L entries from posting buffer" description in Sales-Post codeunit. You will see assignments from Sales Header to Gen. Jnl. Line. You can add your assignment there.
    Ufuk Asci
    Pargesoft
  • kriki
    kriki Member, Moderator Posts: 9,121
    And you also need to create the same field in T17.

    And in codeunit 12, you need to transfer the field from T83:"G/L Journal Line" to T17:"G/L Entry".
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • aliennav
    aliennav Member Posts: 449
    kriki wrote:
    And you also need to create the same field in T17.

    And in codeunit 12, you need to transfer the field from T83:"G/L Journal Line" to T17:"G/L Entry".


    Can u please explain the last step.
    ie. How to transfer the field.Where should be the code written??(And whatcode)
  • ufuk
    ufuk Member Posts: 514
    aliennav wrote:
    Can u please explain the last step.
    ie. How to transfer the field.Where should be the code written??(And whatcode)

    On InitGLEntry

    GLEntry.YourField := GenJnlLine.YourField;
    Ufuk Asci
    Pargesoft
  • kriki
    kriki Member, Moderator Posts: 9,121
    ufuk wrote:
    aliennav wrote:
    Can u please explain the last step.
    ie. How to transfer the field.Where should be the code written??(And whatcode)

    On InitGLEntry

    GLEntry.YourField := GenJnlLine.YourField;
    Easier than this is difficult.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • pruday
    pruday Member Posts: 11
    if you have only one sales line, sound ok to record it in g/l entry.
    But in first place why g/l entry?

    say if you have 10 sales lines, how do you record these in g/l entry? and why?
    Uday
  • ufuk
    ufuk Member Posts: 514
    kriki wrote:

    Easier than this is difficult.

    I didn't understand :D What do you mean?
    Ufuk Asci
    Pargesoft
  • kriki
    kriki Member, Moderator Posts: 9,121
    ufuk wrote:
    kriki wrote:

    Easier than this is difficult.

    I didn't understand :D What do you mean?
    The code needed to add a field to be transferred is very easy. It is difficult (but not impossible) to invent code that makes it even easier to add such a field.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • DenSter
    DenSter Member Posts: 8,307
    You'll definately need to add the field (I'd suggest with the same field number) to all tables involved. Then instead of directly in the posting routines I would add the actual transfer to the "Transfer Custom Fields" codeunit, which is created specifically for this purpose. There are functions in there to transfer fields from journal to ledger, from one ledger to another, etc.

    It looks like this is a US localization though, so I don't know if it is available elsewhere.
  • ufuk
    ufuk Member Posts: 514
    pruday wrote:
    if you have only one sales line, sound ok to record it in g/l entry.
    But in first place why g/l entry?

    say if you have 10 sales lines, how do you record these in g/l entry? and why?

    If you want to sum line amounts , I think basically you can add a flowfield to SalesHeader which sums the sales lines amount. Then you can transfer this amount to G/L Entry in CU12.
    Ufuk Asci
    Pargesoft
  • aliennav
    aliennav Member Posts: 449
    kriki wrote:
    And you also need to create the same field in T17.

    And in codeunit 12, you need to transfer the field from T83:"G/L Journal Line" to T17:"G/L Entry".
    Got the solution.Code was simple.But I am getting the value only in the credit side.Suppose I want it in the debit line also.Wat 2 do 4 dat?/
  • kriki
    kriki Member, Moderator Posts: 9,121
    aliennav wrote:
    kriki wrote:
    And you also need to create the same field in T17.

    And in codeunit 12, you need to transfer the field from T83:"G/L Journal Line" to T17:"G/L Entry".
    Got the solution.Code was simple.But I am getting the value only in the credit side.Suppose I want it in the debit line also.Wat 2 do 4 dat?/
    Add the code you put into Codeunit 80 also in codeunit 90.

    DenSter wrote:
    You'll definately need to add the field (I'd suggest with the same field number) to all tables involved. Then instead of directly in the posting routines I would add the actual transfer to the "Transfer Custom Fields" codeunit, which is created specifically for this purpose. There are functions in there to transfer fields from journal to ledger, from one ledger to another, etc.

    It looks like this is a US localization though, so I don't know if it is available elsewhere.
    It is a US localization, the W1,BE,IT-db's don't have it.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • aliennav
    aliennav Member Posts: 449
    guys I acheived it but now I am getting the value only in the credit line(entry) and not in the debit entry.Like other values such as description etc.I want to get this value(added one) in both the lines.

    Till now I have added the code in trigger named "InitGLEntry(GLAccNo : Code[20];Amount : Decimal;AmountAddCurr : Decimal;UseAmountAddCurr : Boolean;SystemCreatedEntry : Boolean)"

    where this code ws written."
    GLEntry.INIT;
    GLEntry."Posting Date" := GenJnlLine."Posting Date";
    GLEntry."Document Date" := GenJnlLine."Document Date";
    GLEntry."Document Type" := GenJnlLine."Document Type";


    Now what to do for debit entry??
  • kriki
    kriki Member, Moderator Posts: 9,121
    aliennav wrote:
    Now what to do for debit entry??
    Do you mean the purchase with this? Or something else?
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • aliennav
    aliennav Member Posts: 449
    kriki wrote:
    aliennav wrote:
    Now what to do for debit entry??
    Do you mean the purchase with this? Or something else?


    I didn't mean purchase entry.
    When there is a transaction ,2 entries go in G/L Entry table.1 for debit ,other for credit in 2 different accounts.I am talking bout that 2nd transaction(Debit one)
  • kriki
    kriki Member, Moderator Posts: 9,121
    Search for "GLEntry.INSERT;" and put your code just before the statement.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!