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
   Unicode Character Sets for SalesLogix Web 8.1
If you have the need to use unicode character sets so international users can view the web client in thei
Posted on Oct 29, 2014 by Mark Duthoy to SalesLogix Support
 
   Change the Appearance of a Saleslogix (Now Infor CRM) Read Only TextBox Web Control
In the Salelogix web client, a read only control has a css style applied to it to make the background app
Posted on Oct 24, 2014 by Kris Halsrud to Kris Halsrud's Blog
 
   Saleslogix (now Infor CRM) Web Client- Changing Label Appearances on Quick Forms
 I wrote previously about setting a label's appearance on a quick form using server side code.&n
Posted on Oct 02, 2014 by Kris Halsrud to Kris Halsrud's Blog
 
   Error Attempting to Save an Entity: "E_FAIL(0x80004005)" in the Infor CRM (Saleslogix) Web Client
We recently had a client that was running into an issue when attempting to create one particular entity i
Posted on Sep 30, 2014 by Kris Halsrud to Kris Halsrud's Blog
 
   Video: Demystifying Infor CRM (Saleslogix) Updates
Watch it now! If you missed yesterdays demo, "Demystifying Infor CRM (Saleslogix) Updates" ,
Posted on Sep 26, 2014 by Brianna Ojard to The Inbox
 
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