• Harisa Hashimuddin
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 7
    Replies
I have been going through the SF docs for Einstein Image Recognition API. Could someone please explain the use of JWT for authorization?
Can some help me with the design to follow to notify salesforce changes to external rest api
If i create a new account in salesforce it should be notified to external system through rest api
which is the best way ? to use triggers or batch or any other ?
I need to analyse the community performance and get report by weekly and monthly wise. Request you to suggest the best possible way to achieve this.

Thanks in Advance.

 
Hi all,

I have one scenario where i want to add new value into picklist field on object everytime record created related to that object.
I tried updating field using process builder..  when we check restrict checkbx on picklist field it wont allow new value but if we dont check that checkbox new values are overwriiten to old values. but i want to update it with old and new values.

can we achieve this without using apex.?? 
 
  • September 11, 2018
  • Like
  • 0
I'm working on Service Cloud Basics module, Part 2: Automate Case Management on Trailhead. I'm on instruction #7 in the Add an Auto-Response Rule section. It's requesting that I add an email address to the form to be used as the "from" field on an email auto response. However, I'm not able to save the form becuase the email address that I've provided "is an invalid From email address." I've entered "support@somewhere.com" which, I believe, is a properly formatted email address. I'm guessing that it has to do with it being a non-verified "organization-wide email address" in my SalesForce instance.

Well I've added this ficticious email to my "organization-wide email addresses" but didn't realize that it needs to be verified. I don't own the "somewhere.com" domain to access and verify this email address. Do I really have to use a valid email account? Did I miss something?

The trail doesn't mention this requirement. This is my first foray into Sales Force and I had to poke around a bit to figure this out. Would be helpful if it had you add a VALID email address first.
Hello,

 I am writing a code. where i am uploading a logo. Now my issue is when my image size is more than 5 mb then it shows error message seperated like this "Maximum view state size limit (135KB) exceeded. Actual view state size for this page was 156.812KB". I want that it should throw eeror pop up message on the same window



public with sharing class DocumentController {
 public Feedback_Main__c feedbackmain{get;set;}
 public ID folderid{get;set;}
 public Blob file{get;set;}

public DocumentController() {
feedbackmain = new Feedback_Main__c();
Organization org =[select Id,InstanceName from Organization limit 1];

//List<String>AcutalBaseUrl =BaseUrl.split('.');
//system.debug('AcutalBaseUrl'+AcutalBaseUrl[0]);
 }

public PageReference Manage(){
PageReference pg = new PageReference('apex/SBAddQuestionPage');
pg.setRedirect(true);
return pg;
}

public PageReference saveAndRedirect() {
 Id OrgId = UserInfo.getOrganizationId();
 Folder FolderObj = [Select Id From Folder Where Name = 'Survey Builder' limit 1];
 Document d= new Document();

 d.name = 'LOGO';
 d.body=file; // body field in document object which holds the file.
 d.IsPublic = true;
 d.ContentType ='image/png';
 d.Type = 'png';

 d.folderid = FolderObj.Id; //folderid where the document will be stored insert d;
 if (Document.SObjectType.getDescribe().isCreateable())
 {
 try{
     insert d;
     }
    catch (DMLException e)   {    
                          // catch (System.LimitException e) {
                             ApexPages.addMessage(new ApexPages.message(ApexPages.severity.ERROR,'File Size is more than 5MB'));
                           return null;
                        }
      
 }
Organization org =[select Id,InstanceName from Organization limit 1];
//(Sandbox)feedbackmain.Image__c = '<img src="https://c.cs41.content.force.com/servlet/servlet.ImageServer?id='+d.id+'&oid='+OrgId+'"></img>';
feedbackmain.Image__c = '<img src="https://c.'+org.InstanceName+'.content.force.com/servlet/servlet.ImageServer?id='+d.id+'&oid='+OrgId+'"></img>';

 
  system.debug('++++++++++D ID+++++++++++'+feedbackmain.Image__c);
  insert feedbackmain; // This takes care of the details for you.
  PageReference redirectPage = Page.SBAddQuestionPage;
  redirectPage.setRedirect(true);
  return redirectPage;
}


}


VF Page:
<apex:page controller="DocumentController" sidebar="false" showHeader="false" standardStylesheets="true" docType="html-5.0">
<apex:form >
<apex:pageMessages ></apex:pageMessages>
<html>
<head>

