• Andegosu
  • NEWBIE
  • 45 Points
  • Member since 2018
  • Developer
  • DevCore

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 8
    Questions
  • 8
    Replies
With the new update of email-to-case threading behavior, Thread-Id field is being deprecated: https://releasenotes.docs.salesforce.com/en-us/winter21/release-notes/rn_email_to_case.htm 

I have an apex class that sends out an auto-response to contacts in a case based on a integration to a customer portal.

I added the thread-id before from the case before but now when this doesn't work I need to set header info so when a contact responds to the auto-response the response is added to the case, and doesn't create a new case according to this new email-to-case behavior.

I have tried using the setReferences() on Messaging.SingleEmailMessage to set a reference to the case, but I can't find proper documentation of how to set the reference, I just need a reference to the case so the response gets inserted correctly.
I have a datatable with a new button that uses the NavigationMixin.Navigate functionality in LWC.
import { NavigationMixin, CurrentPageReference } from 'lightning/navigation';



After the record is created it default navigates to the record, I had to add "navigationLocation: 'RELATED_LIST'" to the state to make it stay on the original record page where the component is placed.
However, after the dialoge is done and new record has been created, it stops running. I want to refresh the datatable to display the new record but I can't run any code after NavigationMixin. 

Is there anyway to solve this?

Code run when clicking new:
createNew() {
    let defaultFieldValues = '';
    this.loading = true;
    if(this.parentFieldName !== null) {
      defaultFieldValues = this.parentFieldName +"="+this.recordId;
    }
  
    this[NavigationMixin.Navigate]({
      type: 'standard__objectPage',
      attributes: {
        objectApiName: this.objectName,
        actionName: 'new'                
      },
      state : { 
          nooverride: '1',
          defaultFieldValues: defaultFieldValues,
          navigationLocation: 'RELATED_LIST',
          recordTypeId: this.recordTypeId
      }
    }).then(result => {
      console.log(result);
      return refreshApex(this.wiredResult);

    }).catch(error => {
      console.log(error);
    }); 
  }

 
I need to copy everything from my sandbox to production org. Everything is working fine in Sandbox and I have proficient test coverage. When I use change sets to push from the sandbox to produciton I end up with one confusing error after another with no clear error message. There is also no easy way to auto add all changes, filter, searh and edit change set components.

Is there an easier/better way to deploy from sandbox to production?
I need to be able to choose from a document template and populate it with Salesforce data. This could be preprocessed documents with merge fields that are already uploaded in Salesforce.

Say I'm in a case record and I choose a document template from a dropdown, I want to download that document with all merge fields populated with data from the case record.

I know this would be possible if you export the documents as html and add them to email templates and just render the html in a visualforce page as pdf or docx. This method seems to be losing the images and some styling of the documents though.

Anyone know how I can do this?
I have a custom listview that I can select Contact records from but how do I get this information in the controller to do forther actions in apex?

I have code that currently looks like this:
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction"
                access="global"
                controller="ListViewController">
    <!-- call doInit js function on component load to fetch list view details-->
    <aura:handler name="init" value="this" action="{!c.doInit}"/>
    <!-- aura attributes -->
    <aura:attribute name="listViewResult" type="string[]"/>
    <aura:attribute name="objectInfo" type="string" default="Contact"/>
    <aura:attribute name="currentListViewName" type="string" />
    <aura:attribute name="bShowListView" type="boolean" default="false"/>
    <aura:attribute name="selContacts" type="Contact[]"/>

    <!-- custom controls to display inside listview header-->
    <div class="slds-form-element">
        <lightning:layout class="customCls">
        <lightning:select name="select1" onchange="{!c.onPicklistChange}" label=" ">
            <aura:iteration items="{!v.listViewResult}" var="listView">
                <option value="{!listView.developerName}">{!listView.label}</option>
            </aura:iteration>
        </lightning:select>
            <lightning:button label="Avidentifiera" onclick="{!c.unidentify}" variant="brand"/>
        </lightning:layout>
    </div>

    <!-- lightning List View : https://sforce.co/2Q4sebt-->
    <aura:if isTrue="{!v.bShowListView}">
        <lightning:listView objectApiName="{!v.objectInfo}"
                            listName="{!v.currentListViewName}"
                            rows="5"
                            showSearchBar="true"
                            showActionBar="false"
                            enableInlineEdit="true"
                            showRowLevelActions="false"
        />
    </aura:if>
</aura:component>

 
Whenever I go to My Domain under Setup and try login to my domain I get to a site without any css: http://prntscr.com/n342rq

If I click the deploy to users button on that weird page, it just refreshes and nothing hapens.

If I try to login to my domain: https://adoptions.lightning.force.com
I get an error telling me to check my internet connection:
http://prntscr.com/n3454e
 
We have nonprofit asssociations that are responsible for different areas in Sweden. When I create a new contact in lightning I want the association field to be autofilled or suggested for the user with the corresponding association based on the Contact's postalcode.

We will have a table with each association and their respective postalcodes. So based on the postalcodes in this table I want to suggest a association for the contact that has a corresponding postalcode.

Is this possible? I'm not sure how to implement this requirement and would be grateful for some assistance.
I always come across two ways of assigning results from a SOQL query to a list and I just wondered if there is any difference between the two:
1. List<Account> exampleOne = [SELECT Id, Name FROM Account WHERE Name = 'John'];
2. List<Account> exampleTwo = List<Account>([SELECT Id, Name FROM Account WHERE Name = 'John']);
With the new update of email-to-case threading behavior, Thread-Id field is being deprecated: https://releasenotes.docs.salesforce.com/en-us/winter21/release-notes/rn_email_to_case.htm 

