• mitsvik
  • NEWBIE
  • 20 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 24
    Questions
  • 34
    Replies
I am extremely new to LWC. InFACT just new to apex as well..but my first assignment i have to create a small component which takes a text value and is appended to opportunity record existing field and then sends an email to owners managers...i have the basic HTML, JAVASCRIPT AND APEX written,

However i was told not use wire and instead call the apex imperatively, So On click of submit button the apex methos will udpate the opportunity record and send an email and I have to reload the existing opporecord page with updated values.
Can someone help me correct my javascript handleclick funcation?
javascript
import { LightningElement, track, api } from 'lwc';
import updateCommentsNextStepsOnOpportunity from "@salesforce/apex/opportunityCommentController.updateCommentsNextStepsOnOpportunity";


export default class OpportunityCommentUpdate extends LightningElement {
  
    @api recordId;
    @track newComment = '';

    
	 trackComment(event){
          this.newComment = event.detail.value;
      }


	  handleClick() {
     
      updateCommentsNextStepsOnOpportunity(recordId, newComment)
        .then(result => {
          
          window.location = "opportunity/" + this.recordId;
        })
        .catch(error => {
          this.error = error;
        });
    }
  
     

	  handleCancel(event){
	 
    }
	}


APEX:
public without sharing class opportunityCommentController {
    

	
	 @AuraEnabled
	 public static void updateCommentsNextStepsOnOpportunity(Id recordId, String newComment) {
        
        
        
        Opportunity selectedOpp = [SELECT Id, Comments_Next_Steps__c, Description, OwnerId from opportunity where id =: recordId ];
        
        selectedOpp.Comments_Next_Steps__c=System.today().format()+' '+ newComment;
        string temp = selectedOpp.Description;
        
        if(temp==null && !string.isNotBlank(temp)){
            selectedOpp.Description = selectedOpp.Comments_Next_Steps__c;  
            
        }else if(temp!=null && string.isNotBlank(temp)){
            selectedOpp.Description =  selectedOpp.Comments_Next_Steps__c +'\n' +temp;
        }
        
        
        update selectedOpp;
		sendEmailToRVPandRD(selectedOpp);
    }
    
	
	
    public static void sendEmailToRVPandRD(Opportunity selectedOpp) {
        
        List<String> emailList = new List<String>();
        List<Messaging.SingleEmailMessage> mails = new List<Messaging.SingleEmailMessage>();
        
        User getRVPRDEmail = [SELECT Id, Reports_to_RVP__r.Email, Reports_to_RD__r.Email, Username FROM User where id =:selectedOpp.OwnerId];
        
        emailList.add(getRVPRDEmail.Reports_to_RVP__r.Email);
        emailList.add(getRVPRDEmail.Reports_to_RD__r.Email);
        Messaging.SingleEmailMessage sendEmailmsg = new Messaging.SingleEmailMessage();
        sendEmailmsg.toaddresses= emailList;
        string body='';
        body += '<html></br> </br>' + 'A comment has been added to the opportunity record , '
            + '<a href="'+URL.getSalesforceBaseUrl().toExternalForm()
            +'/'+ selectedOpp.id +'">' + '</a>';
        body +=  '</body></html>';
        
        sendEmailmsg.setHtmlBody(body);
        string Subject = 'A comment has been added to the opportunity record '+''+ selectedOpp.Name;
        sendEmailmsg.setSubject(Subject);
        
        mails.add(sendEmailmsg);
        
  
    Messaging.sendEmail(mails);
    
}
}


html
template>
    <lightning-card title="Add Comments">
        <div class="slds-m-around_medium">
          

                <lightning-textarea name="input1" label="Enter new comment" onchange={trackComment}></lightning-textarea>
                <lightning-button variant="neutral"
                                  label="Cancel"
                                  title="Cancel"
                                  type="text"
                                  onclick={handleCancel}
                                  class="slds-m-right_small"></lightning-button>

                <lightning-button variant="brand"
                                  label="Submit"
                                  title="Submit"
                                  onclick={handleClick}
                                  type="submit"></lightning-button>
           
        </div>
    </lightning-card>
