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;
        DialogService.ShowDialog();
    }
}

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
   Upgrading SalesLogix vs Migration to SalesLogix version 8.0
We want to get off the desktop versions and into the Cloud. I have been working with Sage and our BP alr
Posted on Jun 19, 2013 by SalesLogix Support to SalesLogix Questions & Answers
 
   Unicode data from SalesLogix not exporting from the web Crystal Report viewer to PDF correctly.
The later version of SalesLogix allow the storage of Unicode data in the database.  This allows for
Posted on Jun 07, 2013 by Kris Halsrud to Kris Halsrud's Blog
 
   Problems managing team membership in the SalesLogix web client
In the Web Client's Administration area under teams (In both v7.5x and 8.0x versions):1) When addin
Posted on Jun 03, 2013 by Kris Halsrud to Kris Halsrud's Blog
 
   Demystifying SalesLogix Web: Dashboards and Analytics Tools
Join us for a free webinar, Wednesday, May 15th at 2pm CDT. The SalesLogix Web dashboards and analytics
Posted on May 08, 2013 by Brianna Tinjum to The Inbox
 
   How can I make sure I am logging into the correct SalesLogix web client database?
I just recently did a updated conversion of our production database (which is 6.2x) and I'm trying to
Posted on Apr 15, 2013 by SalesLogix Support to SalesLogix Questions & Answers
 
Comments

 

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?

Thanks!

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

Leave a Comment

(required)  
(optional)
(required)  
Add
All contents Copyright © 2013 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