• Gary Payne 9
  • NEWBIE
  • 45 Points
  • Member since 2016
  • Salresforce Administrator
  • ABILITY Network

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 17
    Questions
  • 7
    Replies
I have a Case Trigger that updates a custom number field, Number_of_Related_Cases__c., that I obtained from the Success Community.  Following is the Trigger code:
trigger Case_Count_Related_Cases on Case (after insert, after update, after delete) {

//build list of parent case ids
    Set<Id> ParentIds = new Set<Id>();

  //If insert or update, use trigger.new
  if (trigger.isinsert || trigger.isupdate) {

  //if case has parent, add to set of parentids
  for (Case c: Trigger.New) {

      if(c.ParentId != null) {
      ParentIds.add(c.ParentId);
      }

  //if case previously had parent, but no longer does, also add so we can recalc
  if (trigger.isupdate) {

      if (trigger.oldmap.get(c.id).parentid != null && c.ParentId == null) {
      ParentIds.add(trigger.oldmap.get(c.id).parentid);
      }

     }

  }
  }

  //if delete, make sure we update parent
  else if (trigger.isdelete) {

  for (Case c: Trigger.Old) {

      if(c.ParentId != null) {
      ParentIds.add(c.ParentId);
      }

  }
  }

  //then query for parent cases, and do inner query for related cases
    List<Case> pcount = [Select Id, (Select Id from Cases) From CASE where Id IN :ParentIds];

              //use size of inner cases to set number count
              for (Case pc: pcount) {
              pc.Number_of_Related_Cases__c = pc.cases.size();
              }
     //update parents        
    update pcount;
}

I am not a developer and need to create a Test Class for this trigger.  What would a Test Class for this Trigger look like?
We have an Apex Class Controller that needs to be altered to prevent Cases with a Type field value of "Project" from being included in the view.  Following is our Apex Class code:
public with sharing class ANICasesListViewController
{
    public String all_cases_list_view {get;set;}
    public String customer_service_list_view {get;set;}
    public String technical_support_list_view {get;set;}
    private Static String ALL_CASES = 'All Cases';
    private Static String CustomerService_CASES = 'Customer Service';
    private Static String TechnicalSupport_CASES = 'Technical Support';
     
   public ANICasesListViewController(ApexPages.StandardSetController controller) {
           String case_query = 'SELECT Id FROM Case LIMIT 1';
           all_cases_list_view = getListView( case_query , ALL_CASES );
           customer_service_list_view = getListView( case_query , CustomerService_CASES );
           technical_support_list_view = getListView( case_query ,TechnicalSupport_CASES );        
    }
    public static String getListView( String casequery, String listviewname )
    {
        String listviewid = null;

       ApexPages.StandardSetController ssc =  new ApexPages.StandardSetController(Database.getQueryLocator(casequery));

        List<SelectOption> listViewsAll = ssc.getListViewOptions();

        for (SelectOption so : listViewsAll)
        {
            if (so.getValue() == listviewname )
            {
                listviewid = so.getValue();
                break;
            }
        }
        if( listviewid != null )
        {
            // for some reason, won't work with 18 digit ID
            listviewid = listviewid.substring(0,15);
        }

        return listviewid;       
    }

}

Where in this code can the Type field value of "Project" be eliminated from the view and what would the code be?  Any help is greatly appreciated.
We have created an internal employees community and launched Ideas.  We would like to send email alerts to the Category Leaders when an Idea record reached 100 points.  The number field that captures the points is called Vote Total.  This field is not available in the Workflow filter criteria.  How can this field's value be included in the workflow so an email alert is sent to the public group for the Category on the Idea?
Requirements of the custom link are to take the user to an email screen where the email is addressed to a public group or queue. We have launched an internal community that houses our Ideas object.  We need to add a custom link in the home page sidebar that allows the user to send a comment to the Idea Moderators public group.  The purpose for this link is to give our employee community members a way to flag ideas they want to bring immediate attention to the Moderators only, in cases where the idea is exceptional, or questionable, and it needs immediate review.  This may require building a VF page and trigger, but I am not a developer yet and would need some help to build the VF page and trigger.
What is best practice for tracking a checklist of required tasks to implement a new product with a customer?  The sales rep closes a SFDC Opportunity and now the implmentation team must work with the customer to install the product and train the customer users of the product.  We have a custom object named Implementation Project that must be used to keep track of the process post-Opportunity Close-Won.  Two teams become invloved in the implementation: Technical and Training.  There are many steps involved in the implementation that require tracking and integration to workflows that send email alerts and Date stamp when the tasks are completed. Each product may have a different set of tasks to be performed and tracked.  Can anyone suggest a best approach to make this process work efficiently?
We have a VF page in a community to display Accounts when the user clicks the My Customers tab.  What would be the apex code I need to add to the following controller apex code to filter for Account_Status__c = 'Active'?