</template>

 
public class sendEmailIntrestedPartyCaseCreateUpdate {
    
    
    public static void sendEmailtoIntrestedPartyOnCase(List<Case> listOfCases){
        
        Set<Id> AccountIds = new Set<Id>(); 
        Map<Id,Set<String>> mapOfInterestedP1toAccounttoUserEmail = new Map<id,Set<String>>();
        Map<Id,Set<String>> mapOfInterestedAlltoAccounttoUserEmail = new Map<id,Set<String>>();
        for(Case caseRecord: listOfCases){
            if(caseRecord.AccountId!=null){
                AccountIds.add(caseRecord.AccountId);
                
            }
        }
        for(Interested_Party__c ipRecords: [SELECT Id, Name, Account__c, P1_Cases__c, All_Cases__c, UserEmail__c
                                            FROM Interested_Party__c where Account__c IN: AccountIds ]){
                                                
                                                
                                                //p1 map population
                                                if(ipRecords.P1_Cases__c){
                                                    if(!mapOfInterestedP1toAccounttoUserEmail.containsKey(ipRecords.Account__c)){
                                                        
                                                        Set<String> lstUserEmails= new Set<String>();
                                                        lstUserEmails.add(ipRecords.UserEmail__c);
                                                        
                                                        mapOfInterestedP1toAccounttoUserEmail.put(ipRecords.Account__c,lstUserEmails);
                                                        
                                                        
                                                    } else if
                                                        (mapOfInterestedP1toAccounttoUserEmail.containsKey(ipRecords.Account__c)){
                                                            Set<String> lstUserEmails= new Set<String>();
                                                            lstUserEmails.add(ipRecords.UserEmail__c);
                                                            
                                                            mapOfInterestedP1toAccounttoUserEmail.get(ipRecords.Account__c).add(ipRecords.UserEmail__c);
                                                        }
                                                }
                                                //all cases map population
                                                if(ipRecords.All_Cases__c){
                                                    if(!mapOfInterestedAlltoAccounttoUserEmail.containsKey(ipRecords.Account__c)){
                                                        
                                                        Set<String> lstUserEmails= new Set<String>();
                                                        lstUserEmails.add(ipRecords.UserEmail__c);
                                                        
                                                        mapOfInterestedAlltoAccounttoUserEmail.put(ipRecords.Account__c,lstUserEmails);
                                                        
                                                    } else if
                                                        (mapOfInterestedAlltoAccounttoUserEmail.containsKey(ipRecords.Account__c)){
                                                            Set<String> lstUserEmails= new Set<String>();
                                                            lstUserEmails.add(ipRecords.UserEmail__c);
                                                            
                                                            mapOfInterestedAlltoAccounttoUserEmail.get(ipRecords.Account__c).add(ipRecords.UserEmail__c);
                                                            
                                                        }
                                                }
                                                /*Email messgging fom here*/
                                                
                                                List<Messaging.SingleEmailMessage> lstMsgs = new List<Messaging.SingleEmailMessage>();
                                                
                                                for(Case varCase: listOfCases){
                                                    Set<String> useremailsSet= new Set<String>();
                                                    
                                                    if(mapOfInterestedAlltoAccounttoUserEmail.containsKey(varCase.AccountId)){
                                                        useremailsSet.addall(mapOfInterestedAlltoAccounttoUserEmail.get(varCase.AccountId));
                                                        system.debug('&&&&&&&((()()'+useremailsSet);
                                                    }
                                                    
                                                    else if (varCase.Priority=='1-Critical'&& mapOfInterestedP1toAccounttoUserEmail.containskey(varCase.AccountId)){
                                                        
                                                        useremailsSet=mapOfInterestedP1toAccounttoUserEmail.get(varCase.AccountId);
                                                        
                                                    }
                                                    List<String> userEmailList = new List<String>();
                                                    userEmailList.addaLL(useremailsSet);
                                                    
                                                    IF(userEmailList.SIZE()>0){
                                                        Messaging.SingleEmailMessage sendEmailmsg = new Messaging.SingleEmailMessage();
                                                        sendEmailmsg.toaddresses= userEmailList;
                                                        string body='';
                                                        body += '<html></br> </br>' + 'A case has been created,for more details, '+  'please review the Case HERE: '
                                                            + '<a href="'+URL.getSalesforceBaseUrl().toExternalForm()
                                                            +'/'+ varcase.id +'">' + varcase.CaseNumber + '</a>';
                                                        body +=  '</body></html>';
                                                        
                                                        sendEmailmsg.setHtmlBody(body);
                                                        
                                                        
                                                        
                                                        String Subject = 'A new Case has been created for the account '+' '+ varcase.Account_Name_Display__c;
                                                        sendEmailmsg.setSubject(Subject);
                                                        lstMsgs.add(sendEmailmsg);
                                                    }
                                                }
                                                
                                                Messaging.sendEmail(lstMsgs);
                                                
                                            }
    }
}
I have an custom object intrested party to Account where i can add users who should be notified when a case for that account in inserted.However if i am the case owner and i create a couple intrested parties....each time a case is created...the case owner based on the above code gets that many number of emails...I am not sure what i neeed to fix...but any help i s appreciated.
 