<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Create Survey</title>
<apex:stylesheet value="https://fonts.googleapis.com/css?family=Roboto:400,300,500,700,900"/>
<apex:stylesheet value="{!$Resource.SurveyMaster}"/>
<apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"/ >
<!--<link href="https://fonts.googleapis.com/css?family=Roboto:400,300,500,700,900" rel="stylesheet" type="text/css">
<link href="assets/css/master.css" rel="stylesheet">-->

<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
  <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
  <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<script>
<!--$(document).ready(function(){
    $(".NextOne").click(function(){
        $(".NameDiv").hide();
        $(".HeaderFooterDiv").show();
        return false;
    });
});

$(document).ready(function(){
    $(".NextTwo").click(function(){
        $(".HeaderFooterDiv").hide();
        $(".ContactDiv").show();
        return false;
    });
});-->

function CheckFbName(ReceiveInputID){
    var inputValue = document.getElementById(ReceiveInputID).value;
    if(inputValue.length==0 || inputValue == ''){
        alert("Please enter Survey Name.");
        $(".NextOne").click(function(){
            $(".NameDiv").show();
            $(".HeaderFooterDiv").hide();
            $(".ContactDiv").hide();
            return false;
        });
    }
    else
        $(".NextOne").click(function(){
        $(".NameDiv").hide();
        $(".HeaderFooterDiv").show();
        $(".ContactDiv").hide();
        return false;
    });
}

function myFunction() {
    window.open("https://cs41.salesforce.com/apex/AddQuestionPage");
}


</script>
<style>
.lookupIcon {
 background-image: url('{!$Resource.LookupIcon}') !important;
 height:30px !important;
 width:30px !important;
 position:absolute !important;
 top:6px !important;
 right:-25px !important;
}

.lookupIconOn {
 background-image: url('{!$Resource.LookupIcon}') !important;
 height:30px !important;
 width:30px !important;
 position:absolute !important;
 top:6px !important;
 right:-25px !important;
}

