• sieb4me
  • NEWBIE
  • 60 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 127
    Questions
  • 146
    Replies
I have created sharing set for custom object (book) 
access determined by has following - 
User:Account = Book:Account__c

When I login as contact user on community, it shows me all book records with all accounts, instead of book records with contact users account.
Standard objects have no issues like case, accounts, they only show those records for which user account matches on those objects.

Can someone please suggest why custom object is not working properly.

Thanks.
 
Do i really need partner community for granting access to case object or just continue using customer community and no seperate need for partner community? 

Thanks.
There is custom object called 'work' where we need an alert if its not assigned 2 weeks prior to assign date on the object, alert will be daily till its not assigned.
Can this be done via workflow or anyways without code (trigger)  or only code can accomplish this?
Also this won't be an email alert but popup kind of reminder is needed when manager logs in to salesforce.

Any idea or suggestions please.

Thank you.
How can we accomplish moving case attachments of certain extensions like .pdf, etc to box folders. We have different folders in box for diff accounts.

Thanks.
We have requirment where some sales reps who do not have salesforce licence but need to know when cases are created for those accounts.
example, microsoft account sales reps need emails or updates when case is created for microsoft, cisco reps need email for their account when case is created.

How can this be accomplished. Can we use chatter plus for that? 
If there any better way?
we have requirement where we will have 1 entitlement for SLA calcualtion (master agreement)  and 1 for Asset on the case. Can we have that in salesforce?
We cannot have sla on asset entitlment, please note. There will be many entitlments for asset, we select 1, however master entitlment (agreement) will also be associated to case for SLA calculation.

How can we achieve that?
how do i remove file, poll, etc action links on feed view, i tried removing from edit layout but they came back...
I noticed when i create a new case in console, hightly panel is fixed, however when i select exisiting case from list and scroll in detail view, highlight panel also scrolls, why can't it remain fixed?
multiple entitlments with different slas for different accountsHow does one set case sla or milestones for different accounts where each account has different entitllement and slas?
Do we need to create multiple entitlment processes and case milestones for each entitlment and associate them to accounts?
That would be lot of work.
How does one set case sla or milestones for different accounts where each account has different entitllement and slas?
Do we need to create multiple entitlment processes and case milestones for each entitlment and associate them to accounts?
That would be lot of work.

Please suggest.
Error:
Apex script unhandled exception by user/organization: 005A0000000PKLe/00DA0000000JUaR
 
Visualforce Page: /apex/StructuredResponse
 
Error seen when changing a picklist field value, which shows other fields on selection but instead it shows the error above
 
 
caused by: System.ListException: List index out of bounds: 0
 
Class.StructuredResponseExtensionController.setTemplateLanguageFromContact: line 41, column 1
Class.StructuredResponseExtensionController.<init>: line 36, column 1

CODE where it errors. - this code is on class used by VF page.


setTemplateLanguageFromContact();
  

   
   private void setTemplateLanguageFromContact() {
       try {
            String contactLanguage =  [select Contact.INFA_Language__c from Case where Id = :cas.Id limit 1][0].Contact.INFA_Language__c;
            cas.Structured_Response_Language__c = contactLanguage;
         }catch(DMLException dme) {
         } 
   }
Hi,
I have following formulla in my assignment rule, which works fine. But now due to daylight time change here in USA, I need to make change.
What would be the new formulla for it?

Thanks


