Login / Register  search  syndication  about

          Jason Buss' Blog

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

Setting Billing/Shipping addresses on Insert Salesorder in the SalesLogix Web Client

In a recent SLX Web project, it was requested that I add a contact lookup to the insert SalesOrder view, and when that was set, use the contact's address for the Shipping and Billing address in the SalesOrder.  I was able to add a new Contact property to the SalesOrder and add the lookup to the insert SalesOrder view, but I wasn't able to reference the new property after it was set.

It turned out that on the insert form, the Contact property wasn't actually being written until after the new SalesOrder record was saved.   In order to get the selected contact's address information, I simply referenced the Contact entity returned in the lookup as shown in this sample.

This code was added to a C# Snippet action in the OnChange Action event of the new contact lookup.

Sage.Entity.Interfaces.ISalesOrder salesOrder = BindingSource.Current as Sage.Entity.Interfaces.ISalesOrder;
Sage.Entity.Interfaces.IContact con = lkeContact.LookupResultValue as Sage.Entity.Interfaces.IContact;

if (salesOrder != null && con != null && con.Address != null)
    salesOrder.BillingAddress = salesOrder.SetSalesOrderBillingAddress(con.Address);
    salesOrder.BillingContact = con;
    salesOrder.BillToName = con.NameLF;
    salesOrder.ShippingAddress = salesOrder.SetSalesOrderShippingAddress(con.Address);   
    salesOrder.ShippingContact = con;
    salesOrder.ShipToName = con.NameLF;


In addition, I added similar code the OnChange Action of the Account lookup, only instead I set the SalesOrder properties to Null instead.  I did this so that if a new Account was selected, a new contact would also need to be selected along with the new address information.


Hope you find this example helpful.  Thanks for reading!


Follow JasonBussCFX on Twitter
What's This?
Bookmark and Share

About Jason Buss

   Jason is a senior application developer with Customer FX.

Related Content
   Configuring and Packaging secured actions in Saleslogix 8.0
Using Secured Actions, you can restrict access to user interface elements in the Saleslogix web client.
Posted on Aug 12, 2014 by Jason Buss to Jason Buss' Blog
   How do you add a parameter for File Attachment Size and Timeout in Saleslogix 8.1?
Question: Is it possible to set a parameter for file attachment size and timeout in Salelogix? If
Posted on Aug 07, 2014 by Dale Richter to SalesLogix Questions & Answers
   Saleslogix XBar Installation
When installing the new XBar application I found the instructions a little vague so I thought I would pas
Posted on Jul 18, 2014 by Mark Duthoy to SalesLogix Support
   Finding the Current Parent Record ID in SalesLogix Web
Sometimes it's the easiest things that can be a big barrier to entry for getting started with somet
Posted on Jun 27, 2014 by Ryan Farley to Ryan Farley's Blog
   SalesLogix 8.1 Job Service Scheduling Executions Error Resolution
Often times a web implementation will have an application server that is used to deploy the web portals t
Posted on Jun 20, 2014 by Mark Duthoy to SalesLogix Support


Twitter Trackbacks for Setting Billing/Shipping addresses on Insert Salesorder in the SalesLogix Web Client - Jason Buss' Blog [customerfx.com] on Topsy.com said:

Pingback from  Twitter Trackbacks for                 Setting Billing/Shipping addresses on Insert Salesorder in the SalesLogix Web Client - Jason Buss' Blog         [customerfx.com]        on Topsy.com

April 14, 2010 2:46 AM

Leave a Comment

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