Login / Register  search  syndication  about

          Kris Halsrud's Blog

Kris Halsrud on development and Integration with CRM and Development

Getting around how the Address control’s Edit form is not editable in the SalesLogix Web Client

The Address control that is found on the Account and Contact detail forms in the SalesLogix web client is a custom composite control.  One of the features this gives you is an edit dialog to update the address fields. This is invoked when you click the Pencil Icon that is also part of the composite control:

Edit Address Dialog in Standard SalesLogix Address Control


Unfortunately this edit dialog, as well as most other attributes of the Address control are contained in a compiled Sage Web Control assembly and are not customizable.  The SalesLogix web client does have an OOTB edit address screen, that is invoked from the Address tab at the Account and Contact level.

Edit Address Quick Form in Standard SalesLogix



If you need to change the default address edit dialog (like if you have added a custom address field, or want some custom validations, etc) it would sure be nice to do this.  How can you though when the edit address dialog of the Address control is not customizable?  Well a little creativity is all you need.  lets take a look at how to do this.

Step 1- Add a custom load action

On the main detail quick form, add a C# Snippet Action Item to Page Load of the quickform (Make sure On Repaint Event of the code is set to True)

Address.ReadOnly = true;
Address_lbl.ForeColor = System.Drawing.Color.Blue;
Address_lbl.Style["text-decoration"] = "underline;";
Address_lbl.Text = "Edit Address";
Address_lbl.ToolTip = "Click to Edit Address";
Address_lbl.Attributes.Add("onclick", "var btn= document.getElementById('" + btnEditAddress.ClientID + "'); if(btn) btn.click();"); 
btnEditAddress.Style["Display"] = "none";

What this code is doing is setting the address control (Named Address) to be read only.  This will eliminate the pencil icon to prevent the wrong edit screen from opening.  Next we are changing the label of the address control (rendered as the control name + “_lbl”).  We are making the label appear like a hyperlink with the text “Edit Address”. Finally we are adding a client side event to the click action.  This client side action is looking for a button on our form (we have not added it yet) and then is invoking its client side action, which will in turn execute the server side action of the same button (we will add that later too).

Step 2- Add our custom button with a server side click action

I normally will add this button to the toolbar area of the quickform just so it is out of the way and less likely to be removed by somebody who sees the button on the form and does not know what it is.  The important bits about adding the button are as follows:


  • ControlID: btnEditAddress
  • Caption: Do Not Delete
  • On the Click Action, add a new C# Snippet Action Item with the following code (this is for the contact view, you would need to change the first line for another entity):

Sage.Entity.Interfaces.IContact con = this.BindingSource.Current as Sage.Entity.Interfaces.IContact;

if(con != null && con.Address!=null)
    string Id = con.Address.Id.ToString();
    if (DialogService != null)
        DialogService.SetSpecs(200, 200, 318, 600, "AddEditAddress", "", true);
        DialogService.EntityType = typeof(Sage.Entity.Interfaces.IAddress);
        DialogService.EntityID = Id;

This code will be called after our client side code runs we added in step 1.  The tricky thing here is we are invoking the edit address quick form which is already on the standard Account and Contact pages because it is used by the Address tab.

Here is what our deployed details page looks like after these changes:

Custom Edit Address on SalesLogix detail Quick Form



And clicking the label opens the Edit Address Quick Form:

Edit Address Quick Form in Standard SalesLogix



What's This?
Bookmark and Share

About Kris Halsrud

   Kris Halsrud is a Senior Analyst / Developer for Customer FX Corporation.

Related Content
   Can I Bind an Attachment to a Specific Activity in Infor CRM version 7.54?
Recently I had a user ask if they could bind an attachment to a specific Activity within Infor CRM??
Posted on Jul 07, 2015 by Dale Richter to Infor CRM Questions & Answers
   Infor CRM (Formerly Saleslogix) Iterating through all tabs on a Page
 Using the TabWorskpace you can iterate through all the tabs on a page and do something with them, l