We want to be able to assigned someone as an "interested party" to an account, and then notify that interested party when someone else is the cases owner of a case for that account.
Can be any number of emails on the account layout).

The 'interested party'  should be at the account level. . Maybe there could be a box where emails addresses for interested parties could be entered and then a flag to say notify them or not.
 but generally we want to be able to assigned someone as an "interested party" to an account, and then notify that interested party when someone else is the cases owner of a case for that account.

We would only want management to assign someone as a interested party."



Approach: Creat a object called interested party and MD realtion to account. add that to related list of account. Have user enter any # of emails....and create a trigger on case to send email when after insert and after update...

some questions i my mind....how can enter mutiple users ..should i do a look up to users on the intrested party object...even then how can i achive more than one email?

also this is not possible via workflow as i will have list of users...

if trigger is the option...how can i get the email from user and associate that to case?
Requirement: if and only iff all the child cases (WITH RECORD TYPE B) are closed then automatically parent case record (rECORD TYPE A) should be closed.
I have written the following code, can some one tell me where i am wrong and also how do i query to suit the record type?

trigger Closeparentcaseauto on Case (before update) {
     Integer counter = 0;
    Set<Id> isparentID = new Set<Id>();----Create a set collection to get all the CHILD cases with parent ID
    
    for(Case cs : trigger.new)
        if(cs.ParentId!=null)
      isparentID.add(cs.ParentId);----From the trigger het the cases where parent id is not null and add it to the set collection.
      
      
      }
     ---loop through the    Cases with the above parent ID and put it in a list collection. ie: collect all the cases with parent ID.             

List<Case> cswithparentIDList = [SELECT Select Id,Status,ParentId From Case where status != 'Closed' and ParentId IN : isparentID];


    

---*/cswithparentIDList---Contains all the cases with the collected parents IDS. and also cases that is open.

---Create a map collection to get the Case with parent id and its child cases as a key value pair.

    Map<Id,List<Case>> caseListMapWithId = new Map<Id,List<Case>>();
    
    for (Case c: cswithparentIDList)
    
    if(caseListMapWithId.containskey(c.parentid)){
    
        caseListMapWithId.get(c.parentid).add(c);
        }else{
        caseListMapWithId.put(c.parentid,c);
        }
        }
        
    Now loop though the child case parent id and status open to loop through its child cases.
    
    for (Case c1: caseListMapWithId.values()){

    
                   
              
                if(c1.Status != 'closed')
                {
                  counter++;
                }
            
        }
         
    for (case  parentcase: cswithparentIDList) {
        
        
            parentcase.Status = 'Closed';
           
   
    }
    
    if (counter == 0){
    update parentcase;}

}
    
biz ask, 
Send an email to person 1 when opportunity is just created
Send another email to person b when Lost or won...

Can I achive this in one Process builder or two separate ones are necessar?
 have set up omni channel and live agent and its working fine. But as you see in the attached, the urls passed from the agent is cut off. What could be wrong?User-added image
For each chat, we can assume it will most likely be a new case. In rare occurrence, we might pick an existing case to add a transcript to. Thus, is there a way to auto-create a case opening it in the Lightning Console Chat Transcript window or sub-tab with some pre-populating of fields without including a case field in the pre-chat? Or is the easiest method to include something like "subject"?

in the State and Country Pick list business would like to deactivate all states besides one state . Also see if that one state can be the default value for the State. As well as the United States for the Country Pick list This change will be reflected in the Address files across all object in Salesforce and affects all users in the system. I also read that appears we can't set the State a default. So what is the bst way to achive this
When a user resets password in production, they get an email from QA_Support@salesforce.com. Is that expected even though it's a production site?
I have been asked to add a optn see underline to the contact object, when a contact is created automatically from case using the following trigger.However, how do i validate this trigger? what should be the process to test this?


