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:

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

 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
   Using Global Script functions in InforCRM
I recently had a project that required me to be able to check if a user belonged to a particular team.
Posted on May 05, 2015 by Jason Buss to Jason Buss' Blog
   Telnet Sample to Send an SMTP email
I am always forgetting how to test sending an email through an SMTP gateway using the Telnet client. 
Posted on Dec 12, 2014 by Kris Halsrud to Kris Halsrud's Blog
   Problem setting SLXTextbox enabled property / Setting unexposed base control properties for a custom control
I recently had an issue with a Quickform where I was attempting to set the Enabled property of a TextBox
Posted on Dec 05, 2014 by Jason Buss to Jason Buss' Blog
   Adding a report link to the Common Tasks pane in Infor CRM (formerly Saleslogix)
When you are viewing an Entity Detail page, the Common Tasks pane on the right of the page provides a nu
Posted on Nov 12, 2014 by Jason Buss to Jason Buss' Blog
   Problem with the Clean Build Folders option in Application Architect
On occasion, it becomes necessary to clean out the build folders and deployed website prior to a build/de
Posted on Sep 16, 2014 by Jason Buss to Jason Buss' Blog

No Comments

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