public without sharing class ANIMyAccountsController {

    public ANIMyAccountsController(ApexPages.StandardController controller) {
    }

    public List<Account> getAccountsList()
    {
       return [Select id,name,vendor__C,Phone,Type,Ownerid,BillingState,BillingStreet,BillingCity,BillingPostalCode,Primary_Line_of_Business__c,Tax_ID__c, Tax_Status__c, NPI_Org__c, Medicare_Provider_ID__c from Account where vendor__C = :userinfo().accountid];
    }

     private user userinfo(){
        return [Select id,name,profile.name,accountid from User where id=:UserInfo.getUserId()];
    }

}  
 
We are introducing Ideas to an internal community of employees.  How can I add a "Report Abuse' type link or button to the Ideas page layout?  We want the users to be able to flag Ideas they think need immediate attention by the Moderators.  It might be for abusive content, or extraordinary ideas that address an immediate need.  We'd like to call the link "Report Post" as not all flags pertain to abuse.
We are rolling out a Partner Community with Chattter enabled. The challenge we are having is around it not “locking” a file and multiple people editing the same file and overwriting information. What is best practice for controlling shared files?
We want our users to click their SSO link to login instead of their usual Salesforce.com login.  IT has requested to rest the users' passwords but not to send them the email notification to reset their password.  Any ideas on how this can be done?
How can Ideas be set up without having to build a Community?  Our executives want to explore a proof of concept for Ideas for internal users only without building a Community for it.  This will include an initial review by a group of Moderators, a queue for reviewing Ideas if the Modrators approve, review by executives, and then building out of the Idea in a sandbox for testing and then deployment to production.  They also want the ability to report abuse using a custom button, and point tracking and recognition of users that create the Idea records.
Can a custom button called "Report Abuse" be created for the Ideas page layout?  Our company wants to use the Ideas object and we have a request for a Report Abuse button.  I don't see an option for a Report Abuse button on the standard Ideas page layout.  Can a custom button be created for use on the Ideas page layout, and if so, how can it be created?
I need help to write tests for an apex controller that lists the Assets of the Account on a Case page layout with a VF page.  Following is my Apex Class:
public class DisplayAllAccountCases {

    public Account AccountInfo{get;set;}
    public DisplayAllAccountCases(ApexPages.StandardController controller) {
        string accountId=[select accountId from case where id=:Apexpages.currentpage
       ().getparameters().get('id')].accountId;
        AccountInfo=new Account(id=accountId);
    }
 }

What tests do I need to provide at least 75% code coverage?  I'm an Admin, not a developer and really need help to code this so it can be deployed to production.  Any help is certainly appreciated.
 
