+ Start a Discussion
YiQin HeYiQin He 

I created a lightning component as a quick action button. In the component, I have a cancel button that I want it closed when user clicks.
User-added image

But the problem is that I cannot find any document explain how to close the modal dialog. This is the ui code:
<aura:component controller="ContactController" implements="force:lightningQuickActionWithoutHeader,force:hasRecordId" >
        .changeRecordTypeRow {
        margin-top: 1.5rem;
        margin-bottom: 0;
        margin-left: 0;
        margin-right: 0;
        .changeRecordTypeLeftColumn {
        float: left;
        text-align: right;
        padding-right: 1.5rem;
        width: 35%;
        font-size: .8125rem;
        color: rgb(84, 105, 141);
        .changeRecordTypeRightColumn {
        float: right;
        text-align: left;
        width: 65%;
        	height:auto !important;
        .forceChatterLightningComponent .bodyWrapper{height:100%;width:100%;padding:0;box-sizing:border-box}
    <div class="modal-header slds-modal__header">
        <h2 class="title slds-text-heading--medium" >Change Contact Type</h2>
    <div class="scrollable slds-modal__content slds-p-around--medium">
        <div class="changeRecordTypeRow">
            <fieldset class="slds-form-element">
                <div class="changeRecordTypeLeftColumn">
                    <legend class="form-element__legend slds-form-element__label">Select a record type</legend>
                <div class="changeRecordTypeRightColumn slds-form-element__control">

                    <span class="slds-radio">
                        <input type="radio" id="radio_PrimaryContact" name="recordType" />
                        <label class="slds-radio__label" for="radio_PrimaryContact">
                            <span class="slds-radio--faux"></span>
                            <span class="slds-form-element__label">Primary Contact</span>
                    <span class="slds-radio">
                        <input type="radio" id="radio_SecondaryContact" name="recordType" />
                        <label class="slds-radio__label" for="radio_SecondaryContact">
                            <span class="slds-radio--faux"></span>
                            <span class="slds-form-element__label">Secondary Contact</span>
    <div class="modal-footer slds-modal__footer">
    	<div class="forceChangeRecordTypeFooter">
        	<button type="button" class="slds-button slds-button--neutral .slds-modal__close" aura:id="btnCancel" >
            <button type="button" class="slds-button slds-button--brand" aura:id="btnSave">
Does anyone have similar experience? Thanks in advance.
Best Answer chosen by YiQin He
YiQin HeYiQin He
Hi Karthik,

Thanks for the reply. I've already found the solution.
Call this method $A.get("e.force:closeQuickAction").fire() will close the modal dialog.


I alwaays get error when i try to save something from Dev console

Failed to create createContainerMember for containerId duplicate value found: <unknown> duplicates value on record with id: <unknown>
Best Answer chosen by Sandrine

Follow these stepsGo to Developer Console -> Work Space -> New Workspace
Create a new workspace
Save classes/triggers


Try again, it should be fixedIf my answer helps resolve your query, please mark it as the 'Best Answer' and upvote it to benefit others and improve the overall quality of Discussion Forums.

Ashlekh Gera


Hello Helper


I want to export   from an org a package  containing  custom objects,  Custom fields , classes,  custom buttons......


I created a package.xml  file where I included  the Metadata  types  I want to export


I can not  specify  Custom button Metadata  type

Looking into the salesforce docs it seems to me that is is  considered as weblink


I tried  something like  below







but it does not work


any suggestion?



Thanks in advance






Best Answer chosen by csbaa
David CheungDavid Cheung
@csaba, meta data name for custom button is WebLink - in the singular form, you had it as WebLinks.
@Admin why was @Vinita_SFDC chosen as the best answer?

I got following error on step 3.

Challenge Not yet complete... here's what's wrong: 
Couldn’t find Agency records from the Account object.

Can anyone pass this step?
Thanks in advance.

Best Answer chosen by LinThaw
Hi Jennifer and ankita,

Please refer below, I passed this step 3.

fig 1.
User-added image

fig 2.
User-added image

and create Top 5 Agencies lenses.

Justin DurossJustin Duross 
Hello, for the Salesforce Trailhead "Using Future Methods" I keep getting the error "The 'AccountProcessorTest' test class doesn't appear to be calling the 'AccountProcessor.countContacts' method between Test.startTest() and Test.stopTest()." I believe I have the right syntax, so I'm not sure what is wrong. My main class is fine. the problem only seems to be in the AccountProcessorTest.apxc

@isTest private class AccountProcessorTest {
    @isTest static void countContacts() {
        Test.setMock(AccountProcessorTest.class, new Account());

Here is my main class in case anyone needs it:

global class AccountProcessor {
    public static void countContacts(Set<id> setId){
        List<Account> lstAccount = [SELECT Id, Number_of_Contacts__c, (SELECT Id FROM Contacts) FROM Account where id in : setid];
        for(Account acc: lstAccount){
            List<Contact> lstCont=acc.contacts;
            	acc.Number_of_Contacts__c = lstCont.size();
        update lstAccount;

Thank you in advance!
Justin Duross

Best Answer chosen by Justin Duross
Amit Chaudhary 8Amit Chaudhary 8
Please check below post for same issue
1) https://developer.salesforce.com/forums/?id=906F0000000D8hwIAC

Please update your Test class like below:-
public class AccountProcessorTest {
    public static testmethod void TestAccountProcessorTest() 
        Account a = new Account();
        a.Name = 'Test Account';
        Insert a;

        Contact cont = New Contact();
        cont.FirstName ='Bob';
        cont.LastName ='Masters';
        cont.AccountId = a.Id;
        Insert cont;
        set<Id> setAccId = new Set<ID>();
        Account ACC = [select Number_of_Contacts__c from Account where id = :a.id LIMIT 1];
        System.assertEquals ( Integer.valueOf(ACC.Number_of_Contacts__c) ,1);
Let us know if this will help you

Jordan MJordan M 
I am new to LWC and cant seem to figure out how to open the source code for LWC. Aura can be opened in the dev console but from what i understand this is not possible with LWC.

Is it possible to open a LWC source code from within the org? I have a LWC that was developed by someone else that needs editing. How can I access the source code?
Best Answer chosen by Jordan M
Soyab HussainSoyab Hussain
Hi Jordan Mathews,

Step 1. Go to workbench and login.


Step 2.  Click on retrieve button.

User-added image
Step 3. click on "Choose File" button and upload package.xml file.

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">

Step 4. click on next and retrieve metadata, it will give you all the LWC components exist in your org.

User-added image

Step 5. click Download ZIP File.

Filip Poverud 4Filip Poverud 4 
Build a Conference Management App --> Create an Aura Component

I have tried to Copy/Paste using CTRL+C and CTRL+V, using the mouse copy/paste functions and also writing the code manually but all attempts fail. Are there any other ways of copying the text so I can complete this challenge ?
Best Answer chosen by Filip Poverud 4
Filip Poverud 4Filip Poverud 4
I fixed the error by using:

Instad of:

For some reason it was the navigation back to the record that failed using the code in the module.
Kyle HavelkaKyle Havelka 
Hi All,

Let me preface this with a disclaimer. I am fairly new to SalesForce development. But I have 11 years experience as a developer.

I am working on a LWC that calls an Apex controller.

The Apex controller runs a fairly simple SOQL query against a custom object Move_Type__c. It has a master detail relationship with another Custom object Move_Goal_Type__c (see below)

Move_Type & Move_Goal_Type

Here is the query: 
[SELECT Name, Id
FROM pursue02__Move_Type__c
WHERE pursue02__Move_Goal_Type__r.Id = :movegoalTypeId ]
The variable comes into the controller (MoveTypeController) as an Id through a method getMoveTypesByMoveGoalTypeId which is decorated with @AuraEnabled(cacheable=true)

When I execute anonynmous, it works as expected, I get a list of Move_Type__c records with the Name and Id.

When the LWC calls it, it returns an empty array. Now I have debugged the method System.debug(movegoalTypeId) and it shows the correct value. And I assigned the SOQL results to a variable and output that as well, it shows values in the debug logs.

I have also checked the network traffic via chrome developer tools and it's sending the value as expected:
message: {
    "actions": [
            "id": "815;a",
            "descriptor": "aura://ApexActionController/ACTION$execute",
            "callingDescriptor": "UNKNOWN",
            "params": {
                "namespace": "pursue02",
                "classname": "MoveTypeController",
                "method": "getMoveTypesByMoveGoalTypeId",
                "params": {
                    "goalTypeId": "a013k00000aWHa6AAG"
                "cacheable": true,
                "isContinuation": false
But as I said it returns an empty array:
"actions": [
            "id": "815;a",
            "state": "SUCCESS",
            "returnValue": {
                "returnValue": [],
                "cacheable": true
            "error": []
We have checked the permissions on both Move_Type__c and Move_Goal_Type__c, and they all appear to be correct.

Any one know what we are doing wrong? I'm scratching my head on this one.

Any help would be greatly appreciated!

Best Answer chosen by Kyle Havelka
Alain CabonAlain Cabon
  • Be careful to the used character case for the parameter goalTypeId even if Apex is not case sensitive but use preferably exactly the same values for the  parameters by copying/pasting the value between javascript and apex for the method name and the parameters.
  • You can try without cacheable=true
Ghulam Murtaza 5Ghulam Murtaza 5 

i am a newbie to salesforce and trying to complete this trailhead challenge and unable to find a way through apex to generate this method for creating new contacts with unique id. as one requirement to pass the challenge is "The 'generateRandomContacts' method must be capable of consistently generating contacts with unique first names."

If somebody successfully completed the task kindly help me.

Best Answer chosen by Ghulam Murtaza 5
Ghulam Murtaza 5Ghulam Murtaza 5
hi pankaj,
i have completed the task somehow. my friend completed it with a simple code i.e. 
public class RandomContactFactory{
   public static List<Contact> generateRandomContacts(integer n,string lastname){
       integer n1= n;
       list<contact> c=[select  FirstName from contact limit : n1];
       return c;

but for me it was giving error of class not created as static or either the method is not returning the first name. so for me it worked as follows:

public class RandomContactFactory{

    public static List<Contact> generateRandomContacts(integer n,string LastName){
    integer n1=n;
    List<contact> c1 = new list<contact>();
    list<contact> c2 =new list<contact>();
     c1 = [select FirstName from Contact Limit : n1];
     integer i=0;
     for(contact cnew : c1){
     contact cnew1 = new contact();
     cnew1.firstname = cnew.firstname + i;
    return c2;

Please help me ,

 I create new formula field ( Data type is Number ) for calculate value from text field but system not allow me to calculate it. Do you have any suggest me ?


Best Answer chosen by Admin (Salesforce Developers) 
Ritesh AswaneyRitesh Aswaney

Use the VALUE function


Converts a text string that represents a number to a number