on 05-31-2011 4:46 PM
Hi all!! I have a trouble with the InstallmentID property of the Document_Installments Object . I want to update the invoice installment's duedate by DI API , but when i check the IntallmentID property's value of my Document_Installments object, returns this error:
"Property 'InstallmentID' of 'DocumentInstallment' is invalid "
This is my code:
Dim odoc As SAPbobsCOM.Documents
Dim instmntID As SAPbobsCOM.Document_Installments
odoc = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices)
dim x ,y as integer
For x = 0 To ogrid.Rows.Count - 1
odoc.GetByKey(ogrid.DataTable.GetValue("ID Doc.", ogrid.GetDataTableRowIndex(x)))
instmntID = odoc.Installments
For y = 0 To instmntID.Count
instmntID.SetCurrentLine(y)
' ****Here returns the error*****
If odoc.Installments.InstallmentId = ogrid.DataTable.GetValue("Num Rata", ogrid.GetDataTableRowIndex(x)) Then
If odoc.Installments.DueDate <> ogrid.DataTable.GetValue("Data scad.", ogrid.GetDataTableRowIndex(x)) Then
odoc.Installments.DueDate = ogrid.DataTable.GetValue("Data scad.", ogrid.GetDataTableRowIndex(x))
If odoc.Update() = 0 Then
End If
End If
End If
Exit For
End If
Next
Next
Any suggestion? Please help me! I don't know where i can find anything useful!!!
Thanks
Best Regards
Giancarlo
Howcome you change from using the sub object on its own, to back accessing it though the parent object again? You are setting the line on the subobject and then return to the parent object?
instmntID.SetCurrentLine(y)
' *****Here returns the error******
If odoc.Installments.InstallmentId = ogrid.DataTable.GetValue("Num Rata", ogrid.GetDataTableRowIndex(x)) Then
Should maybe be
instmntID.SetCurrentLine(y)
' *****Here returns the error******
If instmntID.InstallmentId = ogrid.DataTable.GetValue("Num Rata", ogrid.GetDataTableRowIndex(x)) Then
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you, i have tryed it before posting it but nothing appens... i have writed the wrong code this is my code:
Dim odoc As SAPbobsCOM.Documents
Dim instmntID As SAPbobsCOM.Document_Installments
odoc = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices)
dim x ,y as integer
For x = 0 To ogrid.Rows.Count - 1
odoc.GetByKey(ogrid.DataTable.GetValue("ID Doc.", ogrid.GetDataTableRowIndex(x)))
instmntID = odoc.Installments
For y = 0 To instmntID.Count
instmntID.SetCurrentLine(y)
' ****Here returns the error*****
If instmntID.InstallmentId = ogrid.DataTable.GetValue("Num Rata", ogrid.GetDataTableRowIndex(x)) Then
If instmntID.DueDate ogrid.DataTable.GetValue("Data scad.", ogrid.GetDataTableRowIndex(x)) Then
instmntID.DueDate = ogrid.DataTable.GetValue("Data scad.", ogrid.GetDataTableRowIndex(x))
If odoc.Update() = 0 Then
End If
End If
End If
Exit For
End If
Next
Next
Sorry
User | Count |
---|---|
95 | |
11 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.