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;
    return;
}

 

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!

-Jason

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

About Jason Buss

   Jason is a senior application developer with Customer FX.



Related Content
   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
 
   Restricting Adding Opportunity Contacts to Contacts at the Opportunity's Account
 One thing that clients have asked for is how to restrict the selection of the Opportunity Contacts
Posted on Sep 09, 2014 by Kris Halsrud to Kris Halsrud's Blog
 
   How do I access the new Opportunity that I created in Saleslogix??
I had a user ask why they could not access a Salelogix opportunity when they clicked the hyperlink from t
Posted on Sep 04, 2014 by Dale Richter to SalesLogix Questions & Answers
 
   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
 
Comments

 

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

(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