+ Start a Discussion
Barry Wang 11Barry Wang 11 

ask a question

Hello, I got a question for retriving data. For example, if I use code like this: <apex:outputtext value="{!Case.Owner.Name}" /> and I can get a text show on my web page. But how can I know where does each value after dot come from, is that simply (object name) . (field name) . (data wanna retrive). But how can I know the exact name of data that I wanna retrive?  The example I showed is a bad example, cuz I assume that the name of data I wanna retrive maybe call Name, yet I dont know where to find it.     Thanks for helping.
James LoghryJames Loghry

Hi Barry, think of each . as a relationship.  For instance, the first . means you're looking at a field on the case, the second dot means you're looking at a field on the Owner record (for instance a User or a Queue object).

For standard objects like Case, Account, Contact, Opportunity, Opportunity Products, etc, you can view the API names of the fields by logging into Salesforce and going to Setup->Customize->Case|Account|Contact|Opportunity...->Fields and looking for the proper field.  You'll find standard fields (like Name) at the top, and custom fields  (suffixed with __c) at the bottom.

There are some special fields that occasionally won't show up, but you can find them out if you google for the standard object and standard field.

For custom objects (Objects suffixed with __c), you can find these objects by going to Setup->Create->Objects->Custom Object Name.  On this page, you'll find a few standard fields (like Name, Created By, etc) at the top of the fields list and custom fields (fields suffixed with __c again) near the bottom.

In addition to fields, you also have relationships to other objects provided through either lookups or master detail fields.  To find the child relationship (For instance if I have a lookup on a custom object to Account), then I would click on the lookup field (Account__c) in this case.  This opens a detail page that contains the "Child Relationship Name".  Typically this is something plural like "Children" or "MyCustomObjects".  To reference the relationship in your code, you'd take the Child Relationship Name and tack on a "__r" for custom relationships.

There are other types of fields in addition to the above (like external objects and sharing records) that have different suffixes as well, but that's a whole different discussion.

Hope that helps.


Gregory Libo 8Gregory Libo 8
I am in the process of creating approval process (workflow and approvals). I have a miltiple approvers. Here are the apprval steps:
1. The creator submits the first part of the record to the first approver
2. The first approver additionally adds additional infromation to the record and sends the second approver
3. Second approver approves and forward for the next approver the approval
4. The third approver approves. End
My questions are, how do i enable the second approver to see more fields and enter data ?
Can i add a url link in the confirmation email. I don not know if i can edit fields from email?
Can i have two types of emails: one for approval and only one for notification?
Gregory Libo 8Gregory Libo 8
I have a few questions about notifications by email.
1. In the process of approving an approval step after you have approved this step, the system sends two types of emails to the approver: for notification approvers and for approvers to take action from email to approve or reject. In my approval process they are the same. Can I make them different? For example, the email to approve has an URL link but I do not want to have this URL in the notification email.

2. After I approved my step, I receive an email notification with the URL. When I click on the URL, I get the system generated email:
Data Not Available
The data you were trying to access could not be found. It may be due to another user deleting the data or a system error. If you know the data is not deleted but cannot access it, please look at our support page.

Does anyone know how to change this email or get read of it because it is confusing for managers?
Gregory Libo 8Gregory Libo 8
Please tell me what's wrong with this if statement. I am trying to post it in the email template subject:
{!if(ApprovalRequest.Status = "Submitted","Action Required", "FYI")} - {!if(ApprovalRequest.Status = "Submitted","New Account Worksheet" + Text(Worksheet__c.Id) + "is ready for approval", "New Account Worksheet" + Text(Worksheet__c.Id) + "Notification")}
Gregory Libo 8Gregory Libo 8
Is it possible to make restrictions during the approval process so that approvers can not submit a request?
Gregory Libo 8Gregory Libo 8
I am developing the approval process. Currently working on an email template. After sending 20-30 emails, e-mail stops working. Has anyone experienced this type of problem?
Gregory Libo 8Gregory Libo 8
Is it possible to distinguish between user rights between users who submit this record and users who approve the record? For example, if I am an approver I can not create or submit a record for the approval process. Only members or creators could enter a record. In other words, I want to adjust the visibility of a new button when you want to create a record. Make it visible only for submitter or creator only.
Zahid Akhtar 5Zahid Akhtar 5
Hello All, Can anyone give link to install Salesforce Dreamhouse Classic apps to complete trailhead challenge i.e. Make Your Classic App Available in Lightning Experience ?
Zahid Akhtar 5Zahid Akhtar 5
I have this package for Dreamhouse 



