• Rajiv B 3
  • NEWBIE
  • 40 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 16
    Questions
  • 15
    Replies
"Add PR Contact" is case detail page button it will create a Contact from VF page and same will be liked to the current case. It is working as expected but curent case is not getting automatically refreshd to see changes in the case. 

Below is the VF page script
 
<script

language="JavaScript" type="text/javascript">
function CloseAndRefresh(){
window.opener.location.href="/{!$CurrentPage.parameters.id}";
      window.top.close(); 
  }
</script>

<apex:pageBlockButtons >
<apex:commandbutton action="{!save}" id="button" oncomplete="javascript:CloseAndRefresh()" value="Save"/>   </apex:pageBlockButtons>

Could you please suggest me where I have to make changes to refresh the case automatically.

Appreciate for your suggestions. 
Very new to deal with App Exhange apps. Please with me for basic questions. 

How can I come to know(How can I Check) whether the package is manged or Unmanged during Uninstall/Install? 

What are the best approaches or processdures to Uninstall a package? .. Key steps to consider or note during uninstalling  

Uninstall a package in UAT will it effect Organization data? 

How to Install a package in UAT?

while install a Appexchange package what are the best way of installing/Approach?

After installing how to provide access to the users? 
is it possible to combine below two queries as one, where I need to display Case emails and comments in a page pertaining to a case order by createddate desc​
 
List <EmailMessage> sortedEmails = new List<EmailMessage>();
   
    sortedEmails = [SELECT Id, FromAddress, ToAddress, BCCAddress, MessageDate, Subject, HasAttachment, Incoming, TextBody, CreatedBy.Name 
            from EmailMessage where ParentId =: currentCase.Id 
            order by MessageDate DESC ];

List<CaseComment> Casecomments = new List<CaseComment>();
    Casecomments = [SELECT Id, CommentBody, CreatedDate, ParentId FROM CaseComment where ParentId =: currentCase.Id
            order by CreatedDate DESC];

 
List all attachments when hit "Send An Email"  button on case.  

And option to choose which ones to attach in the Out-going email

appreciate with suggestions and code snippets.

Thanks 

User-added image


User-added image
 
Need to display all Email templates in related list on case and upon selection one of email template same email template has to populate/copy to the description field in case. 

can you please provide some inputs on this. 

appreciate if you can add code here. 

thanks 
Can you suggest me to get below requirment with code samples. 

Button that will display all email details and comments for the case in a page 
Button created, would display all emails and their details along with all comments relating to the case.

thanks 
How can I acheive this for outgoing emails?

When the User hits "Send An Email" button, would like to see any attachments associated to the case to list in the Attachment section and have the option to choose which ones to attach in the out-going email. -- below screenshot  

Please suggest me with code. 

Thanks 

User-added image
Below is the Email Notification from Salesforce with respect to Web to case and web to lead. 
I am not sure what changes required to do to my Enterprice Edition as per added notification here. 
can you help me to do required changes,if you can add snippet/screenshots helps me to fix early. 

Thanks ​


User-added image


 
Hi all , 
I am getting below error while change the Storage__C owner from X to Y. 
caused by: System.QueryException: Non-selective query against large object type (more than 200000 rows). Consider an indexed filter or contact salesforce.com about custom indexing.

 
trigger StevContacts on Storage__C (after update) 
{
    
    List<Storage__C> Strs = [select Id, Type, (select Primary_Campaign__c from Contacts) from Storage__C where Id IN :Trigger.newMap.keySet()];
    List<Contact> contacts = new List<Contact>();
    Storage__C oldStrs;

    for(Storage__C s: Strs)
    {
        oldStrs = Trigger.oldMap.get(s.Id);
      
        if (oldStrs.Type != s.Type && s.Type == 'Stev')
        {       
            for(Contact c: s.Contacts)
            {
                c.Primary_Campaign__c='Stev';
                contacts.add(c);
            } 
        }
        else if (oldStrs.Type != s.Type && oldStrs.Type == 'Stev')
        {  
            for(Contact c: s.Contacts)
            {
                c.Primary_Campaign__c='ting';
                contacts.add(c);
            } 
        }
    update contacts;
    }
}
I have gone through documents . Found below below points  but not able fiqure it out .. where exactly i have to do changes in my code. 

Options to resolve error
1. You may find that the query in question needs to be more selective in the WHERE clause. According to the Salesforce standards & best practices - the where clause needs to subset 10% or less of the data.
2. A custom index on the field.
3. A possible quick fix may be to make the field in question an external ID. Since external IDs are indexed automatically, this will create the index and may solve the problem.

Appreciate your help 
While changing account owner encountering Error :: Too many query rows: 50001

I have gone through many post they are suggesting to change script means adding limit to the query.

Here in my class there is no chance to change the query and query not inside the for loop. 

for suppose if i Put Limit clause what about records which count more than 50000.  

