6/28/2025 9:30:06 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 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.
|
|
|
|
Populating lookup based on another lookup
Posted: 12 Mar 12 1:19 PM
|
fiogf49gjkf0d Hi there,
I'm working in SLX 7.5.4 Web and wondering how I can have one lookup populated based on another lookup. Specifically, I have a dealer and dealer rep lookups where the dealer rep is actually the contact of the account associated to dealer. However, I do not want the user to have to select dealer and then select the dealer rep, rather just to select the dealer rep and automatically populate the dealer from the associated account.
Any ideas how I can achieve this?
Thanks! |
|
|
|
Re: Populating lookup based on another lookup
Posted: 13 Mar 12 12:36 AM
|
fiogf49gjkf0d Take a look at the Seeding part of the Lookup Restrictions section of this blog post: http://customerfx.com/pages/integrationblog/2009/09/23/the-saleslogix-web-slxlookup-control.aspx
Basically, you'll bind the seed properties to the property in the entity that is the parent. In basic terms, like if you had an entity like Ticket, with a relationship to account and you wanted the user to be able to select a primary contact from that account in a lookup, you'd set the primary contact lookup to something like the following:
- SeedProperty = Contact.Account.Id
- SeedValue = Ticket.Account.Id
This says give me contacts where the contact's account id matches the value stored in the Account.Id property of the ticket. |
|
|
|
Re: Populating lookup based on another lookup
Posted: 13 Mar 12 4:31 PM
|
fiogf49gjkf0d To populate the dealer with the Rep's account, your would add something like this to the Lookup's OnChange event (note that the entity is already set to the new value at this time). Note that this assumes that the page is bound to the entity 'MeEntity', and the relationships are DealerRep and Dealer:
Sage.Entity.Interfaces.IMyEntity me = this.BindingSrouce.Current as Sage.Entity.Interfaces.IMyEntity;
if (me.Dealer != null)
me.Dealer = me.DealerRep.Account;
else
me.Dealer = null; |
|
|
| |
|
Re: Populating lookup based on another lookup
Posted: 13 Mar 12 6:37 PM
|
fiogf49gjkf0d Unfortunately it is not working...
I think maybe I need to explain the situation I am in a bit better and maybe one of you gurus can help me 
Both Dealer and DealerRep live inside an Account extension table and do not follow the proper parent-child relationships to Account and Contact entities (don't ask me why this was done, it would never have been designed like that if I did it, but I did not do it so yeah). Now, I have a very specific business requirement to either make DealerRep a "dependent" lookup on Dealer or to automatically populate Dealer after the user picks DealerRep.
Traditional SeedProperty/SeedValue does not work for this. Neither does the code above because there is no relationship between DealerRep and Account. In the extension table the Dealer simply is used to store an instance of the Account entity and DealerRep is used to store an instance of the Contact entity. Again, no relationships between these and their respective "parents" exist.
Any further ideas how I can do this? |
|
|
|
Re: Populating lookup based on another lookup
Posted: 14 Mar 12 12:29 AM
|
fiogf49gjkf0d I don't see any reason why using SeedProperty/SeedValue wouldn't work. I assume you're on a "Dealer" level form. The Dealer has a related account, in some way, am I right so far? If not, can you explain what is the base entity for the screen you're on and how you get to the "Dealer" from there? Even if not via a relationship, is there a simple field with an ID in it? Can you explain this more? |
|
|
|
Re: Populating lookup based on another lookup
Posted: 14 Mar 12 12:57 AM
|
fiogf49gjkf0d No, actually I am on Account level. The Account extension table (ASI_ACCOUNT_EXT) contains all of Dealer, DealerId, DealerRep, and DealerRepId. I do not personally see the point of Dealer and DealerRep as they only store text. DealerId and DealerRepId store Standard Ids that (can) point back to an Account and Contact respectively. There is no parent-child relationship established between any of these and the Account and Contact.
What I have done now is I created lookups bound to DealerId and DealerRepId, and I specified that the DealerId lookup entity is Account, and for DealerRepId lookup entity is Contact. I also specified that the SeedProperty and SeedValue for DealerRepId is ASI_ACCOUNT_EXT.DealerId.Id. This does not work as I just tested it and it was unsuccessful.
I hope this explains it... |
|
|
| |
|
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!
|
|
|
|
|
|
|
|