AND( 
(VALUE(MID(TEXT(NOW()),12,2)) >= 16), /* BusinessHourStart: 16:00 UTC */ 
(VALUE(MID(TEXT(NOW()),12,2)) < 24) 
), 
AND( 
(VALUE(MID(TEXT(NOW()),12,2)) >= 00), 
(VALUE(MID(TEXT(NOW()),12,2)) < 01) /* BusinessHourStop: 01:00 UTC */ 


global class myclass implements Support.MilestoneTriggerTimeCalculator {   
     global Integer calculateMilestoneTriggerTime(String caseId, String milestoneTypeId){
        Case c = [SELECT Priority, Priority_On_Complete__c  FROM Case WHERE Id=:caseId];
        MilestoneType mt = [SELECT Name FROM MilestoneType WHERE Id=:milestoneTypeId];
        
        if (c.Priority_On_Complete__c == null)  {
        
        
        if (c.Priority != null && c.Priority.equals('P1'))
        return 60;
        
        else 
    
    if (c.Priority != null && c.Priority.equals('P2')) 
        
            return 240;
     
    else 
    if (c.Priority != null && c.Priority.equals('P3')) 
        return 480;
    
    else return 0;
        }
        else  {
          if (c.Priority_On_Complete__c.equals('P1'))
        return 60;
        
        else 
    
    if (c.Priority_On_Complete__c.equals('P2')) 
        
            return 240;
     
    else 
    if (c.Priority_On_Complete__c.equals('P3')) 
        return 480;
    
    else return 0;
          
          
        }
        
                        
     }
}
Hi,
is there a way in saleforce that once milestone flag is completed, it should not be alowed to set it violated.
We have a situation where based on priority we set milestone and hence target times.
However due to priority change, completed milestones show violated flag.

Example :
P2 is changed to P1, since time was 1 hour response on P1, it shows violated when milestone was completed and this is becase P1 has 1 hour response time and P2 has 2 hours and engineer responded after 1 hour (completed milestone when it was P2).
field name casedate =  '2011-05-16T18:30:08.923-07:00'

how do i add minutes to this field casedate, example i want to add 200 mintues or sometimes its -420 minutes, how do i do that?
I know there is a function called addMinutes(Integer)
how to convert following to gmt/UTC? and then to lets say India time zone which is UTC +5.30

November 05 2014 10:00 AM PST
Hi,
I have a following code on entitlement process and want to exeute if only if case is new or case field priority is changed, how do i modify it?

Thanks


CODE:

global class myMilestoneTimeCalculator implements Support.MilestoneTriggerTimeCalculator {   
     global Integer calculateMilestoneTriggerTime(String caseId, String milestoneTypeId){
        Case c = [SELECT Priority, Priority_On_Complete__c  FROM Case WHERE Id=:caseId limit 1];
              
        if (c.Priority_On_Complete__c == null)  {
          if (c.Priority != null && c.Priority.equals('P1'))
              return 3;
          else 
               if (c.Priority != null && c.Priority.equals('P2')) 
            return 6;
       else 
        if (c.Priority != null && c.Priority.equals('P3')) 
            return 9;
         else return 0;
        }
        else  {
            if (c.Priority_On_Complete__c.equals('P1'))
              return 3;
         else 
        if (c.Priority_On_Complete__c.equals('P2')) 
            return 6;
        else 
        if (c.Priority_On_Complete__c.equals('P3')) 
            return 9;
        else return 0;
            
        }
                        
     }
}
This is calculating wrong time, 
cas.Email_Template_GCS_CallBack_Time__c = BusinessHours.addGmt (cas.BusinessHoursId, cas.CreatedDate, (cas.Email_Template_GCS_Call_back_time_Number__c * 60 * 60 * 1000L).longValue()).format('MMMM dd yyyy hh:mm a z');

Example 

Date/Time Opened is 10/22/2014 2:07 PM

Value shown is 
Email Template GCS Call Back Time is October 21 2014 05:30 PM PDT

Email Template GCS Call back time Number is 0.5
I have this code below and logs show following errors, what can be the reason? Thanks.

cas.Email_Template_GCS_CallBack_Time__c = BusinessHours.addGmt (cas.BusinessHoursId, cas.CreatedDate, (cas.Email_Template_GCS_Call_back_time_Number__c * 60 * 60 * 1000L).longValue()).format('MMMM dd yyyy hh:mm a z');

See this error when i create case
Error: Invalid Data. 
Review all error messages below to correct your data.
Apex trigger CaseBeforeInsert caused an unexpected exception, contact your administrator: CaseBeforeInsert: execution of BeforeInsert caused by: System.MathException: null: (System Code)

Log shows this

1:24:15.690 (690052735)|SYSTEM_METHOD_ENTRY|[841]|system.BusinessHours.addGmt(Id, Datetime, Long) 11:24:15.691 (691353829)|SYSTEM_METHOD_EXIT|[841]|system.BusinessHours.addGmt(Id, Datetime, Long) 11:24:15.691 (691363647)|METHOD_EXIT|[50]|01pZ0000000GXFv|UpdateCase.CalculateFieldsForTemplates(LIST<Case>) 11:24:15.691 (691383145)|CONSTRUCTOR_EXIT|[84]|01pZ0000000GXFv|<init>(Boolean,Boolean,LIST<Case>,LIST<Case>,MAP<Id,Case>,MAP<Id,Case>) 11:24:15.691 (691481029)|FATAL_ERROR|System.MathException: null (System Code) Class.UpdateCase.CalculateFieldsForTemplates: line 841, column 1 Class.UpdateCase.<init>: line 50, column 1 Trigger.CaseBeforeInsert: line 84, column 1 11:24:15.691 (691502049)|FATAL_ERROR|System.MathException: null




 
how do i get this "(GMT+04:30) Afghanistan Time (Asia/Kabul)"
to be storedin field like this

+4.30

I want to strip all except the plus sign and digits and ':' to be change to '.'
Thanks.
I have created sharing set for custom object (book) 
access determined by has following - 
User:Account = Book:Account__c

When I login as contact user on community, it shows me all book records with all accounts, instead of book records with contact users account.
Standard objects have no issues like case, accounts, they only show those records for which user account matches on those objects.

Can someone please suggest why custom object is not working properly.

Thanks.
 
Hi guys/gals,

Do you have any idea on how to obtain the Cloak of Adventure sweatshirt after completing 5 badges on trailheads?

Source: http://go.pardot.com/l/27572/2016-01-06/4wy4tn?utm_campaign=newyear-trailhead-sweatshirt

I haven't received any email address or notification about the completion after I had received 5 new badges on my profile. 

The sweetshirt looks really cool and I want to get it :D  Ty
 
We have requirment where some sales reps who do not have salesforce licence but need to know when cases are created for those accounts.
example, microsoft account sales reps need emails or updates when case is created for microsoft, cisco reps need email for their account when case is created.

How can this be accomplished. Can we use chatter plus for that? 
If there any better way?
multiple entitlments with different slas for different accountsHow does one set case sla or milestones for different accounts where each account has different entitllement and slas?
Do we need to create multiple entitlment processes and case milestones for each entitlment and associate them to accounts?
That would be lot of work.
How does one set case sla or milestones for different accounts where each account has different entitllement and slas?
Do we need to create multiple entitlment processes and case milestones for each entitlment and associate them to accounts?
That would be lot of work.

Please suggest.
global class myclass implements Support.MilestoneTriggerTimeCalculator {   
     global Integer calculateMilestoneTriggerTime(String caseId, String milestoneTypeId){
        Case c = [SELECT Priority, Priority_On_Complete__c  FROM Case WHERE Id=:caseId];
        MilestoneType mt = [SELECT Name FROM MilestoneType WHERE Id=:milestoneTypeId];
        
        if (c.Priority_On_Complete__c == null)  {
        
        
        if (c.Priority != null && c.Priority.equals('P1'))
        return 60;
        
        else 
    
    if (c.Priority != null && c.Priority.equals('P2')) 
        
            return 240;
     
    else 
    if (c.Priority != null && c.Priority.equals('P3')) 
        return 480;
    
    else return 0;
        }
        else  {
          if (c.Priority_On_Complete__c.equals('P1'))
        return 60;
        
        else 
    
    if (c.Priority_On_Complete__c.equals('P2')) 
        
            return 240;
     
    else 
    if (c.Priority_On_Complete__c.equals('P3')) 
        return 480;
    
    else return 0;
          
          
        }
        
                        
     }
}
field name casedate =  '2011-05-16T18:30:08.923-07:00'

how do i add minutes to this field casedate, example i want to add 200 mintues or sometimes its -420 minutes, how do i do that?
I know there is a function called addMinutes(Integer)
I have this code below and logs show following errors, what can be the reason? Thanks.

cas.Email_Template_GCS_CallBack_Time__c = BusinessHours.addGmt (cas.BusinessHoursId, cas.CreatedDate, (cas.Email_Template_GCS_Call_back_time_Number__c * 60 * 60 * 1000L).longValue()).format('MMMM dd yyyy hh:mm a z');

See this error when i create case
Error: Invalid Data. 
Review all error messages below to correct your data.
Apex trigger CaseBeforeInsert caused an unexpected exception, contact your administrator: CaseBeforeInsert: execution of BeforeInsert caused by: System.MathException: null: (System Code)

Log shows this

1:24:15.690 (690052735)|SYSTEM_METHOD_ENTRY|[841]|system.BusinessHours.addGmt(Id, Datetime, Long) 11:24:15.691 (691353829)|SYSTEM_METHOD_EXIT|[841]|system.BusinessHours.addGmt(Id, Datetime, Long) 11:24:15.691 (691363647)|METHOD_EXIT|[50]|01pZ0000000GXFv|UpdateCase.CalculateFieldsForTemplates(LIST<Case>) 11:24:15.691 (691383145)|CONSTRUCTOR_EXIT|[84]|01pZ0000000GXFv|<init>(Boolean,Boolean,LIST<Case>,LIST<Case>,MAP<Id,Case>,MAP<Id,Case>) 11:24:15.691 (691481029)|FATAL_ERROR|System.MathException: null (System Code) Class.UpdateCase.CalculateFieldsForTemplates: line 841, column 1 Class.UpdateCase.<init>: line 50, column 1 Trigger.CaseBeforeInsert: line 84, column 1 11:24:15.691 (691502049)|FATAL_ERROR|System.MathException: null




 
how do i get this "(GMT+04:30) Afghanistan Time (Asia/Kabul)"
to be storedin field like this

+4.30

I want to strip all except the plus sign and digits and ':' to be change to '.'
Thanks.
we want a field on case object which will pick timezone from case (can be emea, usa or apac time), look at created datetime of case and calculate the time remaining to respond to customer based on severity of case (s1, s2 or s3). We also need to ensure business hours and weekends is ignored when doing this calculation.
example if case timezone is emea and case priority is P1 and rule says customer should be replied in 1 hour then calculate response time(new field). This should consider business hours only(weekends to be ignored).

I believe this can only be done with APEX, don't think there is simple way to do this via formullas?
Any help on apex will be nice.

Thanks.
What would be test class for this code? Can anyone please suggest something. 

Thanks.




global class myMilestoneTimeCalculator implements Support.MilestoneTriggerTimeCalculator {  
     global Integer calculateMilestoneTriggerTime(String caseId, String milestoneTypeId){
        Case c = [SELECT Priority, Priority_On_Complete__c  FROM Case WHERE Id=:caseId];
      
       
        if (c.Priority_On_Complete__c == null)  {
       
       
        if (c.Priority != null && c.Priority.equals('P1'))
              return 3;
       
        else
       
        if (c.Priority != null && c.Priority.equals('P2'))
               
            return 6;
        
        else
        if (c.Priority != null && c.Priority.equals('P3'))
            return 9;
       
        else return 0;
        }
        else  {
            if (c.Priority_On_Complete__c.equals('P1'))
              return 3;
       
        else
       
        if (c.Priority_On_Complete__c.equals('P2'))
               
            return 6;
        
        else
        if (c.Priority_On_Complete__c.equals('P3'))
            return 9;
       
        else return 0;
           
           
        }
       
                       
     }
}
if i have something in a field as below. I need to pull field1 and field2 and put values to respective field on case, how do i do with apex?

Thanks


[field1]
value

[field2]
value2 with 5 lines
dffdd
dff
ddfd
dfd df fd



ERROR:
15:33:36.389 (12389752771)|SOQL_EXECUTE_BEGIN|[1180]|Aggregations:0|select Id from BusinessHours where (TimeZoneSidKey = :tmpVar1 and Name like '08x05%')
15:33:36.389 (12389782974)|EXCEPTION_THROWN|[1180]|System.LimitException: Too many SOQL queries: 101
15:33:36.389 (12389962129)|METHOD_EXIT|[31]|01pG00000045Dj6|CT_CaseTriggerHandler.setBusinessHours(LIST<Case>)
15:33:36.390 (12390066361)|FATAL_ERROR|System.LimitException: Too many SOQL queries: 101

Class.CT_CaseTriggerHandler.setBusinessHours: line 1180, column 1
Trigger.CaseAfterUpdate: line 31, column 1
15:33:36.390 (12390091595)|FATAL_ERROR|System.LimitException: Too many SOQL queries: 101

Class.CT_CaseTriggerHandler.setBusinessHours: line 1180, column 1
Trigger.CaseAfterUpdate: line 31, column 1
15:33:36.390 (12390326072)|CODE_UNIT_FINISHED|CaseAfterUpdate on Case trigger event AfterUpdate for [50011000002857m, 500110000028QQu, 50011000002BXoA,




CODE:
//Set the business hours on the case
    public static void setBusinessHours(List<Case> lCases)
    {
        List<Case> caseList = [SELECT Id, BusinessHoursId, EntitlementId, Entitlement.SlaProcess.Name, Case_Timezone__r.TimeZoneSidKey__c FROM Case WHERE Id in :lCases];
       
        for (Case c :caseList)
        {
            if (c.EntitlementId != null)
            {
                try
                {
                    if (c.Entitlement.SlaProcess.Name == 'Mission Critical' || c.Entitlement.SlaProcess.Name == 'Mission Critical (GCS Management Override)')
                        c.BusinessHoursId = [SELECT Id FROM BusinessHours WHERE TimeZoneSidKey = :c.Case_Timezone__r.TimeZoneSidKey__c AND Name Like '08x05%'].Id;
                    else if (c.Entitlement.SlaProcess.Name == 'Enterprise' || c.Entitlement.SlaProcess.Name == 'Enterprise (GCS Management Override)')
                        c.BusinessHoursId = [SELECT Id FROM BusinessHours WHERE TimeZoneSidKey = :c.Case_Timezone__r.TimeZoneSidKey__c AND Name Like '08x05%'].Id;
                    else if (c.Entitlement.SlaProcess.Name == 'Standard')
                        c.BusinessHoursId = [SELECT Id FROM BusinessHours WHERE TimeZoneSidKey = :c.Case_Timezone__r.TimeZoneSidKey__c AND Name Like '08x05%'].Id;
                   
                    update c;
                }
                catch (exception e)
                {
                    System.debug ('===== Error in SetBusinessHours: ' + e.getMessage() + ' =====');
                }      
            }
        }
    }