Hi All,
I am trying to call LedgerPurchaseInvoice Service.It was creates invoice journal Under "Invoice Register" . But My requirements is I want to create invoice under "Invoice Journal" at Account Payables
Can anybody guide me on this.
Regards,
Srinivas
*This post is locked for comments
Thanks Vassu for your help,
I have changed that line (you mentioned above in your comment).
but i found one more Line in same code "saveAxLedgerJournalTable" :
journalName = AxdDocumentParameters::find().InvoiceRegisterJournalName
does i need to change this line also ? because this is for InvoiceRegister Journal .
please suggest ?
Thanks.
not required
thank you so much Vaasu,
Okay i will change like that .
Could you please tell me any other place that i need to change ?
Thanks.
Yes,
The document services are pointing to Invoice Register,
Its hard coded values.
Can you please check the below class and line
AxdPurchaseInvoice - classe
saveAxLedgerJournalTable - method
//Default one
//axLedgerJournalTable_CustVend.parmJournalType(LedgerJournalType::PurchaseLedger);
change to
axLedgerJournalTable_CustVend.parmJournalType(LedgerJournalType::VendInvoiceRegister);
Then you can create invoice journal.
Regards,
Srinivas
Hello Vasu and Levgen,
i am trying same Class (LedgerPurchaseInvoice) in Dynamics Excel Add-In to import AP Vendor Invoices in Vendor Invoice Journal in Account PAyable Module .
have you resolve this issue ?
please tell me .
Thanks.
and what is the journal type of Vend_Inv ?
Hi Ievgen,
I have tried both Invoice Register and VendInvoiceRegister but the invoice create under Invoice Register at Account Payable Journals.
Hey vaasu,
Why do you specify VendInvoiceRegister journal type if you don't want to have invoice register ?
journalHeader.JournalType = AxdEnum_LedgerJournalType.VendInvoiceRegister;
Hi ievgen,
This is the code.
CallContext callcontext = new CallContext();
callcontext.Company = "MFI";
PurchaseInvoiceServiceClient client = new PurchaseInvoiceServiceClient();
AxdPurchaseInvoice purchaseInvoice = new AxdPurchaseInvoice();
AxdEntity_LedgerJournalTable journalHeader = new AxdEntity_LedgerJournalTable();
journalHeader.JournalType = AxdEnum_LedgerJournalType.VendInvoiceRegister;
journalHeader.JournalTypeSpecified = true;
journalHeader.JournalName = "Vend_Inv";
IList<AxdEntity_LedgerJournalTrans> journalLines = new List<AxdEntity_LedgerJournalTrans>();
for (int i = 0; i < vendorGlDistributions.Count; i++)
{
AxdEntity_LedgerJournalTrans journalLine = new AxdEntity_LedgerJournalTrans();
if (i == 0)
{
journalLine.AccountType = AxdEnum_LedgerJournalACType.Vend;
}
else
{
journalLine.AccountType = AxdEnum_LedgerJournalACType.Ledger;
}
if (journalLine.AccountType == AxdEnum_LedgerJournalACType.Vend)
{
journalLine.AccountTypeSpecified = true;
journalLine.Company = "MFI";
AxdType_MultiTypeAccount account = new AxdType_MultiTypeAccount();
account.Account = vendorInforation.VendorAccount;
account.DisplayValue = vendorInforation.VendorAccount;
journalLine.Invoice = vendorInforation.InvoiceId;
journalLine.AmountCurDebit = vendorGlDistributions[0].Debit;
journalLine.AmountCurDebitSpecified = true;
}
else if (journalLine.AccountType == AxdEnum_LedgerJournalACType.Ledger)
{
journalLine.AccountTypeSpecified = true;
journalLine.Company = "MFI";
AxdType_MultiTypeAccount account = new AxdType_MultiTypeAccount();
account.DisplayValue = "010220-009-009004";
account.Account = vendorInforation.VendorAccount;
account.DisplayValue = vendorInforation.VendorAccount;
journalLine.LedgerDimension = account;
}
journalLines.Add(journalLine);
}
journalHeader.LedgerJournalTrans = new AxdEntity_LedgerJournalTrans[1] { journalLine };
journalHeader.LedgerJournalTrans = journalLines.ToArray();
purchaseInvoice.LedgerJournalTable = new AxdEntity_LedgerJournalTable[1] { journalHeader };
try
{
EntityKey[] entitykey = client.create(callcontext, purchaseInvoice);
journalBatchNumer = entitykey[0].KeyData[0].Value;
}
catch (Exception exception)
{
}
return journalBatchNumer;
Please check this code and guide.
Hi vaasu,
There is no significant changes between 2009 and 2012, this link propose to create new document.
I'm not sure if it is possible with LedgerPurchaseInvoiceService.
Can you share your code ?
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,228 Super User 2024 Season 2
Martin Dráb 230,056 Most Valuable Professional
nmaenpaa 101,156