This topic contains 1 reply, has 0 voices, and was last updated by pcutler 6 years, 6 months ago.

  • Author
    Posts
  • #21295 Score: 0

    Vesku1980
    • Contributions: 0
    • Level 1

    Hi,

    I'm trying to edit GL impact with custom GL. This is working correctly but i have a problem that

    i need to create also Journal Entry because one of the accounts on the GL impact is not accessible by Custom GL.

    For some reason script will creates this Journal Entry three times.

    Does anyone have an idea why?

    script:

    var newLine = customLines.addNewLine();

    newLine.setDebitAmount('500');

    newLine.setAccountId(545); // Deposit

    newLine.setMemo("CustomGL booking");

    var newLine = customLines.addNewLine();

    newLine.setDebitAmount('120');

    newLine.setAccountId(109); // VAT

    newLine.setMemo("CustomGL booking");

    var newLine = customLines.addNewLine();

    newLine.setCreditAmount('620');

    newLine.setAccountId(548);

    newLine.setMemo("CustomGL booking");

    //Create Journal entry

    var createJournalEntry = nlapiCreateRecord('journalentry');

    createJournalEntry.setFieldValue('currency', 1);

    createJournalEntry.setFieldValue('subsidiary', 7);

    createJournalEntry.setLineItemValue('line', 'account', 1, 548);

    createJournalEntry.setLineItemValue('line', 'debit', 1, '620');

    createJournalEntry.setLineItemValue('line', 'account', 2, 124);

    createJournalEntry.setLineItemValue('line', 'credit', 2, '620');

    try {

    var journalEntryId = nlapiSubmitRecord(createJournalEntry);

    } catch (e) {

    nlapiLogExecution('Audit', 'Error', e.getDetails())

    }

    Vesku
    This is a cached copy. Click here to see the original post.

  • #21296 Score: 0

    pcutler
    • Contributions: 0
    • Level 1

    If you're creating the journal entry because the AR or AP account was not available in the custom GL plug-in, that is resolved in 2018.1.

You must be logged in to reply to this topic.