For example i have 60000 records to change then what is the result. 
Hi, 
it is very urgency Requirment, not able to deploy trigger(before Update) through change sets. Code coverage for the trigger is 35% in uat. 
User-added image

I included trigger and Testclass in the changessets but throwing below error message while validating in the PRODUCTION
''The following triggers have 0% code coverage. Each trigger must have at least 1% code coverage."

 
User-added image


Thanks in advnce .. 

Below is the code coverage issu due to this not able to get required code coverage.

if you provide snippet code will highly appreciate..

User-added image
 
Custom picklist field Called Status__C in Case object.

Requirment:
Once user select Status__C field value as Rejected need custom field called Rejected__Reason__C should auto populate next to Status__C  to enter rejected reason.

How to achieve this??

can we have any out of box functionality ??

need any code development ??

Thanks in advance
HI all,

case i have picklist field called  - Status __C.
If i slect Status__C value as 'Rejected'.. Need to popup or display another field Rejected_reason__c ( Text - 80) .

how can i achive this eirther???   
 

Hi , 

i am unable to get code coverage for the following. 
 
if (fileBody != null){
             
        myAttachment  = new Attachment();
              Integer i=0;
              myAttachment .clear();
              myAttachment.Body = fileBody; 
              myAttachment.Name = fileName; 
              myAttachment.ContentType = contentType;
              myAttachment.ParentId = objcase.id;             
              insert myAttachment;  
              }

 
Hi all, 

Need to capture  user/jobs details who updated case  in both before update (Before update record) , after update(who updated ) ?
need to store  last 30 days records modified user details and modified 10 field values future reference. 

can you please assist me with trigger code. 

 
"Add PR Contact" is case detail page button it will create a Contact from VF page and same will be liked to the current case. It is working as expected but curent case is not getting automatically refreshd to see changes in the case. 

Below is the VF page script
 
<script

language="JavaScript" type="text/javascript">
function CloseAndRefresh(){
window.opener.location.href="/{!$CurrentPage.parameters.id}";
      window.top.close(); 
  }
</script>

<apex:pageBlockButtons >
<apex:commandbutton action="{!save}" id="button" oncomplete="javascript:CloseAndRefresh()" value="Save"/>   </apex:pageBlockButtons>

Could you please suggest me where I have to make changes to refresh the case automatically.

Appreciate for your suggestions. 
is it possible to combine below two queries as one, where I need to display Case emails and comments in a page pertaining to a case order by createddate desc​
 
List <EmailMessage> sortedEmails = new List<EmailMessage>();
   
    sortedEmails = [SELECT Id, FromAddress, ToAddress, BCCAddress, MessageDate, Subject, HasAttachment, Incoming, TextBody, CreatedBy.Name 
            from EmailMessage where ParentId =: currentCase.Id 
            order by MessageDate DESC ];

List<CaseComment> Casecomments = new List<CaseComment>();
    Casecomments = [SELECT Id, CommentBody, CreatedDate, ParentId FROM CaseComment where ParentId =: currentCase.Id
            order by CreatedDate DESC];

 
How can I acheive this for outgoing emails?

When the User hits "Send An Email" button, would like to see any attachments associated to the case to list in the Attachment section and have the option to choose which ones to attach in the out-going email. -- below screenshot  

Please suggest me with code. 

Thanks 

User-added image
While changing account owner encountering Error :: Too many query rows: 50001

I have gone through many post they are suggesting to change script means adding limit to the query.

Here in my class there is no chance to change the query and query not inside the for loop. 

for suppose if i Put Limit clause what about records which count more than 50000.  

For example i have 60000 records to change then what is the result. 
Hi, 
it is very urgency Requirment, not able to deploy trigger(before Update) through change sets. Code coverage for the trigger is 35% in uat. 
User-added image

I included trigger and Testclass in the changessets but throwing below error message while validating in the PRODUCTION
''The following triggers have 0% code coverage. Each trigger must have at least 1% code coverage."

 
User-added image


Thanks in advnce .. 

Below is the code coverage issu due to this not able to get required code coverage.

if you provide snippet code will highly appreciate..

User-added image
 
Custom picklist field Called Status__C in Case object.

Requirment:
Once user select Status__C field value as Rejected need custom field called Rejected__Reason__C should auto populate next to Status__C  to enter rejected reason.

How to achieve this??

can we have any out of box functionality ??

need any code development ??

Thanks in advance
HI all,

case i have picklist field called  - Status __C.
If i slect Status__C value as 'Rejected'.. Need to popup or display another field Rejected_reason__c ( Text - 80) .

how can i achive this eirther???   
 

Hi , 

i am unable to get code coverage for the following. 
 
if (fileBody != null){
             
        myAttachment  = new Attachment();
              Integer i=0;
              myAttachment .clear();
              myAttachment.Body = fileBody; 
              myAttachment.Name = fileName; 
              myAttachment.ContentType = contentType;
              myAttachment.ParentId = objcase.id;             
              insert myAttachment;  
              }

 
Hi all, 

