Community
Showing results for 
Search instead for 
Do you mean 
Reply

Dynamic Label Control - Contact view

Nickel Elite Contributor
Posts: 937
Country: USA

Dynamic Label Control - Contact view

[ Edited ]

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.

Message Edited by alduet on 05-28-2010 10:57 AM
Astute Commentator
Posts: 27
Country: United States

Re: Dynamic Label Control - Contact view

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.

 

Many thanks!

Nickel Elite Contributor
Posts: 937
Country: USA

Re: Dynamic Label Control - Contact view

[ Edited ]

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.Plugin.Config.dll” file to the
The “Add-on Manager” is an ACT! add-on (plugin) that lets you easily
enable or disable installed add-ons (plugins).
p py g g
“Plugins’ Subdirectory under the ACT!
Program Files location (This is normally:
C:\Program Files\ACT! for Windows\Plugins

 

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.

 

 

 

 

 

 

Bronze Elite Contributor
Posts: 2,115
Country: United_Kingdom

Re: Dynamic Label Control - Contact view

Hi Alan,

 

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:

 

 

  • my implementation of the FieldDescriptor property  
  • the instantiation of a MutableEntityFieldDescriptorPickerForm
In addition have you been able to make any progress in finding out the Entity context that the control is being applied in? I had thought of initially a very ugly method of reflecting the file extension but that doesn't seem correct to me since it would not work on a 'new layout' (if that makes any sense!).
TIA

 

Vivek Gargav
Caldere Associates Ltd.
www.caldere.com
vgargav@caldere.com
My Blog
Nickel Elite Contributor
Posts: 937
Country: USA

Re: Dynamic Label Control - Contact view

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!:

 

http://community.act.com/t5/Sage-ACT-Developer-Downloads/SMS-Control-sample-code/td-p/72872

 

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...  

Nickel Elite Contributor
Posts: 937
Country: USA

Re: Dynamic Label Control - Contact view

Here's an update to this control which adds another property:

Show_when_positive

 

This allows for some interesting abilities to hide fields behind this label depending on field values to provide some very basic dynamic layout experiences.

 

 

Copper Contributor
Posts: 12
Country: Australia

Re: Dynamic Label Control - Contact view

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.

Nickel Elite Contributor
Posts: 937
Country: USA

Re: Dynamic Label Control - Contact view

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.  

Copper Contributor
Posts: 12
Country: Australia

Re: Dynamic Label Control - Contact view

Thank you Allen, I look forward to being able to incorperate this in our setup as soon as posted.
Nickel Elite Contributor
Posts: 937
Country: USA

Re: Dynamic Label Control - Contact view

Here's the Company Dynamic Label Control - same as Contact one, but works on Company records.