• Ivan Vrtacnik
  • NEWBIE
  • 40 Points
  • Member since 2015

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 9
    Replies

Is there a way to access the sites domain name in an email template?

 

i.e. I'd like to have a email that is sent on a workflow that will give a link to a sites page.

 

In development, the page would be something like:

 

http://XXX-developer-edition.na7.force.com/mysite/mypage

 

I would like to code the template something like

 

{!siteaddress}/mysite/mypage

 

so when moving to different environments I don't need to edit the tempate.

 

 

 

Or, is there a way to access a static Apex class method in an email template?  This way, I could set the site address in the Apex class so at least if I have many e-mail templates I would only have one place to change it.

  • April 26, 2010
  • Like
  • 0
While doing the challenge, I got stuck on step 7. I was reviewing the raw logs like many posts on this forum advised, and I saw this:
 
Map productMap = new Map([SELECT Id,Name FROM Product2]);
Map pricebookEntryMap = new Map([SELECT Id,Name FROM PricebookEntry]);

Map chartMap = new Map();
orderExtension ext = new orderExtension(new apexPages.standardController(new order()));
ext.orderItemList[0].Quantity = 1;
ext.orderItemList[0].UnitPrice = 1;
ext.orderItemList[1].Quantity = 2;
ext.omrderItemList[1].UnitPrice = 2;
for ( OrderItem oi : ext.orderItemList ){
String name;
if ( oi.Product2 != null && String.isNotBlank(oi.Product2.Name) ){
name = oi.Product2.Name;
}
else if ( oi.PricebookEntryId != null && String.isNotBlank(oi.PricebookEntry.Name) ){
name = oi.PricebookEntry.Name;
}
else if ( oi.Product2Id != null ){
name = productMap.get(oi.Product2Id).Name;
}
else if ( oi.PricebookEntryId != null ){
name = pricebookEntryMap.get(oi.PricebookEntryId).Name;
}
if ( String.isNotblank(name) && oi.Quantity != null && oi.UnitPrice != null ){
Decimal x = 0;
if ( chartMap.containsKey(oi.Product2.Name) ){
x = chartMap.get(oi.Product2.Name);
}
x += ( oi.Quantity * oi.UnitPrice );
chartMap.put(oi.Product2.Name,x);
}
}
ext.onFieldChange();

for ( chartHelper.chartData cd : ext.pieData ){
system.assert( cd.val == chartMap.get(cd.name), cd.name+': '+cd.val + '!='+ chartMap.get(cd.name) );
}

Now clearly, this snippet will only work for the edit case, and not for creating new OrderItems, as Product2 will be null in that case. I could of course fudge the code to get it to pass, but I don't want to do that. SalesForce support has already come back to me saying they cannot assit me. Does anyone know where to log this issue?
I was wondering if anyone else has this issue: On the Export Data unit, the challenge asks three questions. I got all three right, and submitted, but I got a return message saying I got one question wrong. Problem is, I double checked in the unit, and the answer I chose is literally in the unit!

Question: The Schedule Export option allows you to:

A) Select the type of information to include in the export.
B) Schedule the export process for weekly or monthly intervals.
C) Replace carriage returns with spaces.
D) Include or exclude images, documents, and attachments in your export.
E) All of the above

And in the unit, it literally says: 
  • The Schedule Export option allows you to schedule the export process for weekly or monthly intervals.
I finally passed by selecting E but do not feel this to be the correct answer, at least not with the way the question is worded. While it is true that 'All the above' can be done in a scheduled export, A, C and D can be done with the Export Now option as well. So the scheduled option does not allow for any of those. The only one that Schedule Export option allows is B.
Hi, I am bit stuck on this challenge

I made the attribute private and removed it from the wrapper, which I don't think is right way to do. as we just need to control the attributes access.
However, it was not letting me save it. and the challenge is failing with -

The 'LTNG_Access_Control_Challenge_Wrapper' component does not appear to contain the correct code to call the 'LTNG_Access_Control_Challenge' component.



LTNG_ACCESS_CONTROL_CHALLENGE

