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
   Easily Showing and Hiding Tabs at Runtime in Infor CRM (Saleslogix)
Showing and hiding tabs in the Infor CRM (Saleslogix) client should be an easy thing. It should be someth
Posted on Dec 16, 2014 by Ryan Farley to Ryan Farley's 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
   Checking Infor CRM (Saleslogix) Picklists for valid data
This week I received a question about a particular picklist. One of the picklist items, when chosen, wou
Posted on Dec 05, 2014 by Dale Richter to Infor CRM Questions & Answers
   Avoiding the Dirty Data Message When Programatically Redirecting to a Record in Infor CRM (Saleslogix)
In my last post I wrote about using the OnClientClick property of a control (or button) to run JavaScript
Posted on Dec 02, 2014 by Ryan Farley to Ryan Farley's Blog


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