I think it is for Salesforce lightning, and still not working.

Please advice.
Hi  guys,

If lead status is working - contacted then record should be created automatically in child object with fields name , Email , Phone  and  its value taken from Lead parent object. I have lookup up with lead and custom object New Campaign.

How to write Batch Apex for this
Can anyone please help me with this???
sreenivas c 2sreenivas c 2
I have created a custom number field in case object .  It is called Overall Minutes  When I run a report, I get the sum of all the minutes at the bottom.  I would like it to be displayed as hours and minutes.  i have tried the below formula but i'm facing issue .

ROUND(Case.OverAll_Minutes__c:SUM)/60 & "Hour(s)"

Error: Invalid custom summary formula definition: Incorrect parameter type for operator '&'. Expected Text, received Number
subhi varshneysubhi varshney
I' m trying to integrate openCti with 3rd party application. i've already created a call center , Lighning app and added URL to the call center where my aplication is hosted.

In my Application I've created a simple html page and loaded Open CTI javascript file(/support/api/42.0/lightning/opencti_min.js).
All of lightning methods are workng fine except onClickToDial() .
when i'm trying to click on a number, i seem to get the following error on browser console.

Refused to execute JavaScript URL because it violates the following Content Security Policy directive: "script-src 'self' 'nonce-53911a5d-d5ee-cf08-b12f-3f3740998f67' chrome-extension: 'unsafe-inline' 'unsafe-eval' https://sfdc.azureedge.net *.cs72.visual.force.com 'unsafe-eval' https://ssl.gstatic.com/accessibility/". Note that 'unsafe-inline' is ignored if either a hash or nonce value is present in the source list.

I don't have any inline script in my html. I'm just simply using  Open CTI api in my html page to load lightning methods.I am not seeing anything else that would be JS related in my application.

Actual my point is, This error throws in salesforce Lighning js not one of my js and i noticed sometimes clicktodial listner works sometimes not.  

I've attached the html and js file with link posted below .it seems to me that this issue is not from our end.


What could be the possible reason for this..??? Please help me out... this is urgent...

Any help would be appreciated

Joana MatosJoana Matos

