04-12-2011 09:35 AM
I need help urgently
I have added new column in association table called “AssociationSource”. I want to show this column in the grid. I have added the data bound column to the Association.ascx page.
But I am confused how can we add a new column to the Association Grid Data source.
Basically data source is taking a from business rule.
The below is the business rule of the association data source(I have renamed it)
public static IList<AccountAssociation> GetAccountAssociations1(IAccount account)
List<AccountAssociation> list = new List<AccountAssociation>();
using (ISession session = new SessionScopeWrapper())
string queryString = "from Association assoc where (assoc.FromId = :AccountId)";
IQuery query = session.CreateQuery(queryString);
foreach (IAssociation association in query.List<IAssociation>())
AccountAssociation item = new AccountAssociation(association, account, AssociationDirection.adFoward);
if (item.Account != null)
queryString = "from Association assoc where (assoc.ToId = :AccountId)";
query = session.CreateQuery(queryString);
foreach (IAssociation association3 in query.List<IAssociation>())
AccountAssociation association4 = new AccountAssociation(association3, account, AssociationDirection.adBackWard);
if (association4.Account != null)
I have pasted it in the assocaiton.ascx.cs page and renamed it and assigned it like below in loadgrid() method
string accountId = EntityService.EntityID.ToString();
IAccount account = EntityFactory.GetRepository<IAccount>().FindFirstByProperty("Id", accountId);
//IList<AccountAssociation> accountAssocList = Sage.SalesLogix.Association.AssociationBusinessRules.GetAccountAssociations(account);
IList<AccountAssociation> accountAssocList = GetAccountAssociations1(account);
AccountAssociations_Grid.DataSource = accountAssocList;
It is working fine. But I am not getting how can we add a new column to the exiting method(business rule method). Could any one please help.
It is really important I am struggling with this from last three days