Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Reply
Silver Contributor
Posts: 835
Registered: ‎03-24-2009
Accepted Solution

AA Account.ParentID as a LINK control?

Anyone have a workaround for this design limitation.....in reality an Entitiy can have a relationship with itself......recursive joins should (MUST) be part of the design architecture....this is not good.

 

How do you show the Account.ParentId.Account.AccountName in a link control on the Account Detail View.....like the Account Name link on the Contact Detail View? I don't want a Lookup control, I want a 1995 standard Internet blue underlined Hyper Link that displays the Parent AccountName and jumps to that .aspx page when the user clicks on it.

 

 

RJ Samp
Bronze Super Contributor
Posts: 236
Registered: ‎03-30-2009

Re: AA Account.ParentID as a LINK control?

Use a code snippet property to get the account name.  Then, put a link control on your quickform.  You should be able to bind the text of the link to your code snippet property for the Parent Account Name and the Entity ID to the parent account ID.

Mike LaSpina
Professional Services Consultant

Sage
8800 N Gainey Center Dr Ste 200
Scottsdale AZ 85258
Tel: 480-383-5344
Cell: 480-321-6637
Fax: 480-556-4090
mike.laspina@sage.com

Your Business in Mind.
Silver Contributor
Posts: 835
Registered: ‎03-24-2009

Re: AA Account.ParentID as a LINK control?

Thanks Mike! We'll try that....too bad SLX can't handle the recursive join relationship and get the data for me.....but this is a nice workaround.

RJ Samp
Highlighted
Bronze Super Contributor
Posts: 236
Registered: ‎03-30-2009

Re: AA Account.ParentID as a LINK control?

Yes - the ability to specify a relationship back to the same entity would be a nice feature.  One of the reasons (although not the only reason) that SLX does not allow this is for performance.  A whole lot of account related info gets loaded into the cache when we access an Account.  A long inheritance chain could cause a lot of data to get loaded once we access that account.

 

This brings me to my other point - the most efficient way to get that account name is to use a projection query rather than doing a GetById call.  For example:

 

 Sage.Platform.RepositoryHelper<IAccount> arh = Sage.Platform.EntityFactory.GetRepositoryHelper<IAccount>();
 Sage.Platform.Repository.ICriteria crit = arh.CreateCriteria();
 crit.SetProjection(arh.PF.Property("AccountName"));
 crit.Add(arh.EF.Eq("Id", account.ParentAccountId)); // Or whatever field you're storingthe parent Account ID in here
 result = crit.UniqueResult<System.String>();   

 

This results in a simple select sent to the DB server (i.e. select account from account where accountid = 'xxxxxxxxxxxx') rather than retrieving the whole account entity and all the baggage that comes along with it.

Mike LaSpina
Professional Services Consultant

Sage
8800 N Gainey Center Dr Ste 200
Scottsdale AZ 85258
Tel: 480-383-5344
Cell: 480-321-6637
Fax: 480-556-4090
mike.laspina@sage.com

Your Business in Mind.