m1gs
m1gs

Reputation: 197

How to get the Journal Number of an invoice when entering "Lines"?

I am trying to get the journal number (Red box) from the invoice journal. I have a button inside the Lines (blue box), however in order for it to work I need the Journal Number (red box) when I clicked the Lines (blue box).

enter image description here

Upvotes: 0

Views: 429

Answers (1)

Aliaksandr Maksimau
Aliaksandr Maksimau

Reputation: 2281

Your Line form already have variable journalNum

enter image description here

So on your Lines form create parm method like this

public LedgerJournalId parmJournalNum(LedgerJournalId _journalNum = journalNum) 
{ 
    journalNum = _journalNum; 

    return journalNum; 
}

And then in main method of your batch class you can get journal number using the following code

if (classIdGet(args.caller()) == classNum(SysSetupFormRun)) 
{ 
    if (formHasMethod(args.caller(), identifierStr(parmJournalNum))) 
    { 
        journalNum = args.caller().parmJournalNum(); 
    } 
}

Upvotes: 1

Related Questions