11/26/2024 2:24:38 AM
|
|
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!
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.
|
|
|
|
Lookup Control, displaying and searching
Posted: 08 Jan 16 5:16 PM
|
I am having such a hard time with this Lookup control. I have gotten so far as to figure out how to search, but that's about it.
I have a datagrid in which I am populating certain times and dates, and want to link each line to an opportunity once it's been "completed." When the window pops up, I have a lookup for the opportunity and it searches just fine via the OpportunityID, then attaches the information, and displays certain things from the Opportunity table in the datagrid (mostly the description and type).
When I click on the row again to "Edit" the information, the Opportunity box now shows the ID rather than a name (so it's something like OGCPA000012). When I am able to get it to show the Description in the box, I lose the ability to edit that field, so It seems to be a lose-lose situation no matter what I do in this case.
Additionally, I am looking to restrict the searches to opportunities within the same account, but it seems that is not working either! I am just really confused in the overall process and programming of this area, so any help or guidance will be extremely helpful!! |
|
|
|
Re: Lookup Control, displaying and searching
Posted: 14 Jan 16 12:45 AM
|
Hi Paula,
When you talking about "Edit", you are talking about Edit Form, right?
1. LookupID property should linked to the field (to save ID returned from the lookup. You lookup should return ID to ID field). You can set the "Text" property of the Lookup by JOIN and display Description field in the Opportunity table. By doing this, the control becomes Read Only since you have displayed text from another table. If the 'HideButtonIfReadOnly' checked, then you will loose the Lookup button hence you can't do the Look up on EditView. Set the HideButtonIfReadOnly off so you can keep the Lookup Button on that Lookup control when the text becomes ReadOnly.
2. For restriction,
set, "LookupRestrictField" to "ACCOUNTID", "LookupRestrictOp" to "=", set the LookupRestrictValue to the accountid that you have.
Regards,
Jinsan
|
|
|
|
Re: Lookup Control, displaying and searching
Posted: 14 Jan 16 9:45 AM
|
Hi Jinsan,
You are a genius!!! I would have never thought about the lookup field becoming read only and hiding the button. That solves that problem there and makes me really happy!
I still do not understand the restriction. The thing is, where do I get the accountid? This form is on every account, so I can't type in the account id otherwise it wont work for other accounts, if that makes sense. I am just not sure how to get the from to recognize what account it is currently in to restrict the search.
Edit
I figured it out!!! For others who are interested in how:
I have a text edit that pulls out the account ID, then for the lookup field I added an OnPopup event with this code:
Sub lookupOpportunityPopup(Sender) Sender.LookupRestrictValue = txtAccountID.Text End Sub
In the property fields for the Lookup I have ACCOUNTID as the LookupRestrictField and = as the LookupRestrictOp
Yay!! |
|
|
|
Re: Lookup Control, displaying and searching
Posted: 14 Jan 16 9:02 PM
|
Excellent paula.
I was about to post that.
I recommend you to play aroung these properties of the Lookup. It will come handy.
1. DefaultLookup Operator
2.LookupRestrictAlways.
Happy coding!
Jinsan
|
|
|
|
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!
|
|
|
|
|
|
|
|