SAP Business One SDK Support

Reading the SYSTEM Variable in User Data Source string

There are many ways to read the system variable in SAP SDK. But Simplest way is to read directly from data source. based on the Variable ID



 strTotal = PForm.DataSources.UserDataSources.Item("SYS_85").ValueEx;

Remote System Login through VB Code

You can do a remote login using VB or C# code. Only few things is required; Like IP, User Name and Password



Remote Login and Copy File

'''''''''''''''Login To Remote system Share Folder '''''''''''''''''''''''
   Open_Remote_Connection(ServerIP, ServerUser, ServerPass)
                    '''''''''''''''Copy File Share Folder '''''''''''''''''''''''
''' To Copy a file please create a shared folder in the destination system with full access.   
System.IO.File.Copy(strFullFile, ServerPath + strDocentry + "_" + strCardCode.Trim() + ".xls")

Private Sub Open_Remote_Connection(ByVal strComputer As String, ByVal strUserName As String, ByVal strPassword As String)
        Try


            Dim ProcessStartInfo As New System.Diagnostics.ProcessStartInfo
            ProcessStartInfo.FileName = "net"
            ProcessStartInfo.Arguments = "use \\" & strComputer & "\c$ /USER:" & strUserName & " " & strPassword
            ProcessStartInfo.WindowStyle = ProcessWindowStyle.Hidden
            System.Diagnostics.Process.Start(ProcessStartInfo)
            System.Threading.Thread.Sleep(2000)
        Catch ex As Exception

        End Try
    End Sub

Check Tables in View \ Procedure \ SQL Job

Most of the cases, it will difficult to find where the table or column or procedure is used any where in the Procedures in the database; Below quires will help to search through the data base and find the table or procedure the keywords are used


Below query will help to check the table is used any where in View or Procedure


SELECT j.Name, s.Database_name, s.Command
FROM msdb.dbo.sysjobsteps s
INNER JOIN msdb.dbo.sysjobs j
ON s.job_id = j.job_id
WHERE s.command LIKE '%TableName%'
AND s.database_name LIKE '%DBName%'



Below query will help to check the table is used any where in SQL Job

SELECT DISTINCT so.Name
FROM syscomments sc
INNER JOIN sysobjects so ON sc.id=so.id
WHERE sc.TEXT LIKE '%OBTN%'