@import url(http://fonts.googleapis.com/css?family=Nunito:300);

body { font-family: "Nunito", sans-serif; font-size: 24px; }
a    { text-decoration: none; }
p    { text-align: center; }
sup  { font-size: 36px; font-weight: 100; line-height: 55px; }

.button
{
    text-transform: none;
    letter-spacing: 0px;
    text-align: center;
    color: #0C5;
    font-size: 20px;
    font-family: "Nunito", sans-serif;
    font-weight: 300;
    position: absolute;
    top: 11px;
    right: 0;
    bottom: 0;
    left: 56.6%;
    padding: 10px 0;
    width: 236px;
    height: 43px;
    background: #00a1e1;
    border: 1px solid #00a1e1;
    color: #FFF;
    overflow: hidden;
    transition: all 0.5s;
    float: right !important;
    border-radius: 20px;
}

.button:hover, .button:active
{
  text-decoration: none;
  color: #00a1e1;/*#0C5*/
  border-color: #00a1e1;
  background: #FFF;
}

.button span
{
  display: inline-block;
  position: relative;
  padding-right: 0;
 
  transition: padding-right 0.5s;
}

.button span:after
{
  content: ' ';  
  position: absolute;
  top: 0;
  right: -18px;
  opacity: 0;
  width: 10px;
  height: 10px;
  margin-top: -10px;

  background: rgba(0, 0, 0, 0);
  border: 3px solid #FFF;
  border-top: none;
  border-right: none;

  transition: opacity 0.5s, top 0.5s, right 0.5s;
  transform: rotate(-135deg);
}

.button:hover span, .button:active span
{
  padding-right: 30px;
}

.button:hover span:after, .button:active span:after
{
  transition: opacity 0.5s, top 0.5s, right 0.5s;
  opacity: 1;
  border-color: #00a1e1;
  right: 10px;
  top: 70%;
}
</style>
</head>
<body>
<header class="mainHeader">
    <div class="container clear">
        <a href="/apex/SBIndex" class="logo"><img src="{!$Resource.MainLogo}" alt=""/></a>
        <div class="nav">
            <ul>
                <li><a href="/apex/SBIndex" class="home"><img src="{!$Resource.HomeIcon}" alt=""/></a></li>
                <li><a href="/apex/SBQuestionBank">Question Bank</a></li>
                <li class="active"><a href="/apex/SBCreateSurvey">Create Survey</a></li>
                <li><a href="/apex/SBSendSurvey">Send Survey</a></li>
                <li><a href="/apex/SBREPORT">Report</a></li>
            </ul>
        </div>
    </div>
</header>
<section class="page-name">
    <div class="container clear">
        <h2>Create Survey</h2>
    </div>
</section>
<section class="bodyContainer">
    <div class="container clear">
        <div class="white-box">
            <div class="mainForm">
                <!--<apex:commandButton value="View Existing Surveys" action="{!Manage}" styleClass="green-btn" style="float:right !important;"/>-->
                <a href="/apex/SBAddQuestionPage" class="button"><span>View Existing Surveys</span></a>
                <hr />
                <div class="formFeild">
                    <label>Please enter the name for survey:</label>
                    <div class="feild">
                        <apex:inputText value="{!feedbackmain.Feedback_Name__c}" html-placeholder="Enter name for the survey" id="FbName" required="true" rendered="true"/>
                    </div>
                </div>
                <div class="formFeild">
                    <label>Upload Logo (5 MB Max. size):</label>
                    <div class="feild">
                        <apex:inputfile value="{!file}"  ></apex:inputfile>
                  <!--     <apex:inputTextarea richText="true" value="{!feedbackmain.Image__c}"  html-placeholder="Logo" styleClass="text-editor"/> -->
                    </div>
                </div>
                <div class="formFeild">
                    <label>Header Text:</label>
                    <div class="feild">
                        <apex:inputTextarea value="{!feedbackmain.Header_Text__c}" html-placeholder="Header Text"/>
                    </div>
                </div>
                <div class="formFeild">
                    <label>Footer Text:</label>
                    <div class="feild">
                        <apex:inputTextarea value="{!feedbackmain.Footer_text__c}" html-placeholder="Footer Text"/>
                    </div>
                </div>
                <div class="formFeild">
                    <label>Survey Owner:</label>
                  <div class="feild">
                    <apex:inputField value="{!feedbackmain.Feedback_Taken_by_Contact__c}" required="true"/>
                        <!--<div class="outside-btn">
                            <a href="" class="survey-btn"><img src="assets/images/survey-view-btn.png" alt=""/></a>
                        </div>-->
                    </div>
                </div>
                <div class="formFeild">
                    <label>&nbsp;</label>
                    <div class="feild">
                       <apex:commandButton value="Save" action="{!saveAndRedirect}" style="display: inline-block !important; padding:3px 15px !important; line-height:35px !important; color:#fff !important; font-size:15px !important; background:#75C181 !important; border-radius:35px !important; margin-bottom:15px !important; min-width:125px !important; text-align:center !important;"/>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>

<footer class="main-footer">
    <ul>
        <li><a href="#" style="font-size: 17px;">Privacy Policy</a></li>
        <li><a href="#" style="font-size: 17px;">Terms of Services</a></li>
    </ul>
    <div class="copyright" style="font-size: 17px;">© 2016 Survey Builder, All rights reserved. </div>
</footer>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
</body>
</html>
</apex:form>
</apex:page>
Hi Team,
We are facing some issues when it will create CASE record in salesforce. We have implemented Email to Case standard features is our production org. when we are sending email to particular mail box with copy of cc someone then as per designed case is created successfully in to Salesforce. But before someone reply from Salesforce, some body who's copied in that email, they started sending email using same email thread from outlook. So its getting generated new case whenever Salesforce receive email. Since no body reply back from Salesforce, so there is no ref number also.
Please find the below example for your understanding
Current Issues :
1. XYZ customer sending email with CC people and subject name as "ABC" to salesforce and case got Created Salesforce with Subject name as "ABC".
2. Immediately CC people replying to email message using same email thread in outlook.
3. Salesforce will receive one more email with same subject name as "ABC" and new case will be created.

Expected Solution:
1. Only one case should be created under same subject name as "ABC". Even though if Salesforce receive multiple email from outlook with same subject.
2. We need to capture the Email information from cc people. (Technically, we need to capture the Email message records not case record)
3. All Email Message should comes under same Case.

As part of the above scenario, I have wriiten some logic in before insert trigger on Email message object and i am successfully able to idenity the Same subject and delete the duplicate case.
Now my question, is there any way to distinguish the case other than subject. Also I have checked on Email Message object, it storing Email Headers. Is there any unique way to identfier using Email Header ??

Any help, really appreciate
thanks,