In Sage CRM if you have created a new custom entity using the Advanced Customization Wizard then you would have had the option to create a libary page for the entity. This provides a straight forward way of allowing documents to be uploaded into the library and associated with the custom entity.
Below is the basic ASP page code that is generated by the wizard.
In this case the new entity is called Events. But the key thing to point out here is that a button has been added that calls the action
You can build you own like this:
Below is the basic ASP page code that is generated by the wizard.
var sURL=new String( Request.ServerVariables("URL")() + "?" + Request.QueryString ); Container=CRM.GetBlock("container"); List=CRM.GetBlock("LibraryList"); List.prevURL=sURL; var Id = Request.Querystring("Events_EventsID"); CRM.SetContext("Events", Id); Container.AddBlock(List); Container.AddButton(CRM.Button("New", "new.gif", CRM.URL(343)+" &Key-1="+iKey_CustomEntity+" &PrevCustomURL="+List.prevURL+" &E=Events")); Container.DisplayButton(1)=false; if( Id != '') { CRM.AddContent(Container.Execute("Libr_EventsId="+Id)); } CRM.GetCustomEntityTopFrame("Events"); Response.Write(CRM.GetPage());
In this case the new entity is called Events. But the key thing to point out here is that a button has been added that calls the action
CRM.URL(343)
You can build you own like this:
var sURL=new String( Request.ServerVariables("URL")() + "?" + Request.QueryString );
var NewLibraryButton = CRM.Button('New','new.gif', CRM.Url(343)+" &PrevCustomURL="+sURL);