Skip to main content

Notifications

Microsoft Dynamics SL (Archived)

Customize Payment Entry

Posted on by 235

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
    RayD 235 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
    Ajit Kannan 1,240 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
    RayD 235 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
    Ajit Kannan 1,240 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans