Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Saturday, June 28, 2025 
 
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!
 Web Forums - SalesLogix Web Platform & Application Architect
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.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Web Platform & Application Architect | New ThreadView:  Search:  
 Author  Thread: RepositoryHelper for Binding Grid
Mayank Pant
Posts: 8
 
RepositoryHelper for Binding GridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 16 Feb 12 2:12 PM
fiogf49gjkf0d

Hi,


I am uing saleslogix 7.4 and I have a grid in account's more tab in which I have to show data from IAccountCode table [A1] (AccountId as common column, contactid as another common colum) and Contact table[C1].


I have to select many columns from A1 and contact name column  from C1 using repository helper and Icriteria. How can I create a list which contains A1 records and contact name from C1 so that i can bind it later to the grid.


 


With Regards,


Mayank Pant.

[Reply][Quote]
Mike LaSpina
Posts: 116
 
Re: RepositoryHelper for Binding GridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 16 Feb 12 5:58 PM
fiogf49gjkf0d

Create a business rule with a return type of"System.Collections.Generic.List<IAccountCode>".  I like to name these "Getxxx".  In you case,  "GetAccountCodes".


Your code for the rule would look something like this:


            result = new System.Collections.Generic.List<IAccountCode>();
            Sage.Platform.RepositoryHelper<IAccountCode> opf = Sage.Platform.EntityFactory.GetRepositoryHelper<IAccountCode>();
            Sage.Platform.Repository.ICriteria crit = opf.CreateCriteria();               
            crit.Add(opf.EF.Eq("SomeField", "SomeValue"));
            result = crit.List<IAccountCode>();               


[Reply][Quote]
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Re: RepositoryHelper for Binding GridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 16 Feb 12 6:50 PM
fiogf49gjkf0d

Are we sure that


crit.AddOrder.....


crit.AddOrder.....


crit.AddOrder....


 


Will give us a server side three tier sort?


 


Also in the above example can you return the Account's  Address.City, Address.State for us so we can show this stuff in the grid?


 


Thanks!

[Reply][Quote]
Mayank Pant
Posts: 8
 
Re: RepositoryHelper for Binding GridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Feb 12 12:39 PM
fiogf49gjkf0d

Thanku for help. I need to merge column name also to the resultset . I have contactid column as common column between IAccountCode and ContactID table. How can I get records from IAccountTable and Correspoding contact name from the contact table.


 


Thanks in advance.

[Reply][Quote]
Mike LaSpina
Posts: 116
 
Re: RepositoryHelper for Binding GridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Feb 12 12:50 PM
fiogf49gjkf0d

If you have a relationship defined int he ORM, it should not matter.  You can reference related properties in the grid.  For example, ContactAccount.Contact.FirstName.

[Reply][Quote]
Mike LaSpina
Posts: 116
 
Re: RepositoryHelper for Binding GridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Feb 12 12:52 PM
fiogf49gjkf0d

RJ - It should append those to the order by clause - so yes, a 3 teir sort.


 


As for item 2, all you have to do is reference Address.City in the grid if you're returning a list of Accounts.

[Reply][Quote]
Mayank Pant
Posts: 8
 
Re: RepositoryHelper for Binding GridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Feb 12 1:30 PM
fiogf49gjkf0d

Hi,


 


But how will I bind with the grid.


I have result set from IAccountCode table in "result" list using with help of RepositoryHelper and adding criteria on "accountid" column, which i will bind to the grid which has different columns and one of them is contactname. How will it merge.


Ex:


Grid name : dgAccoundCodeDetails(Codeid[IAccount Table], desc[IAccount Table], Contact Name[Contact Table])


dgAccoundCodeDetails.datasource= result;


dgAccoundCodeDetails.databind();


will not bind Contact Name column from Contact table as it is not contained in the result set.


 

[Reply][Quote]
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Re: RepositoryHelper for Binding GridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 18 Feb 12 9:57 AM
fiogf49gjkf0d

Quote:
Originally posted by Mike LaSpina


If you have a relationship defined int he ORM, it should not matter.  You can reference related properties in the grid.  For example, ContactAccount.Contact.FirstName.



It's not finding the field in the GetByMethod  data source for the filtered grid (it is finding it for the GetByProperty data source).


ACCOUNT -->OppAssocAccounts gives us all of the OppAssocAccount table entries.


-->Opportunity gives us the Opportunity for the OppAssocAccount table entry.


My GetByProperty data source uses Opportunity.Description, Opportunity.SalesPotential, etc. and has no issues in retrieving the related Account's Opportunities data nor sorting by the column names.


I want to filter the grid by the opportunity Product Line value, getbyMethod Business Rule:


The CreateAlias is probably the culprit:


<Code>
          //Build Query for basic Account specific data.
            IRepository<Sage.Entity.Interfaces.IOppAssocAccount> repository = EntityFactory.GetRepository<Sage.Entity.Interfaces.IOppAssocAccount>();
            IQueryable qry = (IQueryable)repository;
            IExpressionFactory ef = qry.GetExpressionFactory();
            Sage.Platform.Repository.ICriteria criteria = qry.CreateCriteria();
            criteria.CreateAlias("Opportunity","Opportunity");
           
            if (ProductLine.ToString() == "")   { ProductLine = "ALL"; }
            if (ProductLine.ToUpper() == "ALL") { ProductLine = "ALL"; }
                   
            if (ProductLine.ToUpper() != "ALL") {                
            criteria.Add( ef.Eq("Opportunity.ProductLine", ProductLine) );
            }           
            criteria.Add( ef.Eq("Account.Id", account.Id.ToString()) )    ;   
            result = criteria.List<Sage.Entity.Interfaces.IOppAssocAccount>();


</Code>


Any Hints?!


 


AND YES, criteria.AddOrder is Additive and works.....just did a 5 tier sort! Awesome and thanks Mike!

[Reply][Quote]
Mayank Pant
Posts: 8
 
Re: RepositoryHelper for Binding GridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 18 Feb 12 12:13 PM
fiogf49gjkf0d

Thanks for help, things are working now.


 


With Regards,


Mayank Pant

[Reply][Quote]
 Page 1 of 1 
  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!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 6/28/2025 7:53:40 AM