I have an apex class that sends out an auto-response to contacts in a case based on a integration to a customer portal.

I added the thread-id before from the case before but now when this doesn't work I need to set header info so when a contact responds to the auto-response the response is added to the case, and doesn't create a new case according to this new email-to-case behavior.

I have tried using the setReferences() on Messaging.SingleEmailMessage to set a reference to the case, but I can't find proper documentation of how to set the reference, I just need a reference to the case so the response gets inserted correctly.
I have a datatable with a new button that uses the NavigationMixin.Navigate functionality in LWC.
import { NavigationMixin, CurrentPageReference } from 'lightning/navigation';



After the record is created it default navigates to the record, I had to add "navigationLocation: 'RELATED_LIST'" to the state to make it stay on the original record page where the component is placed.
However, after the dialoge is done and new record has been created, it stops running. I want to refresh the datatable to display the new record but I can't run any code after NavigationMixin. 

Is there anyway to solve this?

Code run when clicking new:
createNew() {
    let defaultFieldValues = '';
    this.loading = true;
    if(this.parentFieldName !== null) {
      defaultFieldValues = this.parentFieldName +"="+this.recordId;
    }
  
    this[NavigationMixin.Navigate]({
      type: 'standard__objectPage',
      attributes: {
        objectApiName: this.objectName,
        actionName: 'new'                
      },
      state : { 
          nooverride: '1',
          defaultFieldValues: defaultFieldValues,
          navigationLocation: 'RELATED_LIST',
          recordTypeId: this.recordTypeId
      }
    }).then(result => {
      console.log(result);
      return refreshApex(this.wiredResult);

    }).catch(error => {
      console.log(error);
    }); 
  }

 
I have a custom listview that I can select Contact records from but how do I get this information in the controller to do forther actions in apex?

I have code that currently looks like this:
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction"
                access="global"
                controller="ListViewController">
    <!-- call doInit js function on component load to fetch list view details-->
    <aura:handler name="init" value="this" action="{!c.doInit}"/>
    <!-- aura attributes -->
    <aura:attribute name="listViewResult" type="string[]"/>
    <aura:attribute name="objectInfo" type="string" default="Contact"/>
    <aura:attribute name="currentListViewName" type="string" />
    <aura:attribute name="bShowListView" type="boolean" default="false"/>
    <aura:attribute name="selContacts" type="Contact[]"/>

    <!-- custom controls to display inside listview header-->
    <div class="slds-form-element">
        <lightning:layout class="customCls">
        <lightning:select name="select1" onchange="{!c.onPicklistChange}" label=" ">
            <aura:iteration items="{!v.listViewResult}" var="listView">
                <option value="{!listView.developerName}">{!listView.label}</option>
            </aura:iteration>
        </lightning:select>
            <lightning:button label="Avidentifiera" onclick="{!c.unidentify}" variant="brand"/>
        </lightning:layout>
    </div>

    <!-- lightning List View : https://sforce.co/2Q4sebt-->
    <aura:if isTrue="{!v.bShowListView}">
        <lightning:listView objectApiName="{!v.objectInfo}"
                            listName="{!v.currentListViewName}"
                            rows="5"
                            showSearchBar="true"
                            showActionBar="false"
                            enableInlineEdit="true"
                            showRowLevelActions="false"
        />
    </aura:if>
</aura:component>

 
Whenever I go to My Domain under Setup and try login to my domain I get to a site without any css: http://prntscr.com/n342rq

If I click the deploy to users button on that weird page, it just refreshes and nothing hapens.

If I try to login to my domain: https://adoptions.lightning.force.com
I get an error telling me to check my internet connection:
http://prntscr.com/n3454e
 
We have nonprofit asssociations that are responsible for different areas in Sweden. When I create a new contact in lightning I want the association field to be autofilled or suggested for the user with the corresponding association based on the Contact's postalcode.

We will have a table with each association and their respective postalcodes. So based on the postalcodes in this table I want to suggest a association for the contact that has a corresponding postalcode.

Is this possible? I'm not sure how to implement this requirement and would be grateful for some assistance.
I always come across two ways of assigning results from a SOQL query to a list and I just wondered if there is any difference between the two:
1. List<Account> exampleOne = [SELECT Id, Name FROM Account WHERE Name = 'John'];
2. List<Account> exampleTwo = List<Account>([SELECT Id, Name FROM Account WHERE Name = 'John']);
 mail.setReferences('References: 1*<'+String.valueOf(b2bcid)+'> CRLF');

Hello guys,

 

if I'm using this in my outbound messages class I'm getting error as

 

System.EmailException: SendEmail failed. First exception on row 0; first error: INVALID_MESSAGE_ID_REFERENCE, References header is not valid.: []
Class.WPOSP.B2BRespondtoinquirycontroller.sendResponse: line 59, column 5 External entry point 

 

in the above code String.valueOf(b2bcid) is my record id. I was wondering what will be the syntax of mail.setReferenes method.

 

I also looked at http://tools.ietf.org/html/rfc2822#section-3.6.4 but couldn't understand the syntax.

 

Could you please help me in this.

 

Thanks,

Vamsii

  • July 09, 2011
  • Like
  • 0

Hello All,
I have a requirement to show only "Email messages or posts"  on Feed Layout(No other field updates) of Case object in Community.
Also,internal users must be able to see all the updates of that case in Feed Layout.

Please guide me,if anybody has idea on how to achieve this?