Need to capture  user/jobs details who updated case  in both before update (Before update record) , after update(who updated ) ?
need to store  last 30 days records modified user details and modified 10 field values future reference. 

can you please assist me with trigger code. 

 

Hi all,

I need to be able to display all my case comments and case emails in an <apex:repeat> block and they should be ordered by the date they were sent. I'm rather new to salesforce development and I'm not 100% sure how to do this. 

I have tried the following:

My Controller:

public class CaseFeedItem
    {
        public string creatorSmallPhotoUrl {get; set;}
        public string createdByName {get; set;}
        public string textBody {get; set;}
        public dateTime createdDate {get; set;}        
    }
    
    public list<CaseFeedItem> myCaseFeedItems {get; set;}

PageReference loadcase(Id caseID) 
    {
        system.debug('loadcase: starting... ');

        if (caseID == null)
            return page.conf_error;  /// NEED TO DO SOMETHING HERE
        
        mycase = 
            [
                SELECT
                        Id,
                        CaseNumber,
                        Subject,
                        Owner.Name,
                        CreatedDate,
                        Status,
                        Description,
                        Auditor_First_Name__c,
                        Auditor_Last_Name__c,
                        Auditor_Email__c,
                        Auditor_Phone__c,
                        Client_Name__c,
                        Client_Year_End_Date__c,
                        Client_No_of_Requests__c,
                        Client_Date_Requests_were_Sent__c,
                        Client_Audit_Deadline_Date__c,
                        ClosedDate,
                		IsClosed
                    FROM 
                        Case
                    WHERE
                        Id = :caseID
            ];
        
        system.debug('viewcase: case: '+mycase.subject);
        
        mycasecomments = 
            [
                SELECT 
                    Id,
                    CommentBody,
                    CreatorName,
                    CreatedById,
                    CreatedDate,
                    CreatorFullPhotoUrl,
                    CreatorSmallPhotoUrl,
                    IsPublished,
                    CreatedBy.Name
                    
                FROM 
                    CaseComment
                WHERE 
                    ParentID = :caseID
                ORDER BY
                    CreatedDate DESC
            ];
 
        myCaseEmails = 
        [
            SELECT
            	Id,
            	FromAddress,
            	FromName,
            	TextBody,
            	MessageDate,
            	ToAddress,
            	Subject
            	
            FROM
            	EmailMessage
            WHERE
            	ParentID = : caseId
            ORDER BY
            	MessageDate DESC
        ];
        newcomment = new CaseComment(ParentId=caseID);
        createCaseFeed();
        return null;

    }

 public void createCaseFeed()
    {
        for(CaseComment comment : mycasecomments)
        {
            CaseFeedItem feedItem = new CaseFeedItem();
            feedItem.creatorSmallPhotoUrl = comment.CreatorSmallPhotoUrl;
            feedItem.createdByName = comment.CreatedBy.Name;
            feedItem.textBody = comment.CommentBody;
            feedItem.createdDate = comment.CreatedDate;
            myCaseFeedItems.add(feedItem);
        }
        
        for(EmailMessage email : myCaseEmails)
        {
            CaseFeedItem feedItem = new CaseFeedItem();
            feedItem.creatorSmallPhotoUrl = null;
            feedItem.createdByName = email.FromName;
            feedItem.textBody = email.TextBody;
            feedItem.createdDate = email.MessageDate;
            myCaseFeedItems.add(feedItem);
        }
    }
And on my VF page:
 
<apex:repeat value="{!CaseFeedItems}" var="feedItem">
                        
      <div class="col-md-2 col-sm-2 xs-marginbottom">
            <img src="{!feedItem.creatorSmallPhotoUrl}" width="60" height="60" alt=""/><br/>
             <apex:outputText value="{!feedItem.createdByName}" />
       </div>
       <div class="col-md-10 col-sm-10">
              <apex:outputText value="{!feedItem.textBody}" />
               <br/><br/>
               <small>Date/Time Sent:&nbsp; 
                  <apex:outputText value="{0,date,MM'/'dd'/'yyyy  HH:MM}">
                        <apex:param value="{!feedItem.createdDate}" /> 
                  </apex:outputText>
               </small> 
       </div>
       <div class="col-md-12 col-sm-12">
           <hr/>
        </div>
</apex:repeat>


At the moment I get:

Error: Error occurred while loading a Visualforce page. on /confirmation/conf_caseView
Attempt to de-reference a null object 

And I would also like to find out how I would sort the "myCaseFeedItems" list by date

Hi All,

Does anybody know how to integrate my developer edition to salesforce for outlook(SFO).

When i login into SFO using my developer edition i got folder not available like image below.

User-added image

I have checked the https://help.salesforce.com/articleView?id=Why-are-the-folders-grayed-out-in-the-Salesforce-for-Outlook-wizard&language=en_US&type=1 link all looks good. But i can't able to integrate my dev edition to SFO.

Can anyone please help me to integerate SFO with my salesfoce developer edition?

Thanks,
Saravana