Hello,
I am trying to retrieve a list of projects with associated company. (for example: i am trying to do the very same thing where when you find your company and click on 'People' tab then youll get all people associated with this company.)
So far i created my custom entity Project which holds a list of project records. I created a list for company called 'CompanyProjects' along with tab called 'Projects'.
Below is the code of my custom page:
//var screen = CRM.GetBlock("CompanyProjects");
var resultgrid = CRM.GetBlock("Company Projects");
var myBlock = CRM.GetBlock("Container");
CompanyId=CRM.GetContextInfo("Company","Comp_CompanyId");
record=CRM.FindRecord("Project","project_companyid="+CompanyId);
with(myBlock)
{
AddBlock(resultgrid);
}
resultgrid.ArgObj = record;
CRM.AddContent(myBlock.Execute());
Response.Write(CRM.GetPage());
The problem is that i am getting an error message saying "SQL Error".
Below is the SQL log:
Nov 25 2013 16:36:42.795 4344 7056 1 fselectsql,time,sql,errormsg 141 SELECT * FROM ( select * , ROW_NUMBER() over(ORDER BY project_name, Comp_CompanyId) AS rowranking from Project WITH (NOLOCK) WHERE project_companyid=1226 ) as A WHERE rowranking > 0 and rowranking Invalid column name 'Comp_CompanyId'
Any comments or suggestion are welcome. Thank you.