Getting SalesLogix Account ID Programatically

Question: I am trying to create an Account lookup in SalesLogix that, based on
the Account selected, will populate field values in text boxes in a form
by grabbing data from the account table.  My Account lookup is based on
these settings:

Information you are searching for? Account

Property that will receive the result of this look up? Account

Choose how the look up control will display: Dialog

Choose the properties that you would like to see in the grid:


After, I would like to get
the selected Account ID programatically but I don’t receive the property
that will give me the primary key ID.  I tried this:

lkupaccount.lookupresultvalue — returning Account name but not ID

lkupaccount.SeedValue – receive error


Answer: This depends on how your lookup is configured.  It seems as though it is
probably configured to return an Object, which will return the Account
Object.  You are getting the Account name 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();

You can also modify the lookup to return a String object, which will return the ID of the Selected Account.


Submit a Comment

Your email address will not be published. Required fields are marked *

Subscribe To Our Newsletter

Join our mailing list to receive the latest Infor CRM (Saleslogix) and Creatio (bpm'online) news and product updates!

You have Successfully Subscribed!