Solved

Sage CRM button on record lines

Posted on 2010-09-03
5
815 Views
Last Modified: 2012-05-10
Hi,

I am not experienced with ASP Javascript, I am having a bit of trouble with some code within Sage CRM.

I want to add buttons per record, which will allow me to link to another screen to edit the linked table. I have added my custom screen, and my grid, I just cant get the buttons to appear.

Here is my script

Can anyone help?

Many thanks

 My grid
<!-- #include file ="..\crmwizard.js" -->

<!-- #include file ="pfunctions.js" -->



<%



CurrentPersonID=new String(eWare.GetContextInfo("person", "Pers_PersonId"));



var sURL=new String( Request.ServerVariables("URL")() + "?" + Request.QueryString );



var Custom = eWare.GetBlock('content');

var scc = '<input type="hidden" name="insubmit" value="">';

Custom.contents = scc;



List=eWare.GetBlock("PersonEventList");

List.prevURL=sURL;



container = eWare.GetBlock('container');

container.AddBlock(Custom);

container.AddBlock(List);



container.DisplayButton(Button_Default) = false;



if( CurrentPersonID != null && CurrentPersonID != '' )

{

  var Content = container.Execute("Evli_PersonId="+CurrentPersonID);



   //Add edit buttons

   var MatchArray = Content.match(/edit_\d{1,9}/ig)

   if (MatchArray = null){

     for(var i=0;i<MatchArray.length;i++){



       var FieldId = new String(MatchArray[i]);

       FieldId = getValueWithoutPrefix(FieldId,"edit_");

       var re = new RegExp(MatchArray[i],"ig");



 	   if (Defined(FieldId)){

         Content = Content.replace(re,AddEditButton(FieldId,eWare.URL("Event/PersonEventEdit.asp"+"?J=Event/PersonEvent.asp"),'Edit details'));

	   }

	   else{Content = Content.replace(re,"")};

	 }

   }

Open in new window

0
Comment
Question by:breakwell
  • 3
  • 2
5 Comments
 
LVL 25

Expert Comment

by:Lee Savidge
ID: 33597692
Hi,

Do you want the buttons in the list or do you want to make the first column link to the custom screen?

Lee
0
 

Author Comment

by:breakwell
ID: 33597747
Hi,

Preferably buttons in the list... but at this point I am not worried - as long as I get to the custom screen.

Many thanks,
John
0
 
LVL 25

Accepted Solution

by:
Lee Savidge earned 500 total points
ID: 33597869
Buttons to appear in the list is a bit of a fiddle as it requires you to create an image with a specific name and then add a new field, specify the field to display as a GIF on that screen and then put text in the field that matches the name of the GIF. Fiddly but it works. You're best bet is to edit the screen contents for that custom screen in Administration -> Customisation -> <you entity name> and then in the lists tab, find the list called PersonEventList and then click on the column in the left hand side to highlight it and on the right hand side alter the Hyperlink drop down to point to custom jump. Then in the custom file box that appears put in something like this:

PersonEvent/PersonEventEdit.asp

In the custom ID field, put in the ID number from the entity you're in which is porbably the evli_personeventid or something like that. Difficult to say as I don't have access to the CRM system.

Lee
0
 

Author Closing Comment

by:breakwell
ID: 33611366
Great, thanks - I have managed to link to the custom page directly as specified
0
 
LVL 25

Expert Comment

by:Lee Savidge
ID: 33611467
Cool, glad I could help.

Lee
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now