I am trying to customize payment entry such that when refnbr is entered the custid will populate automatically.
this is my code
Private Sub crefnbr_Chk(ChkStrg As String, retval As Integer)
Dim bARD, SqlStr$
Dim bCust As String * 15
SqlStr = " select CustId from ARDoc ARD where Docbal <> 0 and Refnbr = @Ref1 "
Call sql(c1, SqlStr)
Call SqlSubst(c1, "Ref1", ChkStrg)
Call SqlExec(c1)
serr1 = SFetch1(c1, bARD, LenB(bARD))
If serr1 = 0 Then
bCust = bARD.CustId
Else: bCust = ""
End If
Call setprop("ccustId", "Text", bCust)
End Sub
My problem is sfetch1 generates error - expression precbuff and viewlen > 0
Help appreciated
RayD
*This post is locked for comments
Ajit
Thanks
for the suggestion, however, forced to abandoned customize and concentrate on building new screen.
Should be able to test code on new screen shortly
RayD
Hi RayD,
Try this below code
Private Sub crefnbr_Chk(ChkStrg As String, retval As Integer)
Dim strqry As String
Dim csr_Temp As Integer
Dim custid As String
strqry = "select * from ardoc where Docbal <> 0 and Refnbr = " & SParm(ChkStrg)
serr1 = SqlFetch1(csr_Temp, strqry, bARDoc, LenB(bARDoc))
If serr1 = 0 Then
custid = Trim(bARDoc.custid)
Call SetObjectValue("ccustid", custid)
Call DispFields("form1", "ccustid")
End If
Call SqlFree(csr_Temp)
End Sub
Thanks,
Ajit kannan S R
we have a large customer/group who require invoices be made directly to each dept / sub dept.
However, when payment is made they issue one cheque quoting refnbr only.
I am experimenting with this screen by trying to enter refnbr for invoice and have system return the proper custid.
Once I figure out the rules I plan on building a new screen that will allow the AR Clerk to enter payments just by entering the refnbr and amount of payment. It could save an hours work on one payment.
RayD
Hi RayD,
In SL standard, enter the existing refnbr the system message will pop up
Can I know why you want this customization for this payment screen?
Thanks,
Ajit Kannan S R
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