• David Cheng
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 3
    Replies
Hi, 

I'm trying to setup a process in Process Builder that sends an email to a a Lead.

The related email template contains fields such as {{{Recipient.FirstName}}}. The process operated on updated leads.

When updating a lead I'm getting the following error message:
Review the errors on this page.
We can't save this record because the “Send Welcome Email to new Facebool Leads” process failed. Give your Salesforce admin these details. We were unable to process the email template. Error Message: core.email.template.TemplateRenderingException: We don't recognize the field prefix Recipient. Associate a record that matches the prefix or update the template to remove the merge field from the body, subject, or letterhead. Error ID: 1475201610-63539 (-1854030112)

Basically it complains about the prefix 'Recepient' in the field. When sending the email manually based on the template it does work correctly. Also when I'm deleting the field from the template the email is sent. Changing the prefix to Lead also didn't solve the issue.

Any hint is highly appreciated.
Here's the problematic trail https://trailhead.salesforce.com/content/learn/modules/lex_dev_lc_basics/lex_dev_lc_basics_forms?trail_id=force_com_dev_intermediate

I keep on getting this error :

I dont get it as I do have a lightning input for the packed attribute. Here's my campingList.cmp :
 
<aura:component >
	<aura:attribute name="items" type="Camping_Item__c[]"/>
    <aura:attribute name="newItem" type="Camping_Item__c"
                    default="{ 'sobjectType': 'Camping_Item__c',
                             'Quantity__c': 0,
                             'Price__c': 0,
                             'Packed__c': 'false'}"/>
        <div aria-labelledby="newitemform">
            <!-- BOXED AREA -->
            <fieldset class="slds-box slds-theme--default slds-container--small">
                <legend id="newitemform" class="slds-text-heading--small 
                  slds-p-vertical--medium">
                  Add Item
                </legend>
              <form class="slds-form--stacked">          
                    <lightning:input aura:id="itemform" label="item Name"
                                     name="itemname"
                                     value="{!v.newItem.Name}"
                                     required="true"/> 
                      <lightning:input type="number" aura:id="itemform" label="item Quantity"
                                     name="itemquantity"
                                     value="{!v.newItem.Quantity__c}"
                                      min="1"
                                     step="1"
                                     required="true"/> 
                    <lightning:input type="number" aura:id="itemform" label="item Price "
                                      min="0.1"
                                     formatter="currency"
                                     step="0.01"
                                     name="itemprice"
                                     value="{!v.newItem.Price__c}"
                                     required="true"/>
                  <lightning:input 	type="checkbox" aura:id="itemform" label="Packed"
                                     name="itempacked"
                                     value="{!v.newItem.Packed__c}"
                                   	/>
                   <lightning:button label="Create Item" 
                              class="slds-m-top--medium"
                              variant="brand"
                              onclick="{!c.clickCreateItem}"/>
          </form>
         </fieldset>
       </div>
    <lightning:card title="Items">
        <p class="slds-p-horizontal--small">
            <aura:iteration items="{!v.items}" var="item">
                <c:campingListItem item="{!item}"/>
            </aura:iteration>
        </p>
    </lightning:card>

</aura:component>

Also Everything is running correctly in my PREVIEW, except one thing that I cant figure out. In the challenge, it is specified that :
"e JavaScript controller pushes the newItem onto the array of existing items, triggers the notification that the items value provider has changed, and resets the newItem value provider with a blank sObjectType of Camping_Item__c"
I am having trouble with the "resets the newItem value provider with a blank sObjectType of Camping_Item__c". Here's my CampingListController.js code :
({
    clickCreateItem : function(component, event, helper) {
        console.log('in function');
        var validItem = component.find('itemform').reduce(function (validSoFar, inputCmp) {
            // Displays error messages for invalid fields
            inputCmp.showHelpMessageIfInvalid();
            return validSoFar && inputCmp.get('v.validity').valid;
        }, true);
        // If we pass error checking, do some real work
        if(validItem){
            // Create the new expense
            var items = component.get("v.items");
            var newItem = component.get("v.newItem");
            console.log(newItem);
            items.push(newItem);
            console.log(items);
            component.set("v.items", items);
            component.set("v.newItem", "{ 'sobjectType': 'Camping_Item__c','Quantity__c': 0,'Price__c': 0,'Packed__c': 'false'}")
        }
    }
})

As you can see the last line of clickCreateItem resets newItem to a blank object : 
component.set("v.newItem", "{ 'sobjectType': 'Camping_Item__c','Quantity__c': 0,'Price__c': 0,'Packed__c': 'false'}")
So when I test the UI in the preview, I fill the form and I submit, it does create a new Item and resets the form but it is then impossible to enter new values in any fields of the form. Do you have any idea as to why it behaves this way and how rightfully reset the newItem value ?

Here's the rest of my files :

campingListItem.cmp :
<aura:component >

	<aura:attribute name="item" type="Camping_Item__c"/>
    	<p>{! v.item.Name}</p>
        <p><lightning:formattedNumber value="{!v.item.Price__c}" style="currency"/></p>
        <p><lightning:formattedNumber value="{!v.item.Quantity__c}"/></p>
        <p><lightning:input type="toggle"                            
                         label="Packed?"                           
                         name="packed"                         
                         checked="{!v.item.Packed__c}" /></p>
    <div>
        <lightning:button label="Packed!"
            onclick="{!c.packItem }"/>
    </div>

</aura:component>

campingListItemController.js :
({
    packItem: function(component, event, helper) {
        var btnClicked = event.getSource();   
        var btnMessage = btnClicked.set("v.disabled", "true");
        component.set("v.item.Packed__c", "true");     // update our message
    }
})

and campingHeader.cmp 
 
<aura:component >
        <!-- PAGE HEADER -->
    <lightning:layout class="slds-page-header slds-page-header--object-home">
        <lightning:layoutItem>
            <lightning:icon iconName="action:goal" alternativeText="My Items"/>
        </lightning:layoutItem>
        <lightning:layoutItem padding="horizontal-small">
            <div class="page-section page-header">
                <h1 class="slds-text-heading--label">Items</h1>
                <h2 class="slds-text-heading--medium">My Items</h2>
            </div>
        </lightning:layoutItem>
    </lightning:layout>
    <!-- / PAGE HEADER -->
    <!-- NEW EXPENSE FORM -->
    <lightning:layout>
        <lightning:layoutItem padding="around-small" size="6">
        <!-- [[ expense form goes here ]] -->
        </lightning:layoutItem>
    </lightning:layout>
    <!-- / NEW EXPENSE FORM -->
	<c:campingList/>
</aura:component>

Any help would be much appreciated !

 

Hi I'm working on communities and would like to customize the change password page that is displayed to the customer after a password reset. This is the url to the default changepassword-     /_ui/system/security/ChangePassword.  I have customized the changepassword vf page that Salesforce provides but when I try to test it out it still takes me back to the same old SF default changepassword. After much digging it appears to me that the changepassword vf page that's provided with the communities is tied to the user's personal profile. My question is where is the right page that needs to be customized or how can I make the change password link take the user to the custom page. Or is it even possible?

 

Thanks. 

  • October 02, 2013
  • Like
  • 0