GP WebService: How to insert Cash or Check or CreditCard amount with Purchase Amount in Payable Invoice Transaction, please need help.
The following code for Payable Invoice Transaction only with Purchase Amount, but i need to include Cash or Check or Creditcard amount.
CompanyKey companyKey; Context context; PayablesDocumentKey invoiceKey; BatchKey batchKey; VendorKey vendorKey; PayablesInvoice payablesInvoice; Policy payablesInvoiceCreatePolicy; // Create an instance of the service DynamicsGP wsDynamicsGP = new DynamicsGP(); // Be sure the default credentials are used wsDynamicsGP.UseDefaultCredentials = true; // Create a context with which to call the service context = new Context(); // Specify which company to use (sample company) companyKey = new CompanyKey(); companyKey.Id = (-1); // Set up the context object context.OrganizationKey = (OrganizationKey)companyKey; // Create a payables document key object to identify the payables invoice invoiceKey = new PayablesDocumentKey(); invoiceKey.Id = "00000000000001550"; // Create a batch key batchKey = new BatchKey(); batchKey.Id = "PAYABLES BATCH"; // Create a vendor key vendorKey = new VendorKey(); vendorKey.Id = "ADVANCED0001"; // Create a money amount object for the transaction MoneyAmount purchaseAmount = new MoneyAmount(); purchaseAmount.Currency = "USD"; purchaseAmount.Value = 250m; // Create a payables invoice object payablesInvoice = new PayablesInvoice(); // Populate the invoice properties payablesInvoice.Key = invoiceKey; payablesInvoice.BatchKey = batchKey; payablesInvoice.VendorKey = vendorKey; payablesInvoice.VendorDocumentNumber = "DOCUMENT 10"; payablesInvoice.PurchasesAmount = purchaseAmount; // Get the create policy for payables invoices payablesInvoiceCreatePolicy = wsDynamicsGP.GetPolicyByOperation( "CreatePayablesInvoice", context); // Create the payables invoice wsDynamicsGP.CreatePayablesInvoice(payablesInvoice, context, payablesInvoiceCreatePolicy);
Thanks in Advance
Sekar V
*This post is locked for comments
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,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156