trigger AutocreateContactForCase on Case (before insert) {
    List<String> emailAddresses = new List<String>();
    for (Case caseObj:Trigger.new) {
        if (caseObj.ContactId==null && 
            caseObj.Origin == 'Contact Us Web Form' && 
            String.isNotBlank(caseObj.SuppliedEmail)){
                emailAddresses.add(caseObj.SuppliedEmail);
        }
    }
    List<Contact> listContacts = [Select Id,Email From Contact Where Email in :emailAddresses];
    Set<String> takenEmails = new Set<String>();
    for (Contact c:listContacts) {
        takenEmails.add(c.Email);
    }
    
    Map<String,Contact> emailToContactMap = new Map<String,Contact>();
    List<Case> casesToUpdate = new List<Case>();
    Account acc;
    try{
        acc = [Select Id from Account where Name = 'No Account' limit 1];
    }
    catch(Exception ex){system.debug('Error: '+ex.getMessage());}
        
    for (Case caseObj:Trigger.new){
    
        if (caseObj.ContactId==null && caseObj.Origin == 'Contact Us Web Form' && 
                         String.isNotBlank(caseObj.SuppliedName) &&
                             String.isNotBlank(caseObj.SuppliedEmail) &&
                                 !takenEmails.contains(caseObj.SuppliedEmail)){
                                    
            string firstName=''; string lastName='';
            list<string> lstName= caseObj.SuppliedName.split(' ');
            if(lstName!=null && lstName.size()>0){
                if(lstName.size()==1){
                    lastName=lstName[0];
                }else{
                    firstName=lstName[0];
                    for(integer i=1;i<=lstName.size()-1;i++){
                        lastName=lastName+' '+lstName[i];
                    }
                    lastName=lastName.Trim();
                }
                
            }
            Contact cont = new Contact(FirstName=firstName,LastName=lastName,
                                       Email=caseObj.SuppliedEmail,Phone = caseObj.SuppliedPhone
                                       ,AccountId = acc == null?null: acc.Id,Opt_Me_In_For_Future_Communications__c=true,Opt_Me_In_For_Market_Research__c=true,LeadSource='Contact Us Web Form'
                                       );
            emailToContactMap.put(caseObj.SuppliedEmail,cont);
            casesToUpdate.add(caseObj);
        }
        if (caseObj.ContactId==null && caseObj.Origin == 'Contact Us Web Form' &&
                    String.isNotBlank(caseObj.SuppliedName) && 
                    String.isNotBlank(caseObj.SuppliedEmail) &&
                    takenEmails.contains(caseObj.SuppliedEmail)){
                        caseObj.Found_Duplicate_Contacts__c = true;
           }
    }
    try{
        List<Contact> newContacts = emailToContactMap.values();
        system.debug('newContacts: '+newContacts);
        insert newContacts;
    }catch(Exception ex){system.debug('Error: '+ex.getMessage());}
    
    
    for (Case caseObj:casesToUpdate) {
        Contact newContact = emailToContactMap.get(caseObj.SuppliedEmail);        
        caseObj.ContactId = newContact.Id;
    }
}
Business needs a report on case age vs priority vs case owner like User-added image
i got the x axis, created abucket field on aging days (after field aging days formula field within object) and priority.
But i dont want the sum or record count on y axis but individual day values? how is this possible?
 I have the omni channel set up andusing snap in code fo my chat. i am having some issues when the chat window is minimized. Firsttime when a user clicks the chat, the window opens, upon entering the details before submitting if i miminize i get the following error
User-added image
Once i log in and an agent accepts, i get this error in the chat minimized state
User-added image
1) How do i get rid of the above#1 scenario and get to display green live icon and live chat next like below


2) How to get rid of the background and get the same blur color to display....
User-added image


below is my code above the snap in code i currently have...
<apex:page showHeader="false">
<meta name="viewport" content="width=device-width, initial-scale=2, minimum-scale=2"/>