<aura:component access="global">
    <aura:attribute name="personQuota" access="private" type="Decimal" default="25"/>
    <aura:attribute name="currentPeople" access="private" type="Decimal" default="10" />
      <!-- Global may be too permissive here, private would be better since only the CEO decides commissions -->
      <aura:attribute name="guardAsleep" access="private" type="Boolean" default="false" /> <!-- CHANGE 1 HERE -->
      
      <div class="slds-row slds-align--absolute-center">
      <div class="slds-panel slds-size--4-of-6">
        <article class="slds-card">
            <div class="slds-card__header">
                Welcome to the castle.  We have a strict quota of {!v.personQuota} citizens
            </div>
            <div class="slds-card__body">
                <ui:outputNumber value="{!v.currentPeople}"/> People<br />
                <ui:button press="{!c.attemptEntry}" label="Enter"/>
            </div>
        </article>
    </div>
  </div>
</aura:component>

LTNG_ACCESS_CONTROL_CHALLENGE_WRAPPER

<aura:component implements="force:appHostable" access="global">
 <!--<c:LTNG_Access_Control_Challenge guardAsleep="{!v.sleepingGuard}"/>-->
    <div class="slds-row slds-align--absolute-center">
        <div class="slds-size--3-of-6">
            <div class="slds-row slds-align--absolute-center">
                <div class="slds-panel slds-size--4-of-6 ">
                    <h2 class="slds-text-heading--medium">Welcome to the castle.  Be warned, a guard will keep the castle from going over its person allocation</h2>
                    <ui:inputCheckbox label="Guard Asleep?" value="{!v.sleepingGuard}" />
                </div>
                <div class="slds-pabel slds-size--2-of-6">
                     <!--<c:LTNG_Access_Control_Challenge guardAsleep="{!v.sleepingGuard}"/>-->
                </div>  
            </div>
        </div>
    </div>
    <hr />
    <div class="slds-row slds-align--absolute-center">
        <div class="slds-size--4-of-6">
            <c:CodeInstructions componentName="LTNG_Access_Control_Demo" />
        </div>
    </div>
</aura:component>
 
If the package.xml is upgraded to API 38.0 then we are receiving the following errors while deploying to a Salesforce Org with Winter 17 i.e API 38.0
1. objects/Contract.object (Contract.Status) -- Error: field integrity exception: unknown (invalid value) (line 979, column 13)
2. objects/DuplicateRecordSet.object -- Error: invalid cross reference id

Thanks,
Srikanth.
I have been running into walls on this one and I'm wondering if anyone has had a similar experience?

I'm looking to connect an External OData source. I attempt to add a new source (Setup > External Data Sources > New External Source) and the only selection I have is "Simple URL". I'm missing the OData types from the drop-down that are readily available in any developer edition of SF. 

I've raised this issue with Support, and after a week of back and forth, they keep closing the case saying it's a developer issue.

