Using Customization Manager, I have added following code on 40.100.00 screen in Update1_OnUpdate subroutine to add/update record to the underlying custom table:
Dim CpnyId As String, OrdNbr As String, line As String, csr_XLeeTB as Integer
Dim intFetch As Integer, strSql As String
Call GetBufferValue("bpes.cpnyid", CpnyId)
OrdNbr = GetObjectValue("cordnbr_0")
Call GetBufferValue("bsoline.lineref", line)
strSql = "select * from XLeeTB_CostSalesExt where CpnyID = " + SParm(CpnyId) + " and Module = " + SParm("OM") + " and ModDocNbr = " + SParm(OrdNbr) + " and LineRef = " + SParm(line)
Call SqlCursorEx(csr_XLeeTB, NOLEVEL, "csr_XLeeTB", "XLeeTB_CostSalesExt", "XLeeTB_CostSalesExt")
intFetch = SqlFetch1(csr_XLeeTB, strSql, bXLeeTB_CostSalesExt, LenB(nXLeeTB_CostSalesExt))
....
fill up bXLeeTB_CostSalesExt record here
....
If intFetch = NOTFOUND Then
Call SInsert1(csr_XLeeTB, "csr_XLeeTB", bXLeeTB_CostSalesExt, LenB(nXLeeTB_CostSalesExt))
Else
Call SUpdate1(csr_XLeeTB, "csr_XLeeTB", bXLeeTB_CostSalesExt, LenB(nXLeeTB_CostSalesExt))
End If
Call SqlFree(csr_XLeeTB)
I keep getting the above error (as stated in the subject line) when it hits the SInsert1 statement. Anyone experienced this issue? What does error indicate and what is missing in the above code?
Any help/suggestions/pointers are greatly appreciated.
Thanks in advance.
Nayan
*This post is locked for comments