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!
|
|
SalesLogix 7.5 Lookup... Help Needed Urgently Please Respond
Posted: 24 Aug 10 5:37 AM
|
Hi
I need to create an account lookup so that based on the account selected i need to populate the some field values in the text boxes in a form by fetching data from account table. I have added the account lookup with the following settings.
What Information will you be looking for?
Account
Which Property will recieve the result of this look up?
Account
Select How the look up control will display?
Dialog
Select the properties that you want to see in the grid?
AccountName
Type
Subtype
After this i want to fetch the selected account id programtically. But i am not getting which property will give me the primary key id
i have tried the following
lkupaccount.lookupresultvalue -- returing the account name but not id
lkupaccount.SeedValue - Getting error
Please suggest and help me in this
Thanks in advance
|
|
|
|
Re: SalesLogix 7.5 Lookup... Help Needed Urgently Please Respond
Posted: 24 Aug 10 2:40 PM
|
It depends on how the Lookup is configured.
If it is configured to return an Object, it will return an Account Object. Which is probalby what it is doing. The reason you are getting the ACcount name is because the Account object .ToString() returns the name. You can cast it into an IAccount object, and get the ID value:
IAccount acc = lookup.LookupResultValue as IAccount; string acctID = IAccount.Id.ToString();
Or you could modify the Lookup to return a String object, in which case it will return the ID of the Selected Account. |
|
|
|
Re: SalesLogix 7.5 Lookup... Help Needed Urgently Please Respond
Posted: 24 Aug 10 2:45 PM
|
It depends on how the Lookup is configured.
If it is configured to return an Object, it will return an Account Object. Which is probalby what it is doing. The reason you are getting the ACcount name is because the Account object .ToString() returns the name. You can cast it into an IAccount object, and get the ID value:
IAccount acc = lookup.LookupResultValue as IAccount; string acctID = IAccount.Id.ToString();
Or you could modify the Lookup to return a String object, in which case it will return the ID of the Selected Account. |
|
|
|
Re: SalesLogix 7.5 Lookup... Help Needed Urgently Please Respond
Posted: 24 Aug 10 2:46 PM
|
It depends on how the Lookup is configured.
If it is configured to return an Object, it will return an Account Object. Which is probalby what it is doing. The reason you are getting the ACcount name is because the Account object .ToString() returns the name. You can cast it into an IAccount object, and get the ID value:
IAccount acc = lookup.LookupResultValue as IAccount; string acctID = IAccount.Id.ToString();
Or you could modify the Lookup to return a String object, in which case it will return the ID of the Selected Account. |
|
|
|
Re: SalesLogix 7.5 Lookup... Help Needed Urgently Please Respond
Posted: 24 Aug 10 5:04 PM
|
Mark, Is your lookup bound to anything? If so, the best practice is to use the bound field in the LookUpValue Changed event. For Example:
Sage.Entity.Interfaces.IMyEntity me = this.BindingSource.Current as Sage.Entity.Interfaces.IMyEntity; if (me != null) { string ID = me.Accont.Id.ToString(); } |
|
|
|
Re: SalesLogix 7.5 Lookup... Help Needed Urgently Please Respond
Posted: 25 Aug 10 5:01 AM
|
Thanks Raul for the help. It worked well.
The code i have written to get the accountid is
Sage.Entity.Interfaces.IAccount acc = lkupaccount.LookupResultValue as Sage.Entity.Interfaces.IAccount; string acctID = acc.Id.ToString();
Thank you very much.
Regards, Mark
|
|
|
|