05-28-2010 10:55 AM - edited 05-28-2010 10:57 AM
Here is the Dynamic Label Control for ACT! 2010 or above.
This control lets you pick a Contact Field and a value for this field to test for. When the value tests true it will display in the Font/color you select, when it tests false it uses either - the font/color you chose or it does not display (set Show_on_negative to False).
The control only works for Contact Entity at the moment - it wouldn't be hard to recompile for Opportunity/Groups and Companies, but I'll await feedback before taking time to make a control for each entity.
This control is pretty basic, source code will be posted in separate thread for anyone looking to change/improve upon it.
To install just unzip to your Tools folder and restart ACT! - then add this like you do a custom control and place it on the Contact detail form - you'll need to right mouse button on the control or hit F4 to get the properties view in the Layout editor (at which point you have the config options).
Let me know what you think.
08-17-2010 05:28 AM
I was forwarded to this link regarding my inquiry on color coding fields. I'm not a really technical person so if you could please confirm that this feature will allow a field to be changed via drop down menu from one color to another depending on which color denotes a particular status. The specific application is for color coding a field depending on if a client is delinquent with tech support fees.
Could you please explain how to complete the following that you noted? "...add this like you do a custom control and place it on the Contact detail form - you'll need to right mouse button on the control or hit F4 to get the properties view in the Layout editor (at which point you have the config options)."
I'm not certain how to add like a custom control.
I am familiar with working with layouts and customizing them in a basic manner.
08-17-2010 07:40 AM - edited 08-17-2010 07:45 AM
This control tests the value of a contact field you specify then renders the value in the font size and color you choose for the control. This is great for letting users know a contact record has outstanding fees, or is a key customer etc...
If you look at the link above titled: Dynamic Label Runtime example.JPG 214 KB
The record in the background has a label showing the ID/Status value of Customer in big Red(ish) Font, while all other values are smaller in blue (the foreground record with employee value).
If this is what you're looking for great! follow the steps below to use the control. A Note - this control works in ACT! 2010, if you have an older version of ACT! - let me know the version and I can recreate the control for older versions.
Step 1: Copy “Act.DevNet.DynamicControl.dll” file to “Tools’ Subdirectory under the ACT!Program Files location (This is normally:C:\Program Files\ACT! for Windows\Tools"). The file is zipped in the above download - you need to unzip it and copy to the Tools folder.
Step 2: Restart ACT! (or open it) and go to the Contact Layout Designer view.
Step 3: In the Toolbox on the left side of the screen select the item named Custom. You may not have any available items in the custom toolbox if you have never added a custom control before. Right mouse button click in the Custom toolbox and select Customize... In the Customize Toolbox check the DynamicLabelControl item. Select OK.
Step 4: In the Custom Toolbox pane now you should see a Dynamic Label Control - select it and place it on your contact view (like a normal control).
Step 5: Go to the View Menu (at the top of the screen) and select "Properties Window". If the label control is still highlighted the Properties window will display the properties of this custom control.
Step 6: Scroll down the properties Window for the Dynamic Label Control to the section marked Misc: Fill in the following Properties:
field: This is the name of the contact field you want to test (e.g. City)
value: This is the value within that field you want to test for (e.g. Boston)
negative_color: The color you want the value to display as when the tests are negative (any city value except Boston)
negative_ContentFont: The Font you want the value displayed in when the tests are negative
Positive_color: Color for value when test are positive (when Boston is the city)
positive_ContentFont: Font for value when positive
show_when_negative: If you don't want the label to show anything if the tests are negative set to False (it'll only display when Boston is the city)
Step 7: Save the display.
optional Step 8: Once you design the layout you'll need to sent the .dll file to any ACT! users and have them copy it to their Tools directory - once they do the layout will work fine for them.
A couple of notes - you have to hand type the name of the field for the field property - if you have a question about the field name just look at any field control that has that field setting and use that name.
Let me know if you have any questions or you'd like to see some alternate behavior - thanks for asking about this control.
09-28-2010 02:33 PM
I was wondering if it might be possible for you post up an example of how to bind a control so that we can write back to the dB. Looking through the SDK and your example I can see that the IContactFieldBoundControl interface is now Obsolete and we should be using the IMutableEntityFieldBoundControl interface but my attempts to date have failed I think mainly down to:
09-28-2010 09:17 PM
Most of my examples use the IMutableEntityListBoundControl interface which is what I think you'll want to use to create a control that is aware of the currently displayed entity record and able to manipulate this entity as a read/write control.
Here's an example source for a control which is a collection of multiple controls and writes back to ACT!:
As a write back mechanism on a custom text box control I had always considered just adding an event to the control (like exit of the control) which grabbed currentEntityrecord and set the property of the field I wanted that control bound to then saving the entity object (this would also force a save of the record at that point, but no real harm there).
Good question on the entity context so that a custom control could be entity agnostic - I haven't done much digging in that direction for some time now, but I've always suspected that one way to do this would just be to add a public property to the control which could be set at design time. You always end up casting the mutableentitylist into some actual entity list in code at some point ala:
ContactList cl = (ContactList)dataSource.MutableEntityList;
so in theory you'd just be swapping out the datatype you're casting to in this one spot and you're on your way...
The issue, of course, is when you have other code which attempts to enumerate fields of the entity which is hard coded.
For the example you ask for in the top part of the request I can see a text control with the following properties -
EntityType - pick the entity you are binding to
FieldBound - Pick the field name of the entity you are binding to.
In theory you should be able to enumerate both the Entitytypes and the Fields of each entitytype dynamically at design time, but I suspect it would be easier to just hard code values for Contact, Company, and Opportunity in the Entitytype property
I'm happy to help advance some code in this direction if you have a specific use scenario you're looking for. Right now I have two other example requests on my plate - 1. A SmartTask action which opens a .exe, .doc.html etcc (shellEx) as an action and 2. A generic Button control which can be configured to do an action in ACT! - e.g. run a specific report, launch a specific Smart Task etc...
09-30-2010 05:29 PM
Here's an update to this control which adds another property:
This allows for some interesting abilities to hide fields behind this label depending on field values to provide some very basic dynamic layout experiences.
06-16-2011 09:09 PM
I love it.... We are using this now to make important information JUMP OUT at the users. I was just wondering if it would be possible to get this working for Company view also, as this would be the answer to a few of my prayers.
Also, would I was wondering if it may be worthwhile looking into "Conditional Formatting"as such, for fields, simply applying a background color change, or font color change to the field in the layout, if certain criteria is met. E.G.. If PAYMENT TERMS=PREPAID then highlight field with red background.
06-16-2011 10:39 PM
Company view = no problem. I'll recompile for Company view in the next week and post here. It's a little more challenging doing this for fields you want to edit as that take bit more code, but turning this into a read only style field control is pretty easy.