<style type='text/css' standardstylesheets='false'>
     @font-face {
        font-family: 'Omnes Regular';
        font-style: normal;
        font-weight: normal;
        src: url('https://liveagentgk-developer-edition.ap5.force.com/resource/1540193580000/LA_Fonts/omnes-regular-webfont.woff') format('woff');
        }
        
        
        @font-face {
        font-family: 'Omnes ExtraLight';
        font-style: normal;
        font-weight: normal;
        src: url('https://liveagentgk-developer-edition.ap5.force.com/resource/1540193580000/LA_Fonts/omnes_extralight-webfont.woff') format('woff');
        }
        
        
        @font-face {
        font-family: 'Omnes Light';
        font-style: normal;
        font-weight: normal;
        src: url('https://liveagentgk-developer-edition.ap5.force.com/resource/1540193580000/LA_Fonts/omnes_light-webfont.woff') format('woff');
        }
        
        
        @font-face {
        font-family: 'Omnes Medium';
        font-style: normal;
        font-weight: normal;
        src: url('https://liveagentgk-developer-edition.ap5.force.com/resource/1540193580000/LA_Fonts/omnes_medium-webfont.woff') format('woff');
        }
        
        
        @font-face {
        font-family: 'Omnes Semibold';
        font-style: normal;
        font-weight: normal;
        src: url('https://liveagentgk-developer-edition.ap5.force.com/resource/1540193580000/LA_Fonts/omnes-semibold-webfont.woff') format('woff');
        }
    .embeddedServiceHelpButton .helpButton .uiButton { 
        background-color: #011352; 
        font-family: "Salesforce Sans", sans-serif; 
        box-shadow: none;
        min-width: 15em;
        max-width: 17em;
     }
    .embeddedServiceHelpButton .helpButton .uiButton .live-icon { 
        font-size: 50px;
        line-height: 0px;
        position: relative;
        top: 12px;
        color: #58d63a;
    }
    .embeddedServiceHelpButton .helpButton .uiButton.helpButtonDisabled { display: none; }

    .embeddedServiceSidebarMinimizedDefaultUI.helpButton { 
        background:#011352!important; 
        font-family: "Salesforce Sans", sans-serif !important; 
        box-shadow: none !important;
        min-width: 8em !important;
        max-width: 10em !important;
        background-image: none !important;
     }
     .embeddedServiceSidebarMinimizedDefaultUI .embeddedServiceIcon {
        display: none !important;
    }
    .embeddedServiceSidebarMinimizedDefaultUI .minimizedText>.message, .embeddedServiceSidebarMinimizedDefaultUI .minimizedText>.message:hover, .embeddedServiceSidebarMinimizedDefaultUI .minimizedText>.message:focus {
        margin: 4px 10px !important;
        background-color: #011352 !important; 
        color: #fff;
        border: 0;
        text-transform: uppercase;
        font-size: 13px;
        text-decoration: none !important;
        font-weight: normal !important;
    }
    @font-face {
    font-family: 'Salesforce Sans';
        src: url('https://www.sfdcstatic.com/system/shared/common/assets/fonts/SalesforceSans/SalesforceSans-Regular.woff') format('woff'),
        url('https://www.sfdcstatic.com/system/shared/common/assets/fonts/SalesforceSans/SalesforceSans-Regular.ttf') format('truetype');
    }
    .helpButtonLabel .message {
        margin: 4px 10px !important;
         background-color: #011352 !important; 
        color: #fff;
        border: 0;
        text-transform: uppercase;
        font-size: 13px;
        text-decoration: none !important;
    }
    .embeddedServiceHelpButton .embeddedServiceIcon {
        display: none !important;
    }
    .embeddedServiceHelpButton .helpButton .uiButton:focus {
        outline: none;
    }
    .helpButtonEnabled:focus .helpButtonLabel {
        text-decoration: none;
    }
    .embeddedServiceSidebarButton {
        background: #35BDD1;
        font-family: "Omnes Semibold",sans-serif;
    }
    .embeddedServiceSidebarButton.uiButton--inverse, .embeddedServiceSidebarButton.uiButton--inverse:hover, .embeddedServiceSidebarButton.uiButton--inverse:disabled, .embeddedServiceSidebarButton.uiButton--inverse:disabled:hover, .embeddedServiceSidebarButton.uiButton--inverse:not(:disabled):focus, .embeddedServiceSidebarButton.uiButton--inverse:not(:disabled):hover {
        background: #011352 !important;
        color: #fff !important;
    }
    .embeddedServiceSidebarButton.uiButton--inverse .label {
        color: #fff;
    }
    .dialog-button-0 {
        background: #011352 !important;
    }
    .dialog-button-1.uiButton--inverse {
        background: #35BDD1 !important;
    }
    .embeddedServiceLiveAgentStateChatHeaderOption .embeddedServiceIcon, .embeddedServiceLiveAgentStateChatHeader .message {
        display: none !important;
    }
    .embeddedServiceLiveAgentStateChatHeaderOption, .embeddedServiceLiveAgentStateChatHeaderOption:hover {
        width: 100px;
        padding: 8px;
        background: #35BDD1;
        border-radius: 5px;
        color: #fff;
        text-decoration: none;
    }
    .embeddedServiceLiveAgentStateChatHeaderOption .optionName {
        margin-top: 0;
    }
    .chatOptions a.embeddedServiceLiveAgentStateChatHeaderOption:last-child, a.embeddedServiceLiveAgentStateChatHeaderOption:last-child:hover {
       
 background: #a6aaa9 !important;
        margin-left: 43px;
    }
    .embeddedServiceSidebarHeader .headerTextContent {
        font-family: "Omnes Semibold";
    }
    .embeddedServiceLiveAgentStateWaitingHeader .waitingGreeting.imageIsSet {
        font-family: "Omnes Semibold";
    }
    .embeddedServiceLiveAgentStateChatHeader .chatOptions {
        margin-top: 46px;
    }