I have just started administering our salesforce account and one of the recommendations in the system is to update some APIs. As a best practice, do you always update them first in the sandbox, or for these updates that are highly recommended do you do them directly in the live environment? Thank you. 
Brijesh Yadav 73Brijesh Yadav 73
I'm new to salesforce, kindly someone help. i need to call one method inside another method of same class which returns list.
public list<string> assignListOfFieldsCampgnRequest(){
         return listOfFields;         
//Assume listOfFieldsCommon has valid list data
 public void showCountRolebaseddata(string selectedCountView)
        for(MDT_Picklist__c views : countUserViewNames)
i have a requirement where i need to call first method in multiple if blocks based on some condition.
right now method is not returning excpected list
Suraj MakandarSuraj Makandar

I have one Inline visualforce page which is visible in Firefox browser but not visible in Chrome browser for Custom profile. 

However, this page is working fine for System Administrator in Chrome browser.

I have provided all the required  permissions (Visualforce page and Apex class) to the Custom profile.

Simrandeep Singh 6Simrandeep Singh 6

My VF page is displaying the alert message popup twice, could you please help me out in this.
Khaled YoussefKhaled Youssef
hello, does any one find a solution for the problem : 

Refused to execute JavaScript URL because it violates the following Content Security Policy directive: "script-src 'self' 'nonce-53911a5d-d5ee-cf08-b12f-3f3740998f67' chrome-extension: 'unsafe-inline' 'unsafe-eval' https://sfdc.azureedge.net *.cs72.visual.force.com 'unsafe-eval' https://ssl.gstatic.com/accessibility/". Note that 'unsafe-inline' is ignored if either a hash or nonce value is present in the source list.

thanks in advance
Admin 2502Admin 2502
Lead can convert, Only to accounts. In Lead convert page lageout (only account) must be visible.
Rabbani Basha 1Rabbani Basha 1
I'm new to salesforce, kindly someone helps. I want to test class

global class Bacthupdate implements Database.Batchable<newsales__c>
  global Iterable<newsales__c> start(Database.BatchableContext BC)
       list<newsales__c> b =[select id,First_name__c,Name,country__c  from newsales__c];
         return b;
    global void execute (Database.BatchableContext bc,List<newsales__c> Scope)
        for(newsales__c ss : scope)   
     update scope;
    global void finish(Database.BatchableContext Bc)
        system.debug('finish method called');
        messaging.SingleEmailMessage mail = new messaging.SingleEmailMessage();
        list <string> Newmailaddress = new list<string> ();
         mail.setSubject('Completed for batch process completed');
   mail.setPlainTextBody('Hi User Can you check please now completed for batch class');
  messaging.SingleEmailMessage[] Messages = new list<messaging.SingleEmailMessage>{mail};
            messaging.SendEmailResult[] result = messaging.sendEmail(Messages);
Asif JamalAsif Jamal
Write a trigger on Account when rating field  holde some value then rating field update is not allow.
mita mukwevhomita mukwevho
Hi guys,

Can anyone help me to write apex code   for below task .

I want to send weekly emails to be sent out every Monday morning to users that have assigned requests with open statuses.
and i want to use this class to do the work: AssignedRequestsWeeklyEmail. It gets the users with open requests and their Email.
 create the (Email Template / run a report) (investigate what works)
The Email Template must have a list of the assigned users tasks.
There could be one or many tasks.
The user must only get his own requests in the Email.
Send the Email notification to the user. A list of his assigned, open requests.
sagar sanusagar sanu
Hii all,
I have a very important requirement to complete...I need to create a page in lightning aura component...am very new to lightning and not able to create it properly...I need a separate date, month and year picklist or dropdown type field in my page but not able to do it..kindly please help me with this..I have attach the image of my page view..User-added image
hema baskaranhema baskaran
Hi All,

Im new to Salesforce Technology. Kindly help me on Finance Force App. In my project they installed financeforce package. We are planning to remove some accounts records from production. I have check any impact(especially in FinanceForce) when we remove the records in accounts .Please reply asap.

sf lightning 1sf lightning 1
Hi, I am new to salesforce, I am unable form grid with images from the urls that I give in my apex class using Json, they are returning a list view insted of side by side. Any help would be appreciated.
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes" controller="pic_ctrl">
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
    <aura:attribute name="urls" type="String" />
       <!--  data: {!v.urls}  -->
        <aura:iteration items="{!v.urls}" var="row">
      <div class="slds-grid  slds-wrap"  style="height: 203px; width:400px ; background-color:white;" onclick="{!c.showcarousel}" >
       <div class="slds-col slds-size_1-of-2">
                      <img src="{!row}"  style="height: 200px; width:400px ; background-color:white;"/>
    doInit : function(component, event, helper) {
            var getdata = component.get("c.geturl");
      		var h = [];
            getdata.setCallback(this, function(response){      
                var state = response.getState();
                if (state === 'SUCCESS'){
                    var Result = response.getReturnValue();
                 //var finalJson = JSON.parse(finalJson1);
                    var len=Result.length;
                    for(var i=0; i<len; i++){
Apex class:

public class pic_ctrl {
    public static Object geturl() {
            String ImgJson = ' [        {"imageName": "Mice1.jpg","imageId": "101", "imageURL": "https://labpulse.s3.amazonaws.com/images/images1.jpg", "imageDescription": "Some description" },{"imageName": "Mice2.jpg","imageId": "101", "imageURL": "https://labpulse.s3.amazonaws.com/images/images2.jpg", "imageDescription": "Some description" },' +
       '{ "imageName": "Mice3.jpg","imageId": "102",  "imageURL": "https://labpulse.s3.amazonaws.com/images/images3.jpg", "imageDescription": "Some description" }, {"imageName": "Mice4.jpg", "imageId": "103", "imageURL": "https://labpulse.s3.amazonaws.com/images/images4.jpg",  "imageDescription": "Some description" }]';

		 Object Finaljson= JSON.deserializeUntyped(ImgJson); 
        return Finaljson;

OR HealthCloudOR HealthCloud
I trying to call a rest resource from a third party application using username and password authentication. When we send the httprequest we are getting statuscode 302 which give a URI to which our request should be routed.
We are handling that in our code and sending the same request to the URI requested in the location of the header that is received with statuscode 302, once we send the new request we are getting the statuscode 401, which states authentication failed. 
We have given the username and password and that is correct as well but still received statuscode 401. Anybody came accross same situation or have any suggestions?

If it helps, the application where rest resource reside is Curam.
Nishar Babu 9Nishar Babu 9


I want to get all Permission Set License with its child System/user Permissions and Object Permissions via Rest API.
I am able to see all Permission Set Licenses and associated User Permissions/Object Permissions in UI as below screenshot:
In SFDC UI,Permission Set License and corresponding UserPermission/ObjectPermissions
Currently I am using below Rest API to get the same:
https://salesforce.com/services/data/v32.0/queryAll?q=SELECT id,MasterLabel,DeveloperName,Language,PermissionSetLicenseKey,Status,TotalLicenses,UsedLicenses,MaximumPermissionsSalesConsole,MaximumPermissionsDeleteActivatedContract,MaximumPermissionsActivateContract,MaximumPermissionsIdentityConnect, MaximumPermissionsAssignPermissionSets,MaximumPermissionsManageProfilesPermissionsets FROM PermissionSetLicense

But It is not providing info for any Object Permissions and for few User Permissions (related to Orders Object) in Rest API response.

I need urgent help to get that above information through Rest API as well.

Note: I am able to see any System Permission regarding the Orders object.

Hiren Sharma 3Hiren Sharma 3

I created a manage package. I didn't require custom fields on Goal and Metric standard object. I want to remove it from manage package. I don't require Goal and Metric standard object in my manage package functionality.

When I try to install my beta version in another partial copy, I got as below message:
"This app can't be installed.
There are problems that prevent this package from being installed.
(Goal.OrigGoalId__c) Entity not available The Entity 'Goal' is not found. Contact the vendor for more details.
(Metric.OrigMetricId__c) Entity not available The Entity 'Metric' is not found. Contact the vendor for more details."

I can't install my manage package beta version in partial copy sandbox. Goal and Metric objects are not available in a partial copy sandbox.

When I created manage package beta version, Goal and Metric object custom fields automatically added in beta version. I don't require that fields. So How can I remove those fields, When I create a beta version of manage package. Fields names are as here Goal.OrigGoalId__c and Metric.OrigMetricId__c.

So give the solution to it.

Thanks in advance,

Vinod Dhas 17Vinod Dhas 17
Hello Community leaders,
I am facing below issue while taking Process Automation Specialist-- 2nd challenge.
User-added image
I gone through most of the posts available on success community but there is no luck.
PFB custom variables created, I cross verified many times along with validation rules and formulae,
but not sure how to tackle this issue...
User-added image
I gone through below threads as well..
Unfortunately, after applying solution suggested there, issue still persists.

Your early suggestion would help me to tackle this challenge...


varaprasad veeravilli 3varaprasad veeravilli 3

I have created a lightning page and wanted to assign it to some profile based on the App
and record type.

Lets say I want to assign it to app ABC and record type XYZ

I clicked on the activation link on the lightning app builder and choose the option that
asks for App, record type and profile.

But the challenge here is I am not able to see app ABC in the list to choose from

what could be the reason?

Please help
Aswini KondaAswini Konda
When I am trying to replace my string I am getting Regex too complicated error

 public static String getJSONFromStaticResource( String JSONFileName ) {
        String thisJSON = '';
        if( !String.isBlank( JSONFileName ) ) {
            for( StaticResource sr : [SELECT Body,ContentType,Id,Name FROM StaticResource WHERE Name LIKE :JSONFileName LIMIT 1 ] ) {
                thisJSON = sr.Body.toString().replaceAll('\n','');
                thisJSON = thisJSON.replace('/\\/g', '');
        return thisJSON;

Please help
Aravinth s 6Aravinth s 6
i have parent__c and child__c in master relationship with parent__c as parent.
In this I need to get smallest value of date in child need to update on parent date field.
For that I write the trigger code using aggregate result.
The problem is if the all the child in the respective parent deleted means the parent date remains with smallest date. But I need to be null.
How to make it null if all childs are deleted.
Ashish Chaudhari 65Ashish Chaudhari 65
can anyone tell me how to cover catch block in test class?

Apex Class:-

global class Sample {
    public class Accounts {
        public Integer count;
        public List<records> accountRecords;
    public class records {
        public Id AccountId;
        public String AccountName;
    global static void JSONAccount() {
        try {
            List<Account> accountList = [SELECT Id, Name FROM Account];
            List<records> recordsList = new List<records>();
            for(Account accountObj : accountList) {
                records recordsObj = new records();
                recordsObj.AccountId = accountObj.Id;
                recordsObj.AccountName = accountObj.Name;
            Accounts accountsObj = new Accounts();
            accountsObj.accountRecords = recordsList;
            accountsObj.count = [select count() from account];
            RestResponse res = RestContext.response;
            res.statusCode = 200;
            res.responseBody = Blob.valueOf(JSON.serialize(accountsObj));

        } catch(Exception e) {
            RestResponse res = RestContext.response;
            res.statusCode = 404;
            res.responseBody = Blob.valueOf('Something went wrong! Error Message : '+e.getMessage());

Test Class:-

public class SampleTest {
    public static void sampleTest() {
        Account acc = new Account(Name = 'Test');
        insert acc;
        RestRequest req = new RestRequest();
        RestResponse res = new RestResponse();
        req.requestURI = '/services/apexrest/Acc/';  //Request URL
        req.httpMethod = 'GET';//HTTP Request Type
        RestContext.request = req;
        RestContext.response = res;
Abdul Basit 82Abdul Basit 82
Hi ...i am facing issue in below code...
it is saying 'Comparison arguments must be compatible types: Integer, String'..
Kindly help..

public class AlphabetPrograms {
public static void countVowel(){
        //Counter variable to store the count of vowels and consonant  
        integer vCount=0; Integer cCount=0;
        //Declare a string  
        String str= 'This is a really simple sentence';
        //Converting entire string to lower case to reduce the comparisons 
        str = str.toLowerCase();
        for(integer i = 0; i < str.length(); i++) {  
            //Checks whether a character is a vowel
            if(str.charAt(i)=='a'|| str.charAt(i)=='e' || str.charAt(i)=='i' || str.charAt(i)=='o'|| str.charAt(i)=='u') {
                //Increments the vowel counter
            //Checks whether a character is a consonant  
            else if (str.charAt(i)>='a' && str.charAt(i)<='z'){
            //Increments the consonant counter
        System.debug('Number of vowels' + vCount++);  
        System.debug('Number of consonants: ' + cCount);  
How can we make certain recent records visible in Salesforce when we click any standard or custom object?