Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Saturday, February 22, 2025 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Architect Forums - SalesLogix Scripting & Customization
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: Opening Record from Grid, creating a temporary Group
Gareth
Posts: 1
 
Opening Record from Grid, creating a temporary GroupYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 16 Jul 13 4:42 AM
fiogf49gjkf0d

Hi all,


We have a client using SLX 7.5.2, and they recently contacted us regarding what they saw as a bug within SLX; opening an Opportunity record from the Accounts:Opportunities tab will sometimes open a record within a group containing all other Opportunities for the Account, and sometimes not.


Drilling down a little, we have found this Sub within SLX Common:


'Iterates the the grids recordset object to build a list of ID's, then creates a new group based on the list, then displays the current record

'objGrid - Grid object

'strKeyField - Name of the primary KeyField for the grid

'strPlugin - Name of the MainView plugin to be opened

'intMode - Window style the MainView will be opened with

'blnExisting - Specifies whether to open a new instance of the MainView or open an existing instance if exists

Sub OpenMainViewFromGridCrntID(objGrid, strKeyField, strPlugin, intMode, blnExisting)

    const MaxCount = 250 'ShowIDsAsLookupResult API call may fail for counts larger than this. The call creates an in clause with all of the

                         'requested ID's and at some point will be to large for the underlying db provider to handle

    Dim strIDList, strCrntID

    Dim objMainView

    Dim i

 

    If objGrid.RecordSet.RecordCount > 0 Then

       strCrntID = objGrid.GetCurrentField(strKeyField)

       If intMode = 2 Then

          Set objMainView = Application.MainViews

          For i = 0 To objMainView.Count - 1

              If objMainView.Item(i).CurrentID = strCrntID Then

                 objMainView.Item(i).BringToFront

                 Exit Sub

              End If

          Next

          Set objMainView = Application.MainViews.AddEx(strPlugin, intMode, blnExisting, 1, strCrntID, "") 'DNL

          objMainView.CaptionBarVisible = False

          objMainView.Show

       Else

          If strCrntID <> "" Then

             If objGrid.Recordset.RecordCount > MaxCount Then

                strIDList = "('" & strCrntID & "')" 'DNL   defect 1-47570

             Else

                strIDList = RemoveParenthesisFromStr(GetListFromGridByField(objGrid.Recordset, strKeyField))

            End If

             'We're passing an invalid RecordID so to avoid multiple refreshes to the mainview.

             Application.MainViews.AddEx strPlugin, intMode, blnExisting, 1, "Invalid", ""  'DNL

             Application.MainViews.ActiveView.ShowIDsAsLookupResult strIDList, strCrntID 'DNL

          End If

       End If

    End If

End Sub


The const maxCount is what I find interesting, as it seems to be in there solely to satisfy Oracle constraints when creating IN clauses; the DB provider our client uses is MSSQL 2005. Increasing this value does indeed resolve their issues, but I wanted to know what everyone else's view on this is?

[Reply][Quote]
Mike Spragg
Posts: 1226
Top 10 forum poster: 1226 posts
 
Re: Opening Record from Grid, creating a temporary GroupYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 16 Jul 13 4:59 AM

Yep, we change that all the time to remove it. Safe to do so.

[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 2/22/2025 9:28:04 AM