</style>
 
I have a snap in chat set up and when i minimize it show the following error, what coul dbe wrong with my code??
User-added image
I have created a prechat form for an omni channel. I have currettly no avatar set up. So, by default the initial of the Live agent is show on the header. We would like to not seee any thing on the header, but the agent avatar should be replaced by the Live agent name. Is this possible>
I have an email action set up for cases. I would like to autopopulate with a specific email addres when sending an email from a case record. How is this achivebale?
Is there a way to create  Work Orders from Asset Cases.  and have fields auto populate based on data from the Asset Case.

I think a flow will help but wondering which object should i use it on? any leads?
I would like to build a query where i can combine the follwoing three in to on query that is used for  record types prospect and member. any advice?

AND(
(RecordType.Name = "Prospect"),
OR(
ISBLANK( PersonMailingCity),
ISBLANK( PersonMailingStreet ),
ISBLANK( PersonMailingPostalCode )),
(NOT($User.BypassVR__c) && 
 
NOT( OR( ISBLANK(Phone ), REGEX( Phone ,"(\\D?[0-9]{3}\\D?)[\\s][0-9]{3}-[0-9]{4}"))))
 
NOT($User.BypassVR__c) && ($RecordType.Name = "Member" || $RecordType.Name = "Prospect") && ISBLANK( FirstName)
I have the following query and it sthrowing an error that i need an extra bracket.i think i have it all right , but not sure why an error

AND((RecordType.Name = ("Prospect"),OR(ISBLANK( FirstName),ISBLANK( PersonMailingCity),ISBLANK( PersonMailingStreet ),ISBLANK( PersonMailingPostalCode))&&(NOT($User.BypassVR__c) && ($RecordType.Name = "Member" || $RecordType.Name = "Prospect") && ISBLANK( FirstName))&&(NOT($User.BypassVR__c) && NOT( OR( ISBLANK(Phone ), REGEX( Phone ,"(\\D?[0-9]{3}\\D?)[\\s][0-9]{3}-[0-9]{4}")))))
I have been tasked to get the  follwoing ie: MAX and MIn value rather count at a partiuclar time interval. I managed to get the Time interval and Chat offeredm but wondering how i should get the MAX que and MIN que along with Agen AvAIL?. Is it something possibile?
Chat Queue
Time IntervalChats OFFMax Que #Min Que #Agent Avail # (TTL Max Session Cts)Avg Wait (mins)Avg ABD time (seconds)
8:0010101100.240:00
8:15151412101.24120
8:30252518106.11160
8:45273023128.28175
       
Period TTLAverages of all periods

i have been asked to create a report for a 24 hour time interval from midnight until 24:00 (See legacy). This is for a chat request that comes in for that period. The request time is captured and used this formula to get the 15 min time interval. See However, i am also asked to show the times when no request is made and corresponding values as 0. I am not sure how i should go about getting this inserted in the time interval. Should i create another field that details the 30 min time interval. If so how do i go about doing it.
 
LPAD(
TEXT( VALUE( MID(TEXT(RequestTime - 0.2085),12,2) )
+ IF( VALUE(MID(TEXT(RequestTime - 0.2085 ),15,2)) > 53, 1, 0)
), 2, "0")
+ IF( VALUE(MID(TEXT(RequestTime - 0.2085),15,2)) < 8, ":00" ,
IF( VALUE(MID(TEXT(RequestTime - 0.2085 ),15,2)) < 24, ":15" ,
IF( VALUE(MID(TEXT( RequestTime - 0.2085 ),15,2)) < 38, ":30" ,
IF( VALUE(MID(TEXT( RequestTime - 0.2085 ),15,2)) < 54, ":45" ,
":00")
)))
Requirement: if and only iff all the child cases (WITH RECORD TYPE B) are closed then automatically parent case record (rECORD TYPE A) should be closed.
I have written the following code, can some one tell me where i am wrong and also how do i query to suit the record type?

trigger Closeparentcaseauto on Case (before update) {
     Integer counter = 0;
    Set<Id> isparentID = new Set<Id>();----Create a set collection to get all the CHILD cases with parent ID
    
    for(Case cs : trigger.new)
        if(cs.ParentId!=null)
      isparentID.add(cs.ParentId);----From the trigger het the cases where parent id is not null and add it to the set collection.
      
      
      }
     ---loop through the    Cases with the above parent ID and put it in a list collection. ie: collect all the cases with parent ID.             

List<Case> cswithparentIDList = [SELECT Select Id,Status,ParentId From Case where status != 'Closed' and ParentId IN : isparentID];


    

---*/cswithparentIDList---Contains all the cases with the collected parents IDS. and also cases that is open.

---Create a map collection to get the Case with parent id and its child cases as a key value pair.

    Map<Id,List<Case>> caseListMapWithId = new Map<Id,List<Case>>();
    
    for (Case c: cswithparentIDList)
    
    if(caseListMapWithId.containskey(c.parentid)){
    
        caseListMapWithId.get(c.parentid).add(c);
        }else{
        caseListMapWithId.put(c.parentid,c);
        }
        }
        
    Now loop though the child case parent id and status open to loop through its child cases.
    
    for (Case c1: caseListMapWithId.values()){

    
                   
              
                if(c1.Status != 'closed')
                {
                  counter++;
                }
            
        }
         
    for (case  parentcase: cswithparentIDList) {
        
        
            parentcase.Status = 'Closed';
           
   
    }
    
    if (counter == 0){
    update parentcase;}

}
    
 have set up omni channel and live agent and its working fine. But as you see in the attached, the urls passed from the agent is cut off. What could be wrong?User-added image
