Home
|
Forums
|
Contact
|
Search
|
Syndication
[login]
[create account]
Friday, July 4, 2025
slxdeveloper.com
Home
Search
Contact us
About slxdeveloper
Syndication
Community
Forums
(NEW!)
Newsletter Archive
Members
Your Profile
Submit Article
General
Administration
(6)
OLE DB Provider
Miscellaneous
(2)
Architect
VBScript
(9)
ActiveX Controls
(6)
How To's
(14)
.NET Extensions
(3)
External
OLE DB Provider
(12)
SLAPI (SlgxApi.dll)
SalesLogix COM
(1)
Web
ASP/ASP.NET
(2)
Web Services
Web Client
Downloads
Samples
(17)
Documentation
(7)
Utilities
(18)
Resources
SalesLogix
(3)
Programming
(1)
7/4/2025 2:32:44 PM
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 Thread
View:
Dynamic
Flat
Tree
Search:
Author
Thread: How to clear a Lookup Control in C#
John Wishart
Posts: 5
How to clear a Lookup Control in C#
Posted: 05 Sep 09 4:00 AM
I would like to know how to reset the value of a Lookup control in C#.
I have an InserTicket form that has, amongst other controls, two Lookup controls and some text boxes. So the form entity type is ITicket; the first Lookup control is used to lookup the Account for the new ticket. I have written a code snippet action (which runs as the method of the OnCompleteActionItem of the Account Lookup OnChange action) that sets some of the ticket entity fields to values based on the selected accounts fields.
That works OK and the text boxes bound to those ticket fields show the new values after I do an account lookup.
What I would also like to do is clear the value in the 2nd lookup control when the account is changed. I have had not found a way to do this in the code snippet. I have tried to set the ticket field the Lookup is bound to string.Empty and to set the form.lookupId.Text to string.Empty, but the value in the control does not change, unlike the textboxes.
Any help indicating how I may achieve this in the above scenario would be greatly appreciated.
[
Reply
][
Quote
]
John Wishart
Posts: 5
Re: How to clear a Lookup Control in C#
Posted: 05 Sep 09 6:41 AM
Of course the correct property to use to reset a Lookup is the LookupResultValue.
Setting both the field on the Ticket that is bound to the lookup result to string.Empty and having form.lookupId.LookupResultValue = string.Empty; has achieved the desired result.
[
Reply
][
Quote
]
Raul A. Chavez
Posts: 1300
Re: How to clear a Lookup Control in C#
Posted: 08 Sep 09 1:32 PM
I am not saying that String.Empty isn't the correct value to be used, but I null it out.
I do so because the Lookup can be set to return a String or an Object (most do object), which is why I choose null. (And LookupResultValue is defined as object).
form.lookupId.LookupResultValue = null;
[
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
|
page cache (param): 7/4/2025 3:13:16 PM