Now something that I read in the documentation left me thinking that they may be right, in a way, and this may not be a support issue. There was mention of this being available "at an extra cost" for Enterprise customers (here: https://help.salesforce.com/articleView?id=platform_connect_add_external_data_source.htm&type=0&language=en_US). In reading this, I contacted Sales.  

Unfortunately, I seemed to run into another issue there, which is that Sales is not able to identify the feature I'm describing, despite sharing the language and product range names from the documentation, in detail. Three separate agents later still no luck finding a definitive answer or a step closer towards a solution. 

I'm trying not to lose hope here. There has to be some information out there on how to either A. enable the OData adapters as an option or B. purchase and apply the correct licencing. 

I'm fully accepting the possibility as well that I'm just overlooking some obvious articles or options somewhere since I've been staring at this for a while now.

Looking for anybody who has had a similar experience or who may have some guidance on how to approach getting an OData source connected. 
Problem Statement:

Create a form to enter new items and display the list of items entered. To make our camping list look more appealing, change the campingHeader component to use the SLDS. Similar to the unit, style the Camping List H1 inside the slds-page-header. Modify the campingList component to contain an input form and an iteration of campingListItem components for displaying the items entered.
  • The component requires an attribute named items with the type of an array of camping item custom objects.
  • The component requires an attribute named newItem of type Camping_Item__c with default quantity and price values of 0.
  • The component displays the Name, Quantity, Price, and Packed form fields with the appropriate input component types and values from the newItem attribute.
  • The JavaScript controller checks to ensure that the Name, Quantity and Price values submitted are not null.
  • If the form is valid, the 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.

My Code:

CampingList.cmp

 
<aura:component >
	<ol>
        <li>Bug Spray</li>
        <li>Bear Repellant</li>
        <li>Goat Food</li>
    </ol>
 <aura:attribute name="items" type="Camping_Item__c[]"/>
 <aura:attribute name="newItem" type="Camping_Item__c"
     default="{'sobjectType': 'Camping_Item__c',
                    'Name': '',
                    'Price__c': 0,
                    'Quantity__c': 0,
                    'Packed__c': false }"/>    
    <div style = "slds">
    <div class="slds-col slds-col--padded slds-p-top--large">
		<div aria-labelledby="newform">
			<fieldset class="slds-box slds-theme--default slds-container--small">
				<legend id="newform" class="slds-text-heading--small slds-p-vertical--medium">New Form</legend>
				<form class="slds-form--stacked">
					<div class="slds-form-element slds-is-required">
						<div class="slds-form-element__control">
							<ui:inputText aura:id="formname" label="Name" class="slds-input" labelClass="slds-form-element__label" value="{!v.newItem.Name}" required="true"/>
						</div>
					</div>
					<div class="slds-form-element slds-is-required">
						<div class="slds-form-element__control">
							<ui:inputCurrency aura:id="formprice" label="Price" class="slds-input" labelClass="slds-form-element__label" value="{!v.newItem.Price__c}" placeholder="0"/>
						</div>
					</div>
					<div class="slds-form-element">
						<div class="slds-form-element__control">
							<ui:inputNumber aura:id="formquantity" label="Quantity" class="slds-input" labelClass="slds-form-element__label" value="{!v.newItem.Quantity__c}" required="true" placeholder="0"/>
						</div>
					</div>
					<div class="slds-form-element">
						<ui:inputCheckbox aura:id="formpacked" label="Packed?" class="slds-checkbox" labelClass="slds-form-element__label" value="{!v.newItem.Packed__c}"/>
					</div>
					<div class="slds-form-element">
						<ui:button label="Create Form" class="slds-button slds-button--brand" press="{!c.clickCreateFormData}"/>
					</div>
				</form>
			</fieldset>
		</div>
    </div>

    <div class="slds-card slds-p-top--medium">
        <header class="slds-card__header">
            <h3 class="slds-text-heading--small">Camping</h3>
        </header>
        
        <section class="slds-card__body">
            <div id="list" class="row">
                <aura:iteration items="{!v.items}" var="items">
                    <c:campingListItem item="{!items}"/>
                </aura:iteration>
            </div>
        </section>
    </div>    
	</div>
</aura:component>
CampingListController.js:
 
({
    clickCreateFormData: function(component, event, helper) {

        var validitem = true;
        
        var nameField = component.find("formname");
        var expname = nameField.get("v.value");
		if ($A.util.isEmpty(expname)){
            validitem = false;
            nameField.set("v.errors", [{message:"Expense name can't be blank."}]);
        }
        else {
            nameField.set("v.errors",null);
        }
        
        var priceField = component.find("formprice");
        var expprice = nameField.get("v.value");
            if ($A.util.isEmpty(expprice)){
            validitem = false;
            priceField.set("v.errors", [{message:"Expense price can't be blank."}]);
        }
        else{
            priceField.set("v.errors",null);
        }
        
        var quantityField = component.find("formquantity");
        var expquantity = nameField.get("v.value");
        if ($A.util.isEmpty(expquantity)){
            validitem = false;
            quantityField.set("v.errors", [{message:"Expense quantity can't be blank."}]);
        }
        else{
            quantityField.set("v.errors",null);
        } 
        
      /*  if(validExpense){
            var newItem = component.get("v.newItem");
            console.log("Create item: " + JSON.stringify(newItem));
            helper.createExpense(component, newItem);
        } */
         if(validitem){
            var newItem = component.get("v.newItem");
            console.log("Create item: " + JSON.stringify(newItem));
        	var theItem = component.get("v.items");
            var newItem = JSON.parse(JSON.stringify(newItem));
            theItem.push(newItem);
            component.set("v.newItem",newItem);
        }
        component.set("v.newItem",{'sobjectType': 'Camping_Item__c',
                    'Name': '',
					'Price__c': 0,                                   
                    'Quantity__c': 0,
                    'Packed__c': false });
    }
})
CampingListItem.cmp:
 
