Login / Register  search  syndication  about

          Jason Buss' Blog

Jason Buss on SalesLogix development & customization, SQL, and more.

Modifying the Insert Contact/Account view in the SalesLogix Web client

Most of the time, it is a simple process to add or subtract fields from views in SalesLogix, but on occasion, it is necessary to perform those changes by modifying custom smartparts rather than making changes directly to a view.  A good example of this in the Insert Contact/Account screen in the web client.

If you're not familiar with ASP or C#, this can be a little intimidating, but hopefully this post will show the areas you need to modify when making changes to the custom smart part.

First of all, you need to find the custom smartpart.  The easiest way to do this is to look at the Project Explorer in Application Architect.  Expand the Portal manager, Sage SalesLogix, and Pages.  Scroll down to the Insert Contact/Account page and double-click on it.  This will open the page, and show all the smart parts used.

 

 

We're interested in the InsertContact custom smart part, so highlight that and click the Edit button. 

 

 

 

As you can see, this is all code.  If you've worked with ASP before, this should be pretty easy to navigate.  If not, you'll have to do some looking around to find what it is you want to change.  Say for example, you wanted to remove the standard "Business Description" field from this form.  You should find ASP code referring to the the control on the form.  You can then comment out or remove that code entirely.

 

 

Here you can see the code defining the Business Description field along with the code defining the Account Fax field.  The placement of these fields is accomplished by using the standard <td> (cell) and <tr> (row) tags that are used in HTML.  You'll want to keep these tags in mind when removing fields, otherwise you might mess up your layout of the screen.  For removing business Description, you'd want to remove everything including the <td> tags, but leave the closing </tr> tag in place.

After removing the control, you'll want to run a search of the code to remove any reference to the "txtAccountBusinessDescription" control.  Otherwise errors could be thrown when trying to reference a control that no longer exists.

For adding a new control, there are a couple other code items you will need to have in place to control things like control behavior, data bindings, etc...   For this example, we're going to replace the Business Description field we just removed with the Division field in the Account Table.

 The first step you'll want to take is to add the binding code for the new field.  If you scroll down a ways, you'll find the code change from ASP to C#. (Look for the line that reads "<script runat="server" type="text/C#">"  Everything below this line is the C# code.

Find the function named  IsAccountBinding.  This function indicates that the field we are binding is an account level field.  Within the case statement in this function, we'll want to add a reference to the Division field like this:

            case "Account.Division":
                return true;

 This can be added anywhere in the case statement BEFORE the case else at the end.

 The next function in the script is named OnAddEntityBindings().  This is where the actual binding takes place.  Within this code, you'll need to add a line binding the Division field to a new text control we'll call "txtDivision".

 BindingSource.Bindings.Add(new WebEntityBinding("Account.Division", txtDivision, "Text"));

 Next, add a reference to the new control in the function Named "lueUseExistingAccount_ChangeAction".  This function just disables the account controls on the form and uses the values from the selected account to set certain contact fields.  We'll just need to add a line to disable our new control.

 ownAccountOwner.Enabled = false;

 Next, on the LoadView() method, you'll need to add a reference to the control in the area where the other account level controls are referenced.  It's within the If statement looking to see if account != null.

 txtDivision.Enabled = changeEnable;

 That is all the changes we need to make in terms of the C# code, however we haven't yet placed the control itself of the form.

We can replace the code defining Business Description with the code for our new control (everything including the <td> tags:

          <td>  
            <span class="lbl"><asp:Label ID="txtDivision_lz" AssociatedControlID="txtDivision" runat="server" Text="Division"></asp:Label></span>
            <span class="textcontrol"><asp:TextBox runat="server" ID="txtDivision"  /></span>
        </td>

 And that is all there is to it!  We now have a brand new Division field on the Insert Contact/Account view in the web client.

 

What's This?
  
Bookmark and Share

About Jason Buss

   Jason is a senior application developer with Customer FX.



Related Content
   Debugging Custom Assemblies Using Visual Studio
Developing for Saleslogix web using external assemblies provides you with a lot of freedom when developin
Posted on Jun 10, 2014 by Jason Buss to Jason Buss' Blog
 
   Installing a Saleslogix Web Bundle
I realized that we didn't have any sort of simple write up of how to install a Saleslogix web bundle,
Posted on May 08, 2014 by Jason Buss to Jason Buss' Blog
 
   Setting the Defaults on the Insert Account/Contact Duplicate Record View
When creating a new Account/Contact record in Saleslogix web, you have the ability to check for duplicat
Posted on Mar 10, 2014 by Jason Buss to Jason Buss' Blog
 
   Adding string formatting to values using WebEntityBinding
In a recent project, I needed to round numeric values displayed in the Opportunity Snapshot.  This
Posted on Feb 05, 2014 by Jason Buss to Jason Buss' Blog
 
   Updating text within Textblob fields in SalesLogix
I had a request to post on how you could replace characters within a blob field in the SalesLogix databas
Posted on Apr 19, 2012 by Jason Buss to Jason Buss' Blog
 
Comments

No Comments

Leave a Comment

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