Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Jacob SelfJacob Self 

I've installed a custom timesheet application into our organization's Salesforce.  We recently ran into a problem where one staff member created their timesheet for the week, but then another staff member (who is new to Salesforce) went into her timesheet and edited it on accident.
User-added image
As you can see, the Owner and Created By fields are a different user than the Last Modified.  We would like to prevent this from happening in the future.  Is there a rule I can put in place so that only the creator of the record is able to edit that record?  In addition to only the creator being able to edit, it would be ideal if users with the system administrator profile would also be able to edit the record.  Is this possible?
Best Answer chosen by Jacob Self
Eric PraudEric Praud
Hi Jacob,

I woudl change the sharing settings to Private so others can not even see other people timesheet, they coudl only see the ones they created.
As for the System admin, by default they have the Modify All Data permission, so no need to do anything there 
aditya raoaditya rao 
Hi Experts,

I am updating the records using batch class, but i am getting below error.
Ending position out of bounds: -1 on the line which i highlighted. kindly can anyone help me plesae.
String imageUrl = PageReference.forResource('Image').getUrl();
 imageUrl = imageUrl.subString(0,imageUrl.indexOf('?'));

Best Answer chosen by aditya rao
Kundan Kumar JhaKundan Kumar Jha
++ In imageurl '?' this charecter present or not? Because you are trying to access.
Max EvryMax Evry 
I'm trying to implement a Combination chart (line/bar) for a report and ultimately as a dashboard component in Salesforce Lightning. Currently I'm not seeing any options for it among the generic chart settings within a report. Is this achievable or a feature that's only available for Salesforce Classic?
Best Answer chosen by Max Evry
Kundan Kumar JhaKundan Kumar Jha
Refer :       

Jamie McGarrigleJamie McGarrigle 
Hi there,

I have recently created a new app and the way that users access objects in the app is through a strip of objects at the top (see screen grab 1).

I want to change this so that the objects are instead accessed from a dropdown menu (see screen grab 2).

Does anyone know how to make this update?




Screen grab 1:
User-added image

Screen grab 2:

User-added image
Best Answer chosen by Jamie McGarrigle
Eric PraudEric Praud
Hi Jamie,

Tgis is because screenshot2 is a console app. You cannot change a "standard" app to a console app though, you'll need to create a new one under Set up> App Manager
harsh shuklaharsh shukla 
I am tryiing to create simple voting criteria in Lightning.

If age>=18. Alert = Congrats!! You can vote. Show button =  Submit your vote

else---  alert = 'Sorry you can't vote'.

Below is the code i am trying but failed..

Component Code:
<aura:component implements="force:appHostable,
                force:lightningQuickAction" access="global" >
    <aura:attribute name = "EligibleForVoting" type = "boolean"></aura:attribute>
    <ui:inputText label = "First Name:" aura:id="firstName" placeholder = "Enter your first name"></ui:inputText>
    <ui:inputText label = "Last Name:" aura:id="lastName" placeholder = "Enter your last name"></ui:inputText>
    <ui:inputText label = "Age:" aura:id="age" placeholder = "Enter your age"></ui:inputText>
    <ui:button aura:id = "buttonforaction" label = "submit" press = "{!c.getEligibility}"></ui:button>
  <aura:if isTrue = "{!v.EligibleForVoting}">
      Congrats! You can vote.
      <ui:button  label  = "Please vote"></ui:button>
              <aura:set attribute = "else">
          Sorry! You can't Vote.
Controller Code:
    getEligibility : function(component) {
        var firstname = component.find("firstName").get("v.value");
        var lastname = component.find("lastName").get("v.value");
        var age = component.find("age").get("v.value");
            component.set("EligibleForVoting", true);
            component.set("EligibleForVoting", false);

Please help for best output.
Best Answer chosen by harsh shukla
Ghanou LahbibGhanou Lahbib

when setting aura:attribute value use component.set("v.attribute", value)

in your case component.set("v.EligibleForVoting",true) or false

Grace DavidsonGrace Davidson 

I have a existing date field called Contract end date and I want to create a new field called Rnewal 
In the renewal field I want to add a formula to show Contract end date minue 6 mths 

How do I write this? 

Thanks in advance 
Best Answer chosen by Grace Davidson
Eric PraudEric Praud
Then do this:
Ashish jaisAshish jais 
Hin All, I have issue in gloabl search at lighting .
Under the "All" at search User object is not coming. Please help how to achive the User object come under the serch list. Plesae see the below image for more Info.
User-added image

Best Answer chosen by Ashish jais
charu goyalcharu goyal
Hi Ashish,

In lightning, People refers to User object.
Your org's chatter must be off. That's why, you are not able to view People in dropdown.
You can refer below knowledge article. It explains the same issue.  (

Charu Goyal
KIM SportsManagementKIM SportsManagement 

I have a question about sending out list e-mail. We have created a new custom field, which we have called "Private E-Mails" for example. But if you want to send a list email, you can only use the "standard field" "email", which is already predefined by Salesforce. Is there a possibility to send e-mails to other fields? 

Thanks in advance for your help!

With kind regards,

Best Answer chosen by KIM SportsManagement
charu goyalcharu goyal
Hi Aaron,

You can send e-mails to custom field as well. For that field data type should be 'Email'. 
Once the data type of field is 'Email', you can select that field in your email alert.

Charu Goyal
Ashutosh SarpalAshutosh Sarpal 
Not able to complete challenge "Create a method for inserting accounts." in module " Manipulate Records with DML". Below is the challenge :

To pass this challenge, create an Apex class that inserts a new account named after an incoming parameter. If the account is successfully inserted, the method should return the account record. If a DML exception occurs, the method should return null.
The Apex class must be called AccountHandler and be in the public scope
The Apex class must have a public static method called insertNewAccount
The method must accept an incoming string as a parameter, which will be used to create the Account name
The method must insert the account into the system and then return the record
The method must also accept an empty string, catch the failed DML and then return null
Best Answer chosen by Ashutosh Sarpal
Bablu Kumar PanditBablu Kumar Pandit
Hey ashutosh,
try Below code
public class AccountHandler {
public static Account insertNewAccount(String strname) {
Account obj = new Account();
obj.Name = strname;
insert obj;
} catch (Exception e) {
return null;
return obj;

try above code and let me know
Ashutosh SarpalAshutosh Sarpal 
Not able to complete challenge "Create an Apex class with a method that returns an array (or list) of strings" in "Get Started with Apex" module. Please help
Best Answer chosen by Ashutosh Sarpal
Ankush AgarwalAnkush Agarwal
Hi Ashutosh,

you may try with below:
public class StringArrayTest
    public static List<String> generateStringArray(Integer n)
        List<String> List1 = new List<String>();
        for(Integer i =0; i < n; ++i)
            List1.add('Test ' + i);
        return List1;