Working from other Grids

Coordinator
Jul 2, 2009 at 6:30 PM
Edited Jul 2, 2009 at 6:30 PM

I have a request of how this would work from the opp grid and recently a request of how this would work from the Account grid.  The aspx pages require slight modification to adapt other grids.  In the Page_Load event there is a switch that indicates what action to take, I call this the action switch.  Here is where you add new case for the different actions.  You will then also have to add a new method to the crmAction class to handle the new action.  You now need to modify the isv_config to add the button to the approprate section of the have the url to indicate what action should be taken.

Url="/ISV/icrmGridAction/SingleGridAction.aspx?action=PHONECALL_OPP" WinParams="dialogHeight: 70px; dialogWidth: 300px" PassParams="1" WinMode="1" >

You could create one method to deal with new phone calls that take a type parameter and handels the different type.  However I had choose to create a different Method for each entity type.  I have created a sample GetNewPhone_Opp method and GetNewPhone_Account method.  The GetNewPhone_Opp method adds the phone call to the potential Customer this can be a contact or account.  The GetNewPhone_Account method adds the phone call to the account, this could be modified to add it to the primary contact if there is one.  I have create these two methods as samples and they have not been tested and may require modification.   These two methods can then be modified to do the rest of the action.  Note I only made these changes to the Source Code and not to the download release.  Once I have more time, I will do some testing and add the rest of the action to the methods and then recreate a new release.

I am alway please to hear people have found the code useful.  Thanks for your comments.

	switch (sAction)
            {
              case "PRIMARY_CONTACT":
                action.SetContactAsPrimary(idGuid);
                break;
              case "PHONECALL_CONTACT":
                url = action.GetNewPhone_Contact(idGuid);
                Response.Write(GetXMLNodeText("returnurl", url));
                break;
              case "TASK_CONTACT":
                url = action.GetNewTask_Contact(idGuid);
                Response.Write(GetXMLNodeText("returnurl", url));
                break;
              case "EMAIL_CONTACT":
                url = action.GetNewEmail_Contact(idGuid);
                Response.Write(GetXMLNodeText("returnurl", url));
                break;
              case "CASE_CONTACT":
                url = action.GetNewCase_Contact(idGuid);
                Response.Write(GetXMLNodeText("returnurl", url));
                break;
              case "PHONECALL_OPP":
                url = action.GetNewPhone_Opp(idGuid);
                Response.Write(GetXMLNodeText("returnurl", url));
                break;
              case "PHONECALL_ACCOUNT":
                url = action.GetNewPhone_Account(idGuid);
                Response.Write(GetXMLNodeText("returnurl", url));
                break;
              default:
                throw new Exception("invalid action parameter");
            }