Posted on Jun 19, 2015 by Kris Halsrud to Kris Halsrud's Blog
   Infor CRM (Formerly Saleslogix) Hiding Tabs at Runtime Without Using Modules
 As Ryan wrote a long time ago, you can create a module and add it to a page in the Infor CRM web cl
Posted on Jun 10, 2015 by Kris Halsrud to Kris Halsrud's Blog
   How I assign ownership to a group of Leads in Infor CRM?
There is a tool within Infor CRM to align Accounts to different Account Owners. It is called Territory Re
Posted on Jun 05, 2015 by Dale Richter to Infor CRM Questions & Answers
   Infor CRM (Formerly Saleslogix) Adding a Client Side Confirmation on a Dependency Lookup in the Web Client
 We recently had a client who wanted to have a user confirmation prompt before a user was allowed to
Posted on May 28, 2015 by Kris Halsrud to Kris Halsrud's Blog


Adam R. said:

Thank you very much for this post.. I was able to get the alternate form working for both the account detail and the contact detail. However, I also need to do the Add Account / Contact new address forms.. It looks like the smart part is an ASP page and not an editable form.. any tips on this?


October 19, 2012 12:04 PM

Kris Halsrud said:

Adam even though the add contact form is a custom smart part the same steps still apply.  If you look at how the account and contact smartparts are deployed to your web site you can see the code equivalent of what you have done following this post.

If you duplicate those same results in the custom smart part for add contact account, you will have the same functionality.

October 19, 2012 1:31 PM

Sonal said:

I am applying this customization to a custom form but how do I set the repaint event through code.

Right now the functionality works but my pencil still shows next to the composite address control.

Any help would be truly appreciated.


December 5, 2013 11:22 AM

Kris Halsrud said:

Sonal, You need to set the address control's readonly property to true on the page load event:

Address.ReadOnly = true;

December 5, 2013 12:05 PM

Rich Eaton said:

Kris, Great help here. Seems that the onclick event of the label now doesn't fire.. I am trying to use this on the insertContact custom form.. any idea..?

February 5, 2014 10:42 AM

Rich Eaton said:

Well managed to get the label to fire, however on the insert contact/account screen I am getting error because there is no Address.Id created yet. How do we go about calling the dialog w/o the id associated?

February 19, 2014 7:58 AM

Rich Eaton said:

Has anyone gotten this to work in the Insert Contact/Account form..?

February 19, 2014 7:59 AM

Kris Halsrud said:

Yes, it is a bit more involved in getting it to work on the insert form.  The process for launching the dialog is the same (minus passing the address id, as it does not exist) but what we do is to pass a dialog parameter to the edit address screen to say it is an edit to an address for a record not yet created.  On the save click on the edit address screen we check to see if the dialog has that parameter and then if so we dont do the normal save event but instead, based on if it was a contact or account address being invoked set the properties through the relation ship (i.e. contact.Account.Address.Address1 = txtAddress1.Text).  You also then need to add a load event to the edit address screen to see if the dialog was launched from there and if so set the controls to the values stored in the address (i.e. txtAddress1.Text = contact.Account.Address.Address1)

February 19, 2014 8:54 AM

Kris Halsrud said:

Rich, I am writing up detailed instructions on the insert account/contact functionality.  Expect it next week!

February 19, 2014 11:04 AM

Lee H said:

Has anyone implemented this for Leads? It appears Lead addresses are stored differently so I can't seem to get the edit address screen to show the address when it pops up.

March 26, 2015 5:40 AM

Kris Halsrud said:

Lee, you are correct.  The same approach could be used but you would need to build your own edit lead address screen since one does not exist yet.  

March 26, 2015 8:11 AM

Leave a Comment

All contents Copyright © 2015 Customer FX Corporation
Customer FX Corporation
2324 University Avenue West, Suite 115
Saint Paul, Minnesota 55114
Tel: 800.728.5783

  Follow @CustomerFX on twitter
Follow the best news, tips, and articles
  Subscribe to Customer FX on youtube
Watch SalesLogix tutorial videos from Customer FX
Login / Register