Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Sunday, August 17, 2025 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Web Forums - SalesLogix Web Platform & Application Architect
Forum to discuss the use of the SalesLogix Web Platform, Client and Customer Portals, and the Application Architect (For version 7.2 and higher only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Web Platform & Application Architect | New ThreadView:  Search:  
 Author  Thread: programatically set the data for a look up
vaughn poulson
Posts: 28
 
programatically set the data for a look upYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Feb 09 10:55 AM
Along with my lest thread, i have a similar problem. This time I want to programatically set the lookup for the account based on the contact that is selected.
I can get the accountid to save in the database but the account name does not appear in the lookup. Here is my code:

public static void lueFirmContact_OnChangeSetAccountStep( IJobContacts form, EventArgs args)
{
IContact firmContact = form.lueFirmContact.LookupResultValue as IContact;

IAccount firmAccount = firmContact.Account as IAccount;

form.lueFirmAccount.LookupResultValue = firmAccount;

form.lueFirmAccount.Text = firmAccount.AccountName;

IC_Opportunity_Ext oppExt = (form.CurrentEntity as IOpportunity).C_Opportunity_Ext;

oppExt.IndpndntAdjFirmAcctId = firmAccount.Id.ToString();


oppExt.Save();
}

Any ideas on how to get the account name to appear in the lookup lueFirmAccount?
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: programatically set the data for a look upYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Feb 09 11:14 AM
Instead of trying to set the control, set the property in the entity. Instead of setting the lookup, on the change event of the contact lookup, do something like this in C# snippet:

Sage.Entity.Interfaces.IMyEntity myentity = this.BindingSource.Current as Sage.Entity.Interfaces.IMyEntity;
myentity.Account = (Sage.Entity.Interfaces.IContact)lookupContact.LookupResultValue;


After the postback the account lookup should show the bound value just fine. Does that make sense?
[Reply][Quote]
vaughn poulson
Posts: 28
 
Re: programatically set the data for a look upYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Feb 09 11:29 AM
Ryan,

That works great. Thanks.
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 8/17/2025 3:16:35 PM