<aura:component implements="force:appHostable">
   <aura:attribute name="item" type="Camping_Item__c"/>
     <p>The Item is: 
         <ui:outputText value="{!v.item}" />
    </p> 
    <p>Name:
        <ui:outputText value="{!v.item.Name}"/>
    </p>
    <p>Price:
    	<ui:outputCurrency value="{!v.item.Price__c}"/>
    </p>
    <p>Quantity:
		<ui:outputNumber value="{!v.item.Quantity__c}"/>
    </p>
    <p>Packed?:
    	<ui:outputCheckbox value="{!v.item.Packed__c}"/>
    </p>
    
  <!--  <p>
    	<ui:button label="Packed!" press="{!c.packItem}"/>
    </p> -->
</aura:component>

Could anyone help pass and run the challenge.

Thanks.
I'm getting an error when checking the Using Visualforce Pages in Page Layouts and Mobile Cards challenge. The error says that the page isn't evaluating the 'Prospecting' stage, yet the code works when I insert an Opportunity Id where the Stage = Prospecting.

The code:
<apex:page docType="html-5.0" standardController="Opportunity">
    <style>
    </style>
    
    <apex:remoteObjects >
        <apex:remoteObjectModel name="Opportunity" fields="Id,StageName" />
    </apex:remoteObjects>
    
    <div class="myPage">
        <h2>Tip for when you're in the {!Opportunity.StageName} Stage:</h2>
        <p id="stageTip" />
    </div>
    
    <script>
        var opportunityStage = "{!Opportunity.StageName}";
        document.getElementById("stageTip").innerHTML = createStageTip();
        
        function createStageTip() {
            if(opportunityStage){
                switch(opportunityStage){
                    case "Prospecting":
                        return "You need to ask really good questions"
                        break;
                    case "Needs Analysis":
                        return "Determine the needs by asking really good questions"
                        break;
                    case "Proposal/Price Quote":
                        return "Make sure the price doesn't exceed the budget"
                        break;
                    case "Negotiation/Review":
                        return "Maybe go down, but don't go down too much"
                        break;
                    default:
                        return "Use your best judgement";
                }
            }
        }
    </script>
</apex:page>
If you have any ideas as to why this isn't working, I'd love to hear them.

Cheers,
Justin
 
  • December 07, 2015
  • Like
  • 1
HI,
I'm generating conga merge via pex code, i need ot pass querry parameters
here how i do it
'&QueryId='+ congaQuery2[0].id+
works  fine however if i add second querry
'&QueryId='+ congaQuery2[0].id+','congaQuery1[0].id +

it only takes the first one 
even if i swap places, the one that comes after th Comma is ignored, works fine with  button when i put querry  ID

can anyone help? conga support could not
 

Hi,

 

I have created a email template and added site's custom web address as {!Site.TopLevelDomain}.

 

This email template is used to send email alert through a workflow.

 

This workflow will get fired as a result of some custom action(field update) through website.

 

I am receiving the email but without the custom web address of the website.

 

I have tried with some other fields like {!Site.UrlPathPrefix}, {!Site.Subdomain}

but it doesn't display any thing within email template as a result of these fields.

 

For the time being i have hard coded this url within the email template. But I want to remove this hard coded url.

 

Is there any thing else which need to be provided?

If any one have any idea please tell me.

 

 

Is there a way to access the sites domain name in an email template?

 

i.e. I'd like to have a email that is sent on a workflow that will give a link to a sites page.

 

In development, the page would be something like:

 

http://XXX-developer-edition.na7.force.com/mysite/mypage

 

I would like to code the template something like

 

{!siteaddress}/mysite/mypage

 

so when moving to different environments I don't need to edit the tempate.

 

 

 

Or, is there a way to access a static Apex class method in an email template?  This way, I could set the site address in the Apex class so at least if I have many e-mail templates I would only have one place to change it.

  • April 26, 2010
  • Like
  • 0

Hi All,

 

How can I find out Id of a particular report , which is created from a custom report type.

 

 

Thanks,

Sridhar