+ Start a Discussion
TilluTillu 

I am working in enterprise edition. As winter 14 changed... i am unable to see the option reset security token . In devoloper edition it is visible. So from Enterprise edition i am unable to find.

Best Answer chosen by Admin (Salesforce Developers) 
hitesh90hitesh90

Hi,

 

below is the steps to find Reset security token in "Enabled Improved Setup User Interface".

 

Step 1. Go to Your Name --> My Settings

Step 2. select Personal | Reset My Security Token

 

Here you can find the option "Reset Security Token".

 

Important :
Hit Kudos if this provides you with useful information and if this is what you where looking for then please mark it as a solution for other benefits.

Thank You,
Hitesh Patel
SFDC Certified Developer & Administrator & Advanced Administrator & Sales cloud consultant
My Blog:- http://mrjavascript.blogspot.in/

Heiko KramerHeiko Kramer 
// Map to keep key (caregory) and value related to each other
        Map<String, String> mailValues = new Map<String, String>();
        
        // Seperate keys and values and put it in the map 
       	List<String> listOfLines = plainText.split('\n');
        for(String line : listOfLines){
            String key   = line.substringBetween('<', '>');
            String value = line.substringBetween('<' + key + '>', '</' + key + '>');
            
            if (key != null) {                                    // this works just fine, null key not added 

            // if (key != null || value != null){           // works partial, null key not added, but empty value added
            //  if (key != null || value != ''){              // doesn't work at all, null key + empty value get added 

                mailValues.put(key, value);                
            }
Hi guys, I'm getting tagged values per mail in this format:

<key>value</key>
<key2>value</key2>

Somethimes there are linebreaks, so I get a null key added to the map. Got that solved with "key != null".

But I'm struggling with excluding no-values like <key></key>.
Probably easy, but I'm absulte beginner … can someone give me a hand here?
 
Best Answer chosen by Heiko Kramer
Sourav PSourav P
Hi,
Why not to use only , If (value != null) { ,in the second If statement. Using both key & value in the If statement  will generate the key, value pair if any one is true.
Eric Kendi ShiraishiEric Kendi Shiraishi 
Hi, I am having trouble with the "Attributes and Expressions" module from trailhead.

Here is the challenge:
Create a Lightning Component to display a single item for your packing list.
  • Create a component called campingListItem that displays the name (ui:outputText) and the three custom fields using the appropriate output components.
  • Add an attribute named 'item' for type Camping_Item__c.
I created an component named campingListItem and this is the code:
<aura:component >
    <aura:attribute name="item" type="<my_domain>__Camping_Item__c"/>
    
    <ui:outputText value="{!v.item.Name}"/>
    <ui:outputCheckbox value="{!v.item.<my_domain>__Packed__c}"/>
    <ui:outputCurrency  value="{!v.item.<my_domain>__Price__c}"/>
    <ui:outputNumber value="{!v.item.<my_domain>__Quantity__c}"/>
</aura:component>

The error that I am getting is: "Challenge Not yet complete... here's what's wrong: 
The packingListItem Lightning Component's attribute tag doesn't exist or its attributes are not set correctly."

With this, I tried to create another component, with the name "packingListItem", but It didn't work.

Can anyone help me?

Thanks,
Best Answer chosen by Eric Kendi Shiraishi
Jeff DouglasJeff Douglas
Sorry for the inconvenience. Change your attribute to the following and everything should pass. I'm getting this update ASAP.
<aura:attribute name="item" type="Camping_Item__c" required="true"/>

Jeff Douglas
Trailhead Developer Advocate

 
HNT_NeoHNT_Neo 
I've managed to create a lightning homepage component with 1 column using the below component, style, and design elements. If I re-use the {!v.main} in the component page more than once, I receive an error. 

I want to be able to create 3 horizontal sections as shown in the last image below. Is it possible? 

COMPONENT
<aura:component implements="lightning:homeTemplate">
    <aura:attribute name="main" type="Aura.Component[]" /> 
    <div>
        <lightning:layout horizontalAlign="spread">
            {!v.main}
        </lightning:layout>
    </div>
</aura:component>

DESIGN
<flexipage:template >
        <flexipage:region name="main" defaultWidth="Xlarge">
        </flexipage:region>
    </flexipage:template>

SVG
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="120px" height="120px" viewBox="0 0 120 120" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
	<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
		<path d="M120,108 C120,114.6 114.6,120 108,120 L12,120 C5.4,120 0,114.6 0,108 L0,12 C0,5.4 5.4,0 12,0 L108,0 C114.6,0 120,5.4 120,12 L120,108 L120,108 Z" id="Shape" fill="#2A739E"/>
		<path d="M77.7383308,20 L61.1640113,20 L44.7300055,63.2000173 L56.0543288,63.2000173 L40,99.623291 L72.7458388,54.5871812 L60.907727,54.5871812 L77.7383308,20 Z" id="Path-1" fill="#FFFFFF"/>
	</g>
</svg>

This is the error I receive
User-added image

This is the layout I can render but doesn't work if I add components to it
User-added image
Best Answer chosen by HNT_Neo
Alain CabonAlain Cabon
Hi,

<lightning:layout >  and  <lightning:layoutitem> are not mandatory for a template.

Just use  <div class="slds-grid slds-wrap">, it is sufficient
and you have many samples here: https://www.lightningdesignsystem.com/utilities/grid/

COMPONENT​
<aura:component implements="lightning:homeTemplate" access="global" >
    <aura:attribute name="center" type="Aura.Component[]" />
    <aura:attribute name="left" type="Aura.Component[]" />
    <aura:attribute name="right" type="Aura.Component[]" />
    
    <div class="slds-grid slds-wrap">
        <div class="slds-col slds-size_1-of-3">
            <span>{!v.left}</span>
        </div>
        <div class="slds-col slds-size_1-of-3">
            <span>{!v.center}</span>
        </div>
        <div class="slds-col slds-size_1-of-3">
            <span>{!v.right}</span>
        </div>        
    </div>
</aura:component>

DESIGN​
 
<design:component label="My Two column Page">
    <flexipage:template>
        
        <flexipage:region name="left" defaultWidth="SMALL">
            <flexipage:formfactor type="MEDIUM" width="SMALL"/>
        </flexipage:region>
        
        <flexipage:region name="center" defaultWidth="SMALL">
            <flexipage:formfactor type="MEDIUM" width="SMALL"/>
        </flexipage:region>
               
        <flexipage:region name="right" defaultWidth="SMALL">
            <flexipage:formfactor type="MEDIUM" width="SMALL"/>
        </flexipage:region>
        
    </flexipage:template>
</design:component>

User-added image


 
Roman RauerRoman Rauer 
Hi there :)

i'm currently working on an native Android app for my company and ran into some problems with Salesforce lately.

I hope i can find some help here.

What i want to achieve:
The company has a lot of Accounts in Salesforce with 3 important fields for the app: Name, Business (Workshop or Parts Dealer) and location(latitude, longitude)
I would like to show those Accounts(Workshops/Parts Dealers) as markers on a google map in my Android app based on a radius around the user's current location. So it would be more than sufficient to get the data as JSON or XML(i read about sObjects, which would be nice too)

The app will be freely available on Google Play Store and every user should be able to see all the Workshops/Parts dealers around the world.

The problem i'm facing is that i can't find a way to fetch the data inside my app without authenticating every user with a Salesforce-Login. 
Which API is the best to use in this case?

It would be so awsome if anybody could help me with this problem.

What i tried so far: 
- SalesforceMobileSDK: If i extend SalesForceApplication i always end up with the Salesforce-Login Screen.
It seems that every client has to be authenticated for API-calls to work. I tried using the method "peekUnauthenticatedRestClient", but this method only works on full path URL's(e.g. "https://api.spotify.com/v1/search?q=James%20Brown&type=artist"), which isn't really practically for my Use-case.

- I feel like i read nearly all docs about salesforce api, but can't quite get my head around how to solve this problem, although it seems like to be a pretty common use-case.  

- would a salesforce-apex method which would select all records inside a set radius around the user's location be accessable without authentication?

Thanks for your help in advance!

Roman
Best Answer chosen by Roman Rauer
Santosh Bompally 8Santosh Bompally 8
Follow this -> 
1) Write a Restservice to expose your data. 
@RestResource(urlMapping='/Account')
global with sharing class MyRestResource {

 
    @HttpGet
    global static List<Account> doGet() {
        RestRequest req = RestContext.request;
        RestResponse res = RestContext.response;
       List< Account>  result = [SELECT Id, Name, Business,Location FROM Account ];
        return result;
    }
  
}

