web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics SL (Archived)

Customize Payment Entry

(0) ShareShare
ReportReport
Posted on by 239

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

I have the same question (0)
  • Ajit Kannan Profile Picture
    1,246 on at

    Hi RayD,

    In SL standard, enter the existing refnbr the system message will pop up 

    temp.png

    Can I know why you want this customization for this payment screen?

    Thanks,

    Ajit Kannan S R

  • RayD Profile Picture
    239 on at

    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

  • Suggested answer
    Ajit Kannan Profile Picture
    1,246 on at

    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

  • RayD Profile Picture
    239 on at

    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics SL (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans