• Kasrift
  • NEWBIE
  • 10 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 5
    Replies
I have a question about adding a Box.com embedded widget to the Standard Case Layout.  I tried adding it as a VF component which was then referenced in a VF page and I tried adding it directly to a VF page.  When I do either of these and add it to a section on the Case Layout, the documents on Box.com don't seem to allow for fullscreen functionality.

My question is this, was this something that was changed at some point?  I seem to remember that it worked when I clicked on the full screen button in the box.com widget that it would full screen on the browser, not just the section that the embed is placed on.  I reached out to Box.com and they said that Salesforce sees it as an iframe within an outer iframe (which SF controls).  Does anyone else know how to make the full screen functionality of the Box.com widget work properly or able to provide feedback/confirmation that this won't work on a standard Case layout.  I'm assuming that if I make the whole page a VF page and create the fields, layout, and embed on the custom VF page that the full screen functionality will work.
  • September 03, 2014
  • Like
  • 0
Hello,

I've created a custom VF page which looks exactly how I want it in the preview, however I am not quite sure how to implement it the way that I would like.  The VF is a custom page that looks like the Case record creation page with a dynamic field component.  Everything looks fine on the VF page, but I was curious what the requirements are for creating a custom button that can be used as a list button.

The issue I'm having is that the button I want to create is on Cases.  I want to have the button show on the list view of Cases on the Opportunity detail page (Cases has a lookup field to Opportunities & there is no master/detail or parent relationship).  Using a standard controller for Cases, I can't get a record to be created properly and end up with the error "ID value ..... is not value for the Case standard controller".  I understand that I am using the Standard controller for Cases on the Opportunity page layout, but I'm not sure what I need to adjust to make this button work properly.  Any help would be appreciated.

-Stephen

I was wondering how to properly consolidate multiple triggers (specifically for field updates) into one trigger.  I had separate triggers for multiple field updates, the first and most important one being multiple field updates from the Case Description field (the one that the default Email to Case On Demand writes to).  The Apex code to get the information from the email into fields looks like this:

 

trigger trgr_CaseDescriptionPreFormat on Case (before Insert, before Update) {

    Map<String, String> fieldListMap = new Map<String, String>{
        'State'         => 'State__c',
        'City'          => 'City__c',
        'Explanation 1' => 'Explanation_1__c',
        'Explanation 2' => 'Explanation_2__c',
        'Explanation 3' => 'Explanation_3__c',
        'Explanation 4' => 'Explanation_4__c',
        'Explanation 5' => 'Explanation_5__c',
        'Name'          => 'Name__c'
    };

    List<String> descpSplitList;
    List<String> labelValuePairSplitList;
    for(Case cas : trigger.new){
        if(!String.isBlank(cas.Description)){
            descpSplitList = cas.Description.split('\n');
       
            for(String labelValuePair : descpSplitList){
                labelValuePairSplitList = labelValuePair.split(':');
                if (
                    labelValuePairSplitList.size() > 1 &&
                    fieldListMap.containsKey(labelValuePairSplitList[0])
                ) {
                    cas.put(fieldListMap.get(labelValuePairSplitList[0]), labelValuePairSplitList[1]);
                }
            }
        }
    }
}

 

I had other Apex triggers to update fields based on the fields that were written to by the Description field Apex.  They are basic field updates that update another field Tier 1-5 based on the values of the Explaination 1-5 that look like this:

 

trigger FieldUpdateTier1 on Case (before insert, before update){
Map<String, String> myPickListMap = new Map<String, String> {'Explaination 1 value1'=>'Tier 1',
'Explaination 1 Value 2'=>'Tier 2',
'Explaination 1 Value 3'=>'Tier 3',
'Explaination 1 Value 4'=>'Tier 4',
'Explaination 1 Value 5'=>'Tier 5'};
for (Case c : Trigger.new){
if(c.AEM__c != null) {
c.Explaination_1__c = myPickListMap.get(c.Tier1__c);
}
}

 

 

I originally had 5 separate triggers for each filed update, but then I realized they use the same map, so I updated the Apex  code to look like this :

 

trigger FieldUpdateTier1 on Case (before insert, before update){
Map<String, String> myPickListMap = new Map<String, String> {'Explaination 1 value1'=>'Tier 1',
'Explaination 1 Value 2'=>'Tier 2',
'Explaination 1 Value 3'=>'Tier 3',
'Explaination 1 Value 4'=>'Tier 4',
'Explaination 1 Value 5'=>'Tier 5'};
for (Case c : Trigger.new){
c.Explaination_1__c = myPickListMap.get(c.Tier1__c);

c.Explaination_2__c = myPickListMap.get(c.Tier2__c);

c.Explaination_3__c = myPickListMap.get(c.Tier3__c);

c.Explaination_4__c = myPickListMap.get(c.Tier4__c);

c.Explaination_5__c = myPickListMap.get(c.Tier5__c);
}
}

 

 

The issue that I have now is the order of execution for the triggers.  An email creates a case, which writes the email body into the Case field Description.  I want the Apex Trigger to string the values from the Description field into specific fields on the Case, which it does.  But I can't get the field updates to fire properly to update the other fields after the Description updates the Explaination fields.  I tried consolidating the Apex trigger even further from two Apex triggers into one, which looks like this:

 

trigger trgr_CaseDescriptionPreFormat on Case (before Insert, before Update) {

Map<String, String> fieldListMap = new Map<String, String>{
'State' => 'State__c',
'City' => 'City__c',
'Explanation 1' => 'Explanation_1__c',
'Explanation 2' => 'Explanation_2__c',
'Explanation 3' => 'Explanation_3__c',
'Explanation 4' => 'Explanation_4__c',
'Explanation 5' => 'Explanation_5__c',
'Name' => 'Name__c'
};

List<String> descpSplitList;
List<String> labelValuePairSplitList;


Map<String, String> myPickListMap = new Map<String, String> {'Explaination 1 value1'=>'Tier 1',
'Explaination 1 Value 2'=>'Tier 2',
'Explaination 1 Value 3'=>'Tier 3',
'Explaination 1 Value 4'=>'Tier 4',
'Explaination 1 Value 5'=>'Tier 5'};


for(Case c : trigger.new){
if(!String.isBlank(c.Description)){
descpSplitList = c.Description.split('\n');

for(String labelValuePair : descpSplitList){
labelValuePairSplitList = labelValuePair.split(':');
if (
labelValuePairSplitList.size() > 1 &&
fieldListMap.containsKey(labelValuePairSplitList[0])
) {
cas.put(fieldListMap.get(labelValuePairSplitList[0]), labelValuePairSplitList[1]);
}
}
}
c.Explaination_1__c = myPickListMap.get(c.Tier1__c);
c.Explaination_2__c = myPickListMap.get(c.Tier2__c);
c.Explaination_3__c = myPickListMap.get(c.Tier3__c);
c.Explaination_4__c = myPickListMap.get(c.Tier4__c);
c.Explaination_5__c = myPickListMap.get(c.Tier5__c);
}

}

}

 

 

However it isn't updating the fields after the first part of the trigger.  Can anyone assist with this (I'm really new to coding and still trying to figure this out).   Hopefully I explained the situation well enough, long story short, I'm trying to multiple field updates on the same object the Case in a specific order which requires fields to be updated first in order for other fields to be updated via the inlcuded apex trigger.

 

-Stephen

 

I'm new to Apex (and coding) and was wondeirng if it was possible to update fields from the EmailMessage.Textbody with an ApexTrigger rather than creating a custom inbound email handler service.  It seems like it would  be easier to just utilize the Email to Case On Demand feature, and have a trigger to parse the data from the default field that the email text body goes to on the Case.  So I know that I need to string the emailbody with substrings for where I want to start capturing the data, and I know that I want to set the string values equal to the Case fields.  Any other help setting this up would be appreciated.  So far I have code that looks like this, but it isn't functional since I don't know what I need to put in between the two statements to complete the code:

 

trigger TextBody on Case (before insert) {
String[] emailBody = email.plainTextBody.split('\n', 0);
String Site = emailBody[0].substring(17);
String State = emailBody[2].substring(25);
String Field1 = emailBody[4].substring(17);
String Field2 = emailBody[6].substring(18);
String Field3 = emailBody[8].substring(16);
String Field4 = emailBody[10].substring(17);
String Field5 = emailBody[12].substring(17);
String Codes = emailBody[14].substring(17);
String Name = emailBody[16].substring(17);
}

 

this.theCase = new Case();
this.theCase.Status = 'Open';
this.thCase.Priority = 'Low';
this.theCase.Site__c = Site;
this.theCase.State__c = State;
this.theCase. Field_1__c = Field1;
this.theCase. Field_2__c =  Field2;
this.theCase. Field_3__c =  Field3;
this.theCase. Field_4__c =  Field4;
this.theCase. Field_5__c =  Field5;
this.theCase.Codes__c = Codes;
this.theCase.Name__c = Name;
this.theCase.Origin = 'Email';
this.theCase.Subject = email.Subject;
this.theCase.Description = email.plainTextBody;

  • September 30, 2013
  • Like
  • 0

Hello,

 

I'm not a developer and really new to this.  I had a question and was wondering if someone had a solution or could point me in the right direction.  I have a picklist field on the Case object, that when a value is selected, I would like it to update another picklist field with a value.  The picklist values for the two custom fields are not related by name, but there are equal amounts of picklist values (i.e. field_1 has 32 picklist options & code_1 has 32 options).  I don't want to do a workflow for field updates since I would have to do all 32 options, plus the field needs to be cloned to be 5 similar fields.  This would require too many workflows.  Also, the field_1 picklist options are REALLY long sentences, which I want to update a corresponding field code_1 with the 4 digit code of the field_1 option.  I tried writing a formula field, but ran out of characters before I could list all of the picklist options (other than that, it worked fine).

 

Ideally, I would like to use Apex to make this work.  I have a basic code, but I'd rather not hard code the picklist values in in case they change.  This is what my basic structure looks like:

 

trigger FieldUpdate on Case (before insert, before update, after insert, after update){
// Loop through the incoming records
for (Case c : Trigger.new){
if(c.field_1__c == 'blah blah blah, really long sentence'
&& c.code_1__c == null){c.code_1__c = 'COD1';
}else if (c.AEM_Violation_1__c == 'Equally long descriptive sentence...”'
&& c.AEM__c == null){c.AEM__c = 'COD2';
}else if ....
}
}
}

 

Basically, hard coding the field to update will require me to list all 32 reasons, and then make triggers for each of the 4 other fields that have the same values.  Is there any way to do this in a more efficient manner that doesn't require me to hard code each of the picklist values?

  • September 13, 2013
  • Like
  • 1

Hello,

 

I'm not a developer and really new to this.  I had a question and was wondering if someone had a solution or could point me in the right direction.  I have a picklist field on the Case object, that when a value is selected, I would like it to update another picklist field with a value.  The picklist values for the two custom fields are not related by name, but there are equal amounts of picklist values (i.e. field_1 has 32 picklist options & code_1 has 32 options).  I don't want to do a workflow for field updates since I would have to do all 32 options, plus the field needs to be cloned to be 5 similar fields.  This would require too many workflows.  Also, the field_1 picklist options are REALLY long sentences, which I want to update a corresponding field code_1 with the 4 digit code of the field_1 option.  I tried writing a formula field, but ran out of characters before I could list all of the picklist options (other than that, it worked fine).

 

Ideally, I would like to use Apex to make this work.  I have a basic code, but I'd rather not hard code the picklist values in in case they change.  This is what my basic structure looks like:

 

trigger FieldUpdate on Case (before insert, before update, after insert, after update){
// Loop through the incoming records
for (Case c : Trigger.new){
if(c.field_1__c == 'blah blah blah, really long sentence'
&& c.code_1__c == null){c.code_1__c = 'COD1';
}else if (c.AEM_Violation_1__c == 'Equally long descriptive sentence...”'
&& c.AEM__c == null){c.AEM__c = 'COD2';
}else if ....
}
}
}

 

Basically, hard coding the field to update will require me to list all 32 reasons, and then make triggers for each of the 4 other fields that have the same values.  Is there any way to do this in a more efficient manner that doesn't require me to hard code each of the picklist values?

  • September 13, 2013
  • Like
  • 1
I have a question about adding a Box.com embedded widget to the Standard Case Layout.  I tried adding it as a VF component which was then referenced in a VF page and I tried adding it directly to a VF page.  When I do either of these and add it to a section on the Case Layout, the documents on Box.com don't seem to allow for fullscreen functionality.

My question is this, was this something that was changed at some point?  I seem to remember that it worked when I clicked on the full screen button in the box.com widget that it would full screen on the browser, not just the section that the embed is placed on.  I reached out to Box.com and they said that Salesforce sees it as an iframe within an outer iframe (which SF controls).  Does anyone else know how to make the full screen functionality of the Box.com widget work properly or able to provide feedback/confirmation that this won't work on a standard Case layout.  I'm assuming that if I make the whole page a VF page and create the fields, layout, and embed on the custom VF page that the full screen functionality will work.
  • September 03, 2014
  • Like
  • 0
Hello,

I've created a custom VF page which looks exactly how I want it in the preview, however I am not quite sure how to implement it the way that I would like.  The VF is a custom page that looks like the Case record creation page with a dynamic field component.  Everything looks fine on the VF page, but I was curious what the requirements are for creating a custom button that can be used as a list button.

The issue I'm having is that the button I want to create is on Cases.  I want to have the button show on the list view of Cases on the Opportunity detail page (Cases has a lookup field to Opportunities & there is no master/detail or parent relationship).  Using a standard controller for Cases, I can't get a record to be created properly and end up with the error "ID value ..... is not value for the Case standard controller".  I understand that I am using the Standard controller for Cases on the Opportunity page layout, but I'm not sure what I need to adjust to make this button work properly.  Any help would be appreciated.

-Stephen

Hello,

 

I'm not a developer and really new to this.  I had a question and was wondering if someone had a solution or could point me in the right direction.  I have a picklist field on the Case object, that when a value is selected, I would like it to update another picklist field with a value.  The picklist values for the two custom fields are not related by name, but there are equal amounts of picklist values (i.e. field_1 has 32 picklist options & code_1 has 32 options).  I don't want to do a workflow for field updates since I would have to do all 32 options, plus the field needs to be cloned to be 5 similar fields.  This would require too many workflows.  Also, the field_1 picklist options are REALLY long sentences, which I want to update a corresponding field code_1 with the 4 digit code of the field_1 option.  I tried writing a formula field, but ran out of characters before I could list all of the picklist options (other than that, it worked fine).

 

Ideally, I would like to use Apex to make this work.  I have a basic code, but I'd rather not hard code the picklist values in in case they change.  This is what my basic structure looks like:

 

trigger FieldUpdate on Case (before insert, before update, after insert, after update){
// Loop through the incoming records
for (Case c : Trigger.new){
if(c.field_1__c == 'blah blah blah, really long sentence'
&& c.code_1__c == null){c.code_1__c = 'COD1';
}else if (c.AEM_Violation_1__c == 'Equally long descriptive sentence...”'
&& c.AEM__c == null){c.AEM__c = 'COD2';
}else if ....
}
}
}

 

Basically, hard coding the field to update will require me to list all 32 reasons, and then make triggers for each of the 4 other fields that have the same values.  Is there any way to do this in a more efficient manner that doesn't require me to hard code each of the picklist values?

  • September 13, 2013
  • Like
  • 1

Hi,

 

I overrided case view button with a visualforce page. When I created  a service cloud console app, and opened a case record, it displays External Page. Is there a way to rename the page with the case number.

 

Thanks in advance.

 

  • June 10, 2011
  • Like
  • 0