Skip to main content

Notifications

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

  • RayD Profile Picture
    239 on at
    RE: Customize Payment Entry

    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

  • Suggested answer
    Ajit Kannan Profile Picture
    1,246 on at
    RE: Customize Payment Entry

    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
    RE: Customize Payment Entry

    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

  • Ajit Kannan Profile Picture
    1,246 on at
    RE: Customize Payment Entry

    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

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >

Featured topics

Product updates

Dynamics 365 release plans