Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Wednesday, November 27, 2024 
 
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!
 Architect Forums - SalesLogix Scripting & Customization
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: How to invoke a button launches a lookup?
william xie
Posts: 28
 
How to invoke a button launches a lookup?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Sep 06 9:09 AM
fiogf49gjkf0d
In my dataform, I have to invoke a button launches a look up to search based on one customized table. I have created this lookup in the "Manage" -> "lookups".

How to implement this requiement? and how can get the lookup id if this lookup opens?
[Reply][Quote]
Wiston
Posts: 6
 
Re: How to invoke a button launches a lookup?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 04 Sep 06 8:41 AM
fiogf49gjkf0d
Hi . There are a BasicFuntion to do this ( I'll sending to you a piece of code)
First You Need to set some variables
a) strLookupName= "PRODUCT:NAME" 'It's You Custom LookUp Name, In This Case is The PRODUCT LookUp
b) objLookup ' Result from the LookupItemWithConditionByID Function
c) strPreFill = "" ' /*Other parameter for this Function*/

Set objLookup = Application.BASICFunctions.LookupItemWithConditionByID (strLookupName, False, "", "", "", strPreFill)

'' /*Check Any Error */
If ErrorCheck ("MyOwnLookUpByName: Error Ejecutando Lookup") > 0 Then Exit Function

' /*This is the Result */

If TypeName (objLookup) = "Link" Then '/*If type <> "Link" then the user Cancelled*/
' Eureka , The Function Works Fine and Return my ID Values
strResultID = objLookup.ID ' This is the LookupID values
strProductName = objLookup.DisplayName ' This Is the Value Name

Set objLookup = Nothing
Else
strResultID = -1
End If

----------------------
Enjoy Code
[Reply][Quote]
Jordan
Posts: 30
 
Re: How to invoke a button launches a lookup?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 05 Sep 06 9:14 AM
fiogf49gjkf0d
Hi there

Besides the way Wiston mentioned, there is the other one: Application.BasicFunctions.DoInvoke "Lookup", strLookupName 'strLookupName is the lookup name

The difference between them is that the former can pass "PreFill" but there is no a check box "Create a temporary group containing all result" below the result grid. The later can Create Temporary Group but there is no room to pass "PreFill".

Wiston, if we need both "Create a temporary group containing all result" and "PreFill", how is it implemented? Do you have any idea about it?

Enjoy
[Reply][Quote]
william xie
Posts: 28
 
Re: How to invoke a button launches a lookup?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Sep 06 12:57 PM
fiogf49gjkf0d
I have created one lookup in "manage lookups", but the code:
Application.BasicFunctions.DoInvoke "Lookup", strLookupName 'strLookupName is the lookup name

said "the system cannot find the lookup."? Any idea?
[Reply][Quote]
Jordan
Posts: 30
 
Re: How to invoke a button launches a lookup?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Sep 06 1:11 PM
fiogf49gjkf0d
Try the third way:
Application.BasicFunctions.DoInvoke "Function", "Lookup:" & strLookupName 'strLookupName is the lookup name

Good luck
[Reply][Quote]
william xie
Posts: 28
 
Re: How to invoke a button launches a lookup?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Sep 06 10:48 PM
fiogf49gjkf0d
I am using the

'Including Script - System:SLX Lookup Support

LookupByName(strLookup, " ") this will work.

But I need to set the strPreFill, condition is the startdate will greater than today,

Then

strLookupID = LookupByName(strLookup, "StartDate > GetDate() " )

But this one does not work at all. What's wrong with it?
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: How to invoke a button launches a lookup?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 08 Sep 06 11:32 AM
fiogf49gjkf0d
Does it make any difference if you call it like this?

strLookupID = LookupByName(strLookup, "StartDate > " & Now())
[Reply][Quote]
william xie
Posts: 28
 
Re: How to invoke a button launches a lookup?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 11 Sep 06 4:58 PM
fiogf49gjkf0d
strLookupID = LookupByName(strLookup, "StartDate > " & Now()) still not working!!!
[Reply][Quote]
Steve Meyers
Posts: 11
 
Re: How to invoke a button launches a lookup?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 09 Oct 06 12:54 PM
fiogf49gjkf0d
Try wrapping the Date, provided by the Now function, in quotes.

strLookupID = LookupByName(strLookup, "StartDate > '" & Now() & "'")


Hope this helps...
[Reply][Quote]
Noah
Posts: 7
 
Re: How to invoke a button launches a lookup?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 23 Jan 07 10:56 AM
fiogf49gjkf0d
you need to add extra parameters to the lookupbyname function... The strPreFill is only for pre-populating the search field in the lookup

Add a custom function to your code and pass it your restrictions:
RestrictField = the DB field to restrict
RestrictValue = now() or whatever else you need
RestrictOp = ">"

Function myLookupByName (strLookupName, strPreFill, strRestrictField, strRestrictValue, strRestrictOp)
Dim objLookup
On Error Resume Next
Set objLookup = Application.BASICFunctions.LookupItemWithConditionByID (strLookupName, True, strRestrictField, strRestrictValue, strRestrictOp, strPreFill)
If ErrorCheck (Application.Translator.Localize("Error executing Lookup:")) > 0 Then Exit Function

If Not (objLookup Is Nothing) Then
myLookupByName = objLookup.ID
Set objLookup = Nothing
Else
myLookupByName = -1
End If
On Error Goto 0
End Function
[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 © 2024 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): 11/27/2024 12:32:33 AM