When a user resets password in production, they get an email from QA_Support@salesforce.com. Is that expected even though it's a production site?
I have a snap in chat set up and when i minimize it show the following error, what coul dbe wrong with my code??
User-added image
I have created a prechat form for an omni channel. I have currettly no avatar set up. So, by default the initial of the Live agent is show on the header. We would like to not seee any thing on the header, but the agent avatar should be replaced by the Live agent name. Is this possible>
Hi,
Does anyone know how to have a custom button on lightning service console case detail page.
I tried enough but no luck.

Or any alternative to call a flow or lightning component from Lightning case console.

Thanks
Prakash GB
We want to implement "Snap-ins chat" in Lightning service console. Please help or suggest required steps.

As an initial set up, we have created snap-ins deployment, mapped Live agent settings and copied "Snap-in code snippets" in VF page. But when we are opening VF page as preview, we are getting below error in Chrome browser console. We have added SF HTTPS domain url in CORS as well. How to resolve this error?

Error message:
Access to Font at 'https://a.sfdcstatic.com/content/dam/www/ocms-backup/system/shared/common/assets/fonts/SalesforceSans/SalesforceSans-Regular.ttf' from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. The response had HTTP status code 404.

 
error in challenge 8.unable to import data User-added imageUser-added imageUser-added image

I need to export a report as a CSV to an FTP site or email it on a daily or weekly basis.

 

I have a Report.  I need to get the report out of Salesforce somehow into CSV format.

 

Ideally, this would be scheduled.


I'm a developer so I can do developer stuff.  However, I don't know APEX and I don't know VisualForce.  I can get someone to do that stuff if we need to.


Thanks!

  • July 26, 2011
  • Like
  • 2