2)  Create a Community and provide access to apex class and account object to the Guest user profile. 
    Samplecommunity url -> https://somedomain.cs16.force.com/communityname

3) Go to workbench and test your API using rest explorer 
    relative url ->  /services/apexrest/Account
4) Your public url will now be   https://somedomain.cs16.force.com/communityname/services/apexrest/Account 

Mark as Best Answer if it helps. 

Thanks, 
Santosh 

 
Rocks_SFDCRocks_SFDC 

Hi Team,

 

In Text type of Email Templates, i want to specify logged in user as merge field. Could anyone have any suggestions.

I have tried with the following lines. But it is not working.

 

$User.FirstName

{!User.FirstName}

 

 

Thanks,

Anil

Best Answer chosen by Admin (Salesforce Developers) 
Vinita_SFDCVinita_SFDC

Hi Anil,

 

You are using only '!', please use '!$' like {!$User.FirstName}

sanjusfdcsanjusfdc 
Hi All,
Help me on this, i want using validation rule "Dealer user cannot save if the selected picklist value in Status field in "Inquiry" record type in Case is "Uploaded".
Best Answer chosen by sanjusfdc
Prakash NawalePrakash Nawale
sanjusfdc,

Use below code in validation rule to prevent creating of Case record based on your requirments.
 
