Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Reply
Gold Super Contributor
Posts: 3,087
Registered: ‎03-19-2009

Day Zero BUG - Contact Attachment - First happened in Jan 2008 - is in ALL versions including 8.1

Scenario:

      a - v7.5.4 WIndows/LAN system w/several Remote Users - system has been in place since 

      b - NO Customs in or related to ANY of the Attachment Forms/scripts including any/all related VBScript Include files

 

Specific Error:

      When a user clicks on the Attachment Tab in the Contact MainView an error is thrown. We have seen one (or both) of the following depending on a combination of things:

    A - An error occurred when executing active form script (Contact:Attachments).

          Error in include script (SYSTEMSmiley FrustratedLX_COMMON): Item cannot be found

          in the collection corresponding to the requested name or ordinal. at

          line 481, char 12.

    B - Error in IDispatch.Invoke(): 0x80020101

 

What was causing the problem:

  It turns out this is a "variable" issue - specifically in the VBscript include file SYSTEM:ATTACHMENT SUPPORT in the OnFormOpen Sub. When this code was (initially) modified back in version 7.0 HF3 to deal with issues related to (remote) attachment support - the variable "strSQL" was NOT declared locally (no DIm strSQL) in the subroutine. It turns out the script also has three include scripts. One of them being SystemSmiley FrustratedLX Database Support (first one). Within this script (and "global" to the script) is a "dim strSQL". It was there in the original 7.0 NOT for Attachment SUpport but for SLX_DB (vbscript) class!

 

Does this error happen on all SLX systems - NO.. it does not. I could not replicate it in my test/dev VM. However, it happens with significant consistancy at the customer site on the server as well as their Windows 7 (32 bit) systems.

 

How to Fix:

     In SYSTEM:ATTACHMENT SUPPORT VbScript:

  Was:

Sub OnFormOpen
    Dim strSiteCode
    Dim col

    InitSec
    Set col = grdAttach.Columns.Item("A2_STATUS") 'DNL
    If Not (col Is Nothing) Then
       col.Visible = Not gBlnHostDB
       Set col = Nothing
    End If

    strSiteCode = Trim(GetField("PrimarySite", "UserSecurity", "UserID=" & AddSingleQuotesToString(Application.BasicFunctions.CurrentUserID)))
    strSQL = grdAttach.SQL
    strSQL = Replace(strSQL, "ON (A1.ATTACHID=A2.ATTACHID)", _
                             "ON (A1.ATTACHID=A2.ATTACHID) AND (A2.SITECODE='" & strSiteCode & "')")

    if grdAttach.BindID = "" Then
      'we do not want to hit the DB with an empty id (and get back a gazilliob records), but we do need
      'to modify the SQL to include a join on SITECODE
      grdAttach.BindID = "INVALID_ID"  'DNL
    End If

    grdAttach.SQL = strSQL
End Sub

 

  Now:

Sub OnFormOpen
    Dim strSiteCode
    Dim col
    Dim strSQL   '

 

--
RJ Ledger - rjledger@rjlSystems.net +1 603.369.3047 x101

".. Innovators in Mobility - Experts in Workflow Automation..."
http://www.rjlSystems.net - blog: www.rjlSystems.net/blog.html
Silver Super Contributor
Posts: 801
Registered: ‎03-24-2009

Re: Day Zero BUG - Contact Attachment - First happened in Jan 2008 - is in ALL versions including 8.1

Yep, found that about a month ago (customer in Netherlands had it).
Another one to watch (in 8.1 too) is contact:tickets - looks for If Recordset is nothing - as opposed to If Not Recordset - in other words, only works opposite to expected.
Gold Super Contributor
Posts: 3,087
Registered: ‎03-19-2009

Re: Day Zero BUG - Contact Attachment - First happened in Jan 2008 - is in ALL versions including 8.1

Yep.. know about the Contact:Tickets.. ;-)

 

Of course there's the bug w/the Attachments having a name that's too long. Documents will xfer accross on synch but never
move" to their final destination on either the main db nor teh remote(s) . Unfortunately there's no good way to fix that one :-(

--
RJ Ledger - rjledger@rjlSystems.net +1 603.369.3047 x101

".. Innovators in Mobility - Experts in Workflow Automation..."
http://www.rjlSystems.net - blog: www.rjlSystems.net/blog.html