Microsoft Dynamics Forums Homepage

Forum Home Forum Home > Microsoft Dynamics SL (Solomon) > SL - Customization and Integration
  New Posts New Posts RSS Feed - Code to Prevent Duplication
  FAQ FAQ  Forum Search   Register Register  Login Login

Code to Prevent Duplication

 Post Reply Post Reply
LisaA View Drop Down Member Member

Joined: April 20 2018
Location: Caribbean
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote LisaA Quote  Post ReplyReply Direct Link To This Post Topic: Code to Prevent Duplication
    Posted: April 20 2018 at 5:03am

Hi, I am relatively new to doing customizations in Dynamics SL and I am attempting to prevent the user from putting in a duplicated customer PO in the sales order screen for Dynamics SL. However after putting in the code, I am getting an error message that the VBA could not be compiled for execution.

I know something is wrong with the code but I cannot figure it out so I will be greatly appreciative is someone could tell me what I am doing wrong. I have pasted the code that I have on the screen so far. Thanks so much in advance

Private Sub ccustordnbr_0_Chk(ChkStrg As String, retval As Integer)

Dim SqlStr As String

SqlStr = "Select custordnbr from soheader where custid = " + SParm(sivMyApp.Controls("Ccustid_0").value)
SqlStr = SqlStr + " and custordnbr = " + SParm(ChkStrg)

serr1 = SqlFetch1(c1, SqlStr, bcustordnbr, LenB(bcustordnbr))
    If serr1 <> NOTFOUND Then
        Call MsgBox(" PO number has already been entered for this customer. Please re-enter or cancel document.", vbOKOnly, "ERROR")
        retval = ErrNoMess
    End If

End Sub

Back to Top
Sponsored Links

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Copyright 2013 All rights reserved. is an independent non-Microsoft website.
Email: contact AT microsoftdynamicsforums DOT com