I have wrote a function in VB.Net to perform a Cash Purchase in Microsoft
Office Accounting using the Small
Business Accounting SDK.
VB.Net Code:
Dim PurchaseOrder As IPurchaseOrder = DirectCast(sbi.CreatePurchaseOrder,
IPurchaseOrder)
Dim dt As Date = Now.Date
PurchaseOrder.CreatePurchaseOrderLine(DocumentLineType.ContractExpenseLineType)
Dim CustPayment As ICustomerVendorPayment = sbi.CreateVendorPayment
Dim VendorPayment As IVendorPayment = sbi.CreateVendorPayment
VendorPayment.FinancialAccount =
sbi.FinancialAccounts.GetByDisplayNumber("1010")
VendorPayment.FriendlyDocumentName = "Cash Purchase"
PurchaseOrder.DeliveryDate = dt
PurchaseOrder.DocumentDisplayNumber = "8"
PurchaseOrder.FinancialDateTime = dt
PurchaseOrder.PaymentMethod = sbi.PaymentMethods.GetByName("Cash or
Direct Debit")
PurchaseOrder.VendorName.Contains("Supplier123")
VendorPayment.PayToAccountName.Contains("Savings Account")
MsgBox("Test 1 ")
PurchaseOrder.VendorAccount = sbi.VendorAccounts.GetByPrimaryKey(1010)
Dim VendorAc As IVendorAccount = sbi.CreateVendorAccount
VendorAc.Contacts.GetContact(1)
VendorAc.DisplayNumber = 5
PurchaseOrder.VendorAccount = sbi.VendorAccounts.GetByPrimaryKey(1)
Dim ItemLine As IItemLine =
DirectCast(PurchaseOrder.CreatePurchaseOrderLine _
(DocumentLineType.ContractItemLineType), IItemLine)
ItemLine.ChangeLineType(DocumentLineType.ContractItemLineType)
ItemLine.ItemName().Contains("Expense")
ItemLine.FinancialAccount =
sbi.FinancialAccounts.GetByDisplayNumber("6010")
ItemLine.Quantity = 1
ItemLine.UnitPrice = 5000
ItemLine.SubTotal = 5000
VendorPayment.Amount = 5000
PurchaseOrder.Save()
But when i try to save the Cash Purchase entry it shows an error message as:
"The VendorAccountID property
cannot be null". So i need to know how to set the value to VendorAccountID
property?
Thanks in advance
ShamYemul.co.cc
Intellisoft.Co.In
When i try to save a Cash Purchase entry in SBA SDK i get this error: "Could
not modify the current record
because it has dependencies. (For example, an item that appears on one or
more documents cannot be deleted.)".
So i want to know what are these dependencies for making Cash Purchase entry?
"Sham Yemul" <Sham Ye...@discussions.microsoft.com> wrote in message
news:E025AA08-21EA-4AEA...@microsoft.com...
thanks for response.
I need help for Purchase Entry, and not Sale,
right now I am stuck-up for "Pay From" on the MOA screen of Purchase Entry,
we can set a financial account like Bank Account, Pitty Cash etc. But I did
not find any method/property or interface that allows setting "Pay From".
Please help me if anyone knows about this.
Regards
Sham
"icreateofx" wrote:
> .
>