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!
|
|
Creating a filter to hide certain notes from notes/history
Posted: 30 Jan 14 4:29 AM
|
Hi All
I'm trying to create a filter to hide certain notes from "notes-history" pane in the form of a tickbox, I've noticed that there already is a "Filter Options >>" button which can show or hide the tickbox ribbon. When I search through the plugin manager to find this tickbox ribbon form I can't find it anywhere! I can find the "notes-history" form no problem, what I have also found is a script called "notes history common" which does seem to have a list of tickbox labels that match the labels in the tickbox ribbon.
(Below is the code snippet that lead me to believe I'm in the right place)
'Set the Filters: label If (chkMyHistory.Text = "T") or _ (chkUser.Text = "T") or _ (chkDateRange.Text = "T") or _ (chkWithinLast.Text = "T") or _ (chkActivityType.Text = "T") or _ (chkHideDBChanges.Text = "T") Then cmdOptionsFull.Visible = True cmdOptionsEmpty.Visible = False Else 'No filter options are turned on cmdOptionsFull.Visible = False cmdOptionsEmpty.Visible = True End If
So I need advice on the script itself as I think I've found where it should go!
Regards
Gazz |
|
|
|
Re: Creating a filter to hide certain notes from notes/history
Posted: 30 Jan 14 4:43 AM
|
There's no "ribbon". It's basically a panel. If you click the panel that surrounds the control you can drag it down.... !
Also, if you look at the code behind the Filter button you can see it does this on the fly..
Sub OptionsClick(Sender) If right(Sender.Caption,2) = ">>" Then 'DNL pnlFilterOptions.Height = Application.Environment.PixelsPerInch * 84/96 '84 Changed this for 120 DPI cmdOptionsEmpty.Caption = Application.Translator.Localize("Filter Options <<") cmdOptionsFull.Caption = Application.Translator.Localize("Filter Options <<") Else pnlFilterOptions.Height = Application.Environment.PixelsPerInch * 30/96 '30 Changed this for 120 DPI cmdOptionsEmpty.Caption = Application.Translator.Localize("Filter Options >>") cmdOptionsFull.Caption = Application.Translator.Localize("Filter Options >>") End If End Sub
That is, extends or shortens height of panel for the ribbon. |
|
|
|
Re: Creating a filter to hide certain notes from notes/history
Posted: 31 Jan 14 7:18 AM
|
Hi Mike
I clicked on "Filter Options >>" to reveal the 'Panel' but it doesn’t move for me, but this isn’t an issue as I don’t need to be able to drag/move it. I only need to be able to add another tickbox to it, then when I tick the tickbox I want it to hide only the notes that have the username 'SF' but leave all other notes visible if that makes sense!
Regards |
|
|
|
Re: Creating a filter to hide certain notes from notes/history
Posted: 31 Jan 14 8:38 AM
|
No, it won't move in Architect. Press it in saleslogix.exe and you'll notice it expands (gets height = larger). In architect you grab the container panel (pnlFilterOptions) that surrounds the whole set of controls - you'll notice a bottom grab handle. Holding down the left mouse you can drag it downwards and it will then expand (or you can go to the panel pnlFilterOptions props and set the height from, say, 30 to 150, same thing). |
|
|
|
Re: Creating a filter to hide certain notes from notes/history
Posted: 03 Feb 14 5:11 AM
|
I can see what you mean, thanks for pointing that out. I now need to figure out how to filter out all note/history records where username = SF. Not sure where to start so I'll look for a script that does something similar then adapt to suit.
P.S I'm always open to good advice if anyone has any.
Regards |
|
|
|
Re: Creating a filter to hide certain notes from notes/history
Posted: 04 Feb 14 5:34 AM
|
When you say "create a filter to hide certain notes from "notes-history" are you trying to hide say notes about meetings..? and who are you trying to hide them from..? are they hidden from all users but visible to the Account Manager ? a Team ?
if it is to be seen say by either a role.. aka manager or a team you could use the seccodeid or a role to check if that note should be displayed in the actual query..
Where Seccodeid = "teamid"
Where User.Role = "role"
Not sure to what extent to trying to hide |
|
|
| |
| |
|
Re: Creating a filter to hide certain notes from notes/history
Posted: 05 Feb 14 1:56 AM
|
Gazz - it's really quite simple once you get the hang of it !
Add your checkbox - in the OnClick event set the value to
CheckBoxChange You'll notice this common to every History view. If you double-click, you'll see it goes and calls CommonCheckBoxChange which is an include script.
Open the script "Notes-History Common" script
In here locate
CommonCheckBoxChange
Just before the For i = 0 To grdHistory.Columns.Count - 1 add the following, following same example as SLX:
If chkMyControl.Text = "T" Then<br /> strGridSQL = strGridSQL & " AND (myCol <> 'XYZ') " 'DNL End If
Where chkMyControl is the name of your control. Add the SQL you wish to apply.
That's it. It'll now work - however, you'll need to add a dummy control of same name (chkMyControl) to each form (Account, Contact, Opportunity) - as this script is shared. You can just hide it on the ones you don't need it for. |
|
|
|
Re: Creating a filter to hide certain notes from notes/history
Posted: 05 Feb 14 5:05 AM
|
Hi Mike
I followed your steps, added my SQL and it works!!!
Thanks for the advice, I will have a better idea of what to do next time I'm asked to do this kind of work.
I also added 'dummies' to the Accounts form, Lead form & Opportunity form as these seem to be the only forms that have a notes/history tab. The notes/history tab in Accounts works fine but I'm getting a blank history grid for Lead and Opportunity, no errors though!
I've checked to see if I done something in Accounts that I didnt do in Lead & Opportunity but cant find anything.
Regards |
|
|
| |
|
Re: Creating a filter to hide certain notes from notes/history
Posted: 05 Feb 14 5:36 AM
|
My mistake, I did add dummy objects to main forms... now fixed and working fine on all forms.
Thanks for all your advice Mike, starting to like slx but I'm still very much a beginner.
You can consider this case closed
Regards |
|
|
|
Re: Creating a filter to hide certain notes from notes/history
Posted: 05 Feb 14 5:45 AM
|
Good news (again). After a small amount of time - you'll get used to it and it's actually very easy (and powerful) as you can do pretty much anything you want etc.
If you are modifying existing forms - then you just need to beware of code-reuse. This comes via Include Scripts and the use of common functions (which you need to be aware of of course). However, in your case (if you'd have needed it) you could have made 1 change and affected 3 forms simulaneously which is great for not needing to make 3 changes of course. |
|
|
| |
| |
| |
| |
|