Help!
Hoping someone can assist me with an ASP page. I have the page the way that I need it. However, I lose context with the company record I am on after saving the page. After saving, I need to have one field populated and then I want to return to my asp page in view mode. My page is called CHSleasecf.asp
Here is the page code...any assistance would be greatly appreciated!!
//Get Container Block
var Container=CRM.GetBlock("Container")
//Define Context
var ThisCompanyId = CRM.GetContextInfo('Company','Comp_companyId');
//Find record from custom entity (CHSleasecf) and tie it to the context (Company)
var ThisCompanyRecord =CRM.FindRecord('CHSleasecf','lcf_companyid='+ThisCompanyId);
//Define the data block
companyblock=CRM.GetBlock("CHSLeaseCFDetailBox");
//Define the where clause
companyblock.ArgObj=ThisCompanyRecord;
//Add the block to the container
Container.AddBlock(companyblock)
//Actions if page is in Edit mode
if(CRM.Mode == Edit)
{
//Add Canel button to edit page
Container.AddButton(CRM.Button("Cancel","Cancel.gif",CRM.URL("CHS/CHSleasecf.asp")));
}
//Generate HTML
//Add the container block to the screen
CRM.AddContent(Container.Execute());
//Deliver the page to the web
Response.Write(CRM.GetPage())
//Actions if page is in Save mode
if(CRM.Mode == Save)
{
ThisCompanyRecord.lcf_UpdateTL='Y'
ThisCompanyRecord.SaveChanges();
Response.Redirect(CRM.URL("CHS/CHSleasecf.asp"));
}
Thanks!