The Case requirement is to allow multiple Asset records per Case and require at least one Asset record in order to save a Case record when the Status is "Cancelled", "Saved", or "Closed".  The Account record will already have Asset records tied to it.  I created a junction object called Case Asset  to allow multiple Asset records per Case record. What is needed to force the user to create Case Asset records before saving a Case record when the Status is "Cancelled", "Saved", or "Closed". ?
One user cannot view the related list hover links aboe the account detail.  They do see the related list sections in the lower portion of the account detail.  What would cause this when other users with the same Role and Profile can see their hover links on the account detail screen?
We considering upgrading from Cornerstone version 4.3 to 6.1.  We are being asked to upgrade to the latest version 7.x.  Are there any known issues/challenges we need to consider before making such a large leap in the upgrade?
My user profile has the "Make Setup My Default Landing Page" checkmarked, but after login the setup sidebar is not visible.  I must click on "Setup" to see the setup sidebar.  How do I fix this?  Note I am the system administrator.
Can Opportunity Splits allow adding an owner role that's based on the personnel listed in the split record, not restricted to the Opportunity Owner?
What is best practice for tracking a checklist of required tasks to implement a new product with a customer?  The sales rep closes a SFDC Opportunity and now the implmentation team must work with the customer to install the product and train the customer users of the product.  We have a custom object named Implementation Project that must be used to keep track of the process post-Opportunity Close-Won.  Two teams become invloved in the implementation: Technical and Training.  There are many steps involved in the implementation that require tracking and integration to workflows that send email alerts and Date stamp when the tasks are completed. Each product may have a different set of tasks to be performed and tracked.  Can anyone suggest a best approach to make this process work efficiently?
I have a Case Trigger that updates a custom number field, Number_of_Related_Cases__c., that I obtained from the Success Community.  Following is the Trigger code:
trigger Case_Count_Related_Cases on Case (after insert, after update, after delete) {

//build list of parent case ids
    Set<Id> ParentIds = new Set<Id>();

  //If insert or update, use trigger.new
  if (trigger.isinsert || trigger.isupdate) {

  //if case has parent, add to set of parentids
  for (Case c: Trigger.New) {

      if(c.ParentId != null) {
      ParentIds.add(c.ParentId);
      }

  //if case previously had parent, but no longer does, also add so we can recalc
  if (trigger.isupdate) {

      if (trigger.oldmap.get(c.id).parentid != null && c.ParentId == null) {
      ParentIds.add(trigger.oldmap.get(c.id).parentid);
      }

     }

  }
  }

  //if delete, make sure we update parent
  else if (trigger.isdelete) {

  for (Case c: Trigger.Old) {

      if(c.ParentId != null) {
      ParentIds.add(c.ParentId);
      }

  }
  }

  //then query for parent cases, and do inner query for related cases
    List<Case> pcount = [Select Id, (Select Id from Cases) From CASE where Id IN :ParentIds];

              //use size of inner cases to set number count
              for (Case pc: pcount) {
              pc.Number_of_Related_Cases__c = pc.cases.size();
              }
     //update parents        
    update pcount;
}

I am not a developer and need to create a Test Class for this trigger.  What would a Test Class for this Trigger look like?
We have an Apex Class Controller that needs to be altered to prevent Cases with a Type field value of "Project" from being included in the view.  Following is our Apex Class code:
public with sharing class ANICasesListViewController
{
    public String all_cases_list_view {get;set;}
    public String customer_service_list_view {get;set;}
    public String technical_support_list_view {get;set;}
    private Static String ALL_CASES = 'All Cases';
    private Static String CustomerService_CASES = 'Customer Service';
    private Static String TechnicalSupport_CASES = 'Technical Support';
     
   public ANICasesListViewController(ApexPages.StandardSetController controller) {
           String case_query = 'SELECT Id FROM Case LIMIT 1';
           all_cases_list_view = getListView( case_query , ALL_CASES );
           customer_service_list_view = getListView( case_query , CustomerService_CASES );
           technical_support_list_view = getListView( case_query ,TechnicalSupport_CASES );        
    }
    public static String getListView( String casequery, String listviewname )
    {
        String listviewid = null;

       ApexPages.StandardSetController ssc =  new ApexPages.StandardSetController(Database.getQueryLocator(casequery));

        List<SelectOption> listViewsAll = ssc.getListViewOptions();

        for (SelectOption so : listViewsAll)
        {
            if (so.getValue() == listviewname )
            {
                listviewid = so.getValue();
                break;
            }
        }
        if( listviewid != null )
        {
            // for some reason, won't work with 18 digit ID
            listviewid = listviewid.substring(0,15);
        }

        return listviewid;       
    }

}

Where in this code can the Type field value of "Project" be eliminated from the view and what would the code be?  Any help is greatly appreciated.
I need help to write tests for an apex controller that lists the Assets of the Account on a Case page layout with a VF page.  Following is my Apex Class:
public class DisplayAllAccountCases {

    public Account AccountInfo{get;set;}
    public DisplayAllAccountCases(ApexPages.StandardController controller) {
        string accountId=[select accountId from case where id=:Apexpages.currentpage
       ().getparameters().get('id')].accountId;
        AccountInfo=new Account(id=accountId);
    }
 }

What tests do I need to provide at least 75% code coverage?  I'm an Admin, not a developer and really need help to code this so it can be deployed to production.  Any help is certainly appreciated.
 
The Case requirement is to allow multiple Asset records per Case and require at least one Asset record in order to save a Case record when the Status is "Cancelled", "Saved", or "Closed".  The Account record will already have Asset records tied to it.  I created a junction object called Case Asset  to allow multiple Asset records per Case record. What is needed to force the user to create Case Asset records before saving a Case record when the Status is "Cancelled", "Saved", or "Closed". ?
My user profile has the "Make Setup My Default Landing Page" checkmarked, but after login the setup sidebar is not visible.  I must click on "Setup" to see the setup sidebar.  How do I fix this?  Note I am the system administrator.