AND(
           $RecordType.DeveloperName='Inquiry',
            $User.Username = 'Dealer username',
            ISPICKVAL( Status , 'Uploaded') 
)

Please like the answer and mark it as best if this helps.
EQ AdminEQ Admin 
for(Apttus_Billing__Invoice__c invoice:invoiceObjectList1) // loop over invoices
              {
                  List<InvoiceLineItems> listToStoreLineItems = new List<InvoiceLineItems>();
                  APTS_InvoiceJournalWrapper invoiceJournWrapper= new APTS_InvoiceJournalWrapper();
                   countHeader=0;
                   
                   count=count+1;
                  Decimal Sum=0;
                   
                                    invoiceJournWrapper.id=String.valueof(invoice.id);
                                    invoiceJournWrapper.HeaderKey=String.valueof(count);
                                    invoiceJournWrapper.ZCurrency=(invoice.CurrencyIsoCode!=null?invoice.CurrencyIsoCode:'USD');
                                    //invoiceJournWrapper.AccountingJournal='null';
                                    invoiceJournWrapper.AccountingJournalID=String.valueOf(invoice.Name + '_' +myDate);
                                    invoiceJournWrapper.JournalNumber=String.valueOf(invoice.Name + '_' +myDate);
                                    invoiceJournWrapper.ExternalReferenceID=String.valueOf(invoice.Name);                  
                                    invoiceJournWrapper.AccountingDate=String.valueof(Date.valueof(invoice.Apttus_Billing__InvoiceDate__c));
                  //-------------------
                  list<Apttus_Billing__InvoiceLineItem__c> invlineitems=[Select id,Apttus_Billing__AssetLineItemId__r.Apttus_Config2__ProductId__r.ProductCode,Apttus_Billing__AssetLineItemId__r.Apttus_Config2__OptionId__r.ProductCode,Apttus_Billing__InvoiceId__r.Name,Apttus_Billing__ProductId__r.Name,Apttus_Billing__InvoiceId__r.CurrencyIsoCode,
                                                                      Apttus_Billing__Type__c,Apttus_Billing__InvoiceId__c,Name,Apttus_Billing__Amount__c,Apttus_Billing__SoldToAccountId__r.EQ_ClientRef__c,Apttus_Billing__LocationId__c,
                                                                      Apttus_Billing__ProductId__r.EQ_FeeCode__c,Apttus_Billing__BillToAccountId__r.EQ_ClientRef__c,Apttus_Billing__ProductId__r.ProductCode,Apttus_Billing__InvoiceId__r.EQ_TotalInvoiceAmount__c 
                                                             from Apttus_Billing__InvoiceLineItem__c where Apttus_Billing__InvoiceId__c=:invoice.id and Apttus_Billing__Type__c='Contracted' and Apttus_Billing__Amount__c!=0];
                  //----
                  //
                  //-------------
                   InvoiceLineItems FirstInvItems= new InvoiceLineItems();
                            countHeader=countHeader+1;
                            FirstInvItems.LineKey=string.valueof(countHeader);

 
Best Answer chosen by EQ Admin
paul diracpaul dirac
I find some errors and the code does not compile (i mocked all of your custom object but anyway there might be some sintax errors).
Consider to split some "iterative tasks" in an helper (static) class, since your Rest service might grows in future, developers (you too ofc) may encounter difficulties to maintain that. For example, that part in which lineItems are collected and then modified can be delegated to the helper class to enhance code readability.
Further little optization can be done storing fixed numbers/strings in costants but I guess that there are not any improvements that significately reduce the execution time, I mean the optimization I will want to see here is in code readability first. Hope I helped you to solve your cancerns!
gs88834gs88834 
Hi, I'm running into an issue with getting an access token using a connected app with grant_type = password.  Here is my curl script:

curl https://test.salesforce.com/services/oauth2/token -H "Content-Type:application/x-www-form-urlencoded" -d "grant_type=password" -d "client_id=<my client_id>" -d "client_secret=<my client_secret>" -d "username=<myusername@domain.com>" -d "<my password+secret>"

I'm getting an invalid_grant error  "Authentication failure" 
 
Best Answer chosen by gs88834
SandhyaSandhya (Salesforce Developers) 
Hi,

Going to connected apps in Salesforce and changing 'permitted users' from 'Admin approved users are pre-authorized' to 'All users may self-authorize' 

Please refer below link step 9 which worked for others it may help you.

http://stackoverflow.com/questions/12794302/salesforce-authentication-failing

Hope this helps you!

Please mark it as Best Answer if my reply was helpful. It will make it available for other as the proper solution. 
 
Thanks and Regards
Sandhya

 
Julian KeefeJulian Keefe 
Error Message:
Challenge Not yet complete... here's what's wrong: 
The AccountTab Visualforce page does not include one or both of the following: the apex:slds tag in the page, or the slds-table value in the table.

Hello all. I am working on the new superbadge and getting stuck on Challenge 3 . I have tried several solutions but cannot get the data to display in table format. Here is my code below, my main issue is where to place the table class in realtion to the pageBlockTable.

<apex:page standardStylesheets="false" standardController="Account" recordSetVar="accounts" tabStyle="account" applyBodyTag="false">
    <apex:slds >
        
        <div class="slds-scope">
             
                <apex:pageBlock>
                    
                    <table class="slds-table"> 
                    <apex:pageBlockTable  value="{!accounts}" var="a">
                       
                        <apex:column headerValue="{!$ObjectType.Account.Fields.Name.Label}">
                            <apex:outputLink value="{!URLFOR($Action.Account.View, a.id)}">{!a.name}</apex:outputLink>
                        </apex:column>
                        
                    </apex:pageBlockTable> 
                    </table>
                    
                </apex:pageBlock>
            
        </div>
    </apex:slds>    
</apex:page>

 
Best Answer chosen by Julian Keefe
David HamburgDavid Hamburg
Try


<apex:page standardStylesheets="false" standardController="Account" recordSetVar="accounts" tabStyle="account">
<apex:slds />

    <div class="slds-scope">
        <apex:pageBlock >
   
            <apex:pageBlockTable value="{!accounts}" var="a"  styleClass="slds-table" >
                <apex:column headerValue="{!$ObjectType.Account.Fields.Name.Label}">
                    <apex:outputLink value="{!URLFOR($Action.Account.View, a.id)}">{!a.name}</apex:outputLink>
                </apex:column>
                
            </apex:pageBlockTable>
        </apex:pageBlock>
    </div>

</apex:page>