+ Start a Discussion
Best Answer chosen by Pratik Desai 16
NagendraNagendra (Salesforce Developers) 
Hi Pratik,

Firstly, I would request you please elaborate your question as it's not so clear.

Can you be more specific about having multiple owners?

Is that for a custom object, or an account, or contact, opportunity etc...

For example, if you want to have multiple owners for an opportunity created then you can make use of Opportunity teams to add multiple people to work on an opportunity record.

It still doesn't mean an opportunity has multiple owners just that multiple members can collaborate on it. The other way is you can use sharing rules to open up access to more members.

If you want to have more that one owner for a particular record then this functionality is not available as of now.

There is an idea which is active on the success community for which you can upvote so that it gets available in the mere future.

You can find the idea at the below link. Hope this helps.

Kindly mark this as solved if the reply was helpful.

Juan GarcíaJuan García 

I have a doubt creating a lightning datatable. Can I edit the columns doing double click ?
I only can edit the data clicking to the edit icon. In standard List View, we can edit the value doing double click anywhere in the column.

User-added image

Best Answer chosen by Juan García
NagendraNagendra (Salesforce Developers) 
Hi Juan,

As of today lightning:datatable does not allow start inline editing on "double click" of the cell. It only supports inline editing by:

Clicking the pencil icon that appears for an inline editable cell
  • By pressing enter on the cell
  • Below is the excerpt from the documentation:
Working with Inline Editing: When you make a column editable, a pencil icon appears when you hover over the cells in that column. Clicking the icon or pressing the Enter key triggers inline editing.

Hope this helps.

Kindly mark this as solved if the reply was helpful.

Peter Martensen 8Peter Martensen 8 
I have a Class that sends an email when an Opportunity is Closed Won and if the Line_of_Service__c does not contain “Agawam”.  I need to add “Whippany” and “Mirabel” to that exclusion.  Can someone help me modify this code to exclude those also?
List<Opportunity> oppsThatGetAlerts = new List<Opportunity>();
        for( Opportunity o : updatedOpportunities ) {
            // 11-08-2016 jhm: If the Opp just went to Closed Won and it's from Durham, NC or Longmount, CO, Edinburgh we want to send an alert.
            if( ('Closed Won' == o.StageName) && ('Closed Won' != opportunityOldMap.get(o.Id).StageName) && (!o.Line_of_Service__c.contains('Agawam') ) ) {
                oppsThatGetAlerts.add( o );
        if( 0 < oppsThatGetAlerts.size() ) {
           sendOppAlerts( oppsThatGetAlerts );

Best Answer chosen by Peter Martensen 8
Yash ShuklaYash Shukla
you can go on adding your further exclusion values with && operator as in line 4
Ravish Verma 15Ravish Verma 15 
I am using a lightning edit record control and I want to display picklist values as radio buttons and selected picklist value in the backend should display, selected radio buttons. Is it possible using lightning editrecord and any other way to acheive this ? any help will be much appriciated.

Best Answer chosen by Ravish Verma 15
Khan AnasKhan Anas (Salesforce Developers) 
Hi Ravish,

Greetings to you!

Please try the below code, I have tested in my org and it is working fine. Kindly modify the code as per your requirement.

public class SampleController {
    @AuraEnabled //Save Account Data
    Public static void createAccount(Account objacc){
            //Insert Account Record
            insert objacc; 
        }catch(Exception e){
            //throw exception message
            throw new AuraHandledException(e.getMessage());
        finally {
    @AuraEnabled //get Account Industry Picklist Values
    public static Map<String, String> getIndustry(){
        Map<String, String> options = new Map<String, String>();
        //get Account Industry Field Describe
        Schema.DescribeFieldResult fieldResult = Account.Industry.getDescribe();
        //get Account Industry Picklist Values
        List<Schema.PicklistEntry> pList = fieldResult.getPicklistValues();
        for (Schema.PicklistEntry p: pList) {
            //Put Picklist Value & Label in Map
            options.put(p.getValue(), p.getLabel());
        return options;

<aura:component controller="SampleController" implements="flexipage:availableForAllPageTypes,force:appHostable">
    <!--Declare Attributes-->
    <aura:attribute name="industryMap" type="Map"/>
    <aura:attribute name="acc" type="Account" default="{'sobjectType':'Account', 
                                                       'Name': '',
                                                       'AccountNumber': '',
                                                       'Email': '',
                                                       'Phone': '', 
                                                       'Industry': ''}"/>
    <!--Declare Handler-->
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>  
    <!--Component Start-->
    <div class="slds-m-around--xx-large">
        <div class="container-fluid">
            <div class="form-group">
                <lightning:input name="accName" type="text" required="true" maxlength="50" label="Account Name" value="{!v.acc.Name}" />
            <div class="form-group">
                <lightning:input name="accNumber" type="text" required="true" maxlength="10" label="Account Number" value="{!v.acc.AccountNumber}" />
            <div class="form-group">
                <lightning:input name="accEmail" type="email" required="true" maxlength="100" label="Email" value="{!v.acc.Email}" />
            <div class="form-group">
                <lightning:input name="accPhone" type="phone" required="true" maxlength="10" label="Phone" value="{!v.acc.Phone}" />
            <div class="form-group">
                <!--Lightning radio group component-->
                <lightning:radioGroup name="radioGroup"
        <lightning:button variant="brand" label="Submit" onclick="{!c.handleAccountSave}" />              
    <!--Component End-->

    //Load Account Industry Picklist
    doInit: function(component, event, helper) {        
        helper.getIndustryPicklist(component, event);
    //handle Account Save
    handleAccountSave : function(component, event, helper) {
        helper.saveAccount(component, event);
    //handle Industry Picklist Selection
    handleCompanyOnChange : function(component, event, helper) {
        var indutry = component.get("v.acc.Industry");

    //get Industry Picklist Value
    getIndustryPicklist: function(component, event) {
        var action = component.get("c.getIndustry");
        action.setCallback(this, function(response) {
            var state = response.getState();
            if (state === "SUCCESS") {
                var result = response.getReturnValue();
                var industryMap = [];
                for(var key in result){
                    industryMap.push({label: result[key], value: key});
                component.set("v.industryMap", industryMap);
    //handle Account Save
    saveAccount : function(component, event) {
        var acc = component.get("v.acc");
        var action = component.get("c.createAccount");
            objacc : acc
            var state = response.getState();
            if(state === "SUCCESS"){
                alert('Record is Created Successfully');
            } else if(state === "ERROR"){
                var errors = action.getError();
                if (errors) {
                    if (errors[0] && errors[0].message) {
            }else if (status === "INCOMPLETE") {
                alert('No response from server or client is offline.');

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas
Nagarajan CNagarajan C 
My requirement - want to delete my old custom profile ,So i want to remap to all user  to another profile ,So one shot i need to remap all user to some other profile .can you please help on this
Best Answer chosen by Nagarajan C
SFDC Prime SquadSFDC Prime Squad
Hi Nagarajan, 

Try creating a new custom profile and export the list of all the users from the old profile. Using data loader you can replace the old profile id with a new one and update all the users in one go.
Juan GarcíaJuan García 

I have a datatable, and I need a text column with hiperlink to the reference object.
I want a similar table to a standard list view, the name of the column record is a hiperlink of the record page

List view of a record:
User-added image

Datatable with a colum type url
User-added image

Datatable with a colum type text
User-added image

cmp.set('v.columns', [
            {label: 'Recurso', fieldName: 'Name', type: 'url', sortable: true, editable:'true', initialWidth: 120},

Best Answer chosen by Juan García
Alain CabonAlain Cabon

You need two fields: a shown label and a value for the underlying url.


  cmp.set('v.columns', [ 
                label: 'My Column Label',
                fieldName: 'myUrlField',
                type: 'url',
                typeAttributes: { label: {fieldName: 'myLabel'}},
... ]);

                    myUrlField =   '/one/one.app?#/sObject/' + item.Id + '/view';
                    myLabel = 'My test of label':

Tony Williams 9Tony Williams 9 
HI I'm trying top traverse an XML tree to get the Items Tag list. I was using iterative but the problem is that it seems that I can only get the lst item but I don;t get them all. Can someone p0leaswe help me?  Thanks Here's the tree:
<Shipment id="103052074"> 
    <PurchaseOrder /> 
    <Name>SILVIA GIBSON</Name> 
    <Company /> 
    <Address1>11900 TRADITION LN NE </Address1> 
    <Address2 /> 
    <Country>UNITED STATES</Country> 
    <Phone /> 
    <ExpectedDeliveryDate>2019-01-18T00:00:00</ExpectedDeliveryDate> <DeliveredTimestamp /> <DeliveryException />             
    <Warehouse id="160"> 
       <Name>Greenwood, IN</Name> 
       <Address>1415 Collins Rd.</Address> 
    <ShipMethod>Newgistics Parcel Select</ShipMethod> 
    <Tracking>9200000000000629213249</Tracking>                  <TrackingUrl>http://shipment.co/tracking/2817/9200000000000629213249</TrackingUrl> 
     <Postage /> 
         <BillingAddress1>1620 N Penny Ln</BillingAddress1> 
         <BillingCompany>Cherry Hills Community Church</BillingCompany> 
         <BillingCountry>United States</BillingCountry> 
         <BillingPhone>(866) 292-6227</BillingPhone> 
      <BackorderedItems /> 
         <Item id="1807577"> 
                <UPC /> 
                 <Description>Cubbies AppleSeed Handbook Music CD NIV</Description> 
                <Lot /> 
               <CustomFields /> 
               <AssemblyItems /> 
      <Item id="1807606"> 
             <UPC /> 
             <Description>Cubbies HoneyComb Teaching Plans NKJV</Description> 
             <Lot /> 
             <CustomFields />  
             <AssemblyItems /> 
      <Item id="1807670"> 
           <UPC /> 
           <Description>Game Pin (4)</Description> 
           <Lot /> 
           <CustomFields /> 
           <AssemblyItems /> 
        <Item id="1807691"> 
          <UPC /> 
          <Description>Gray Blouse, Leader Size 4X</Description> <Lot /> 
         <Qty>3</Qty> <CustomFields /> 
          <AssemblyItems /> 
   <Package id="86892375"> 

Best Answer chosen by Tony Williams 9
Alain CabonAlain Cabon

You just want the <items> <Item id="1807577"> ... </item> </items>

There is a mistake in your xml source   <Packages>

If you just install this class you can use a subset of XPathhttps://github.com/JenniferSimonds/apex-xpath/blob/1.0.1/XPath.cls

Dom.XmlNode[] items = xp.find('/Shipment/Items/Item');

You just need this XPath expression : /Shipment/Items/Item   (  shortest way to get all the items )
String xml = '<Shipment id="103052074"> \n' +
'    <ClientName>Awana</ClientName> \n' +
'    <OrderID>01061767</OrderID> \n' +
'    <PurchaseOrder /> \n' +
'    <Name>SILVIA GIBSON</Name> \n' +
'    <FirstName>SILVIA</FirstName> \n' +
'    <LastName>GIBSON</LastName> \n' +
'    <Company /> \n' +
'    <Address1>11900 TRADITION LN NE </Address1> \n' +
'    <Address2 /> \n' +
'    <City>ALBUQUERQUE</City> \n' +
'    <State>NM</State> \n' +
'    <PostalCode>87111-8287</PostalCode> \n' +
'    <Country>UNITED STATES</Country> \n' +
'    <Email>silviagibson@mailinator.com</Email> \n' +
'    <Phone /> \n' +
'    <OrderTimestamp>2019-01-18T00:00:00</OrderTimestamp> \n' +
'    <ReceivedTimestamp>2019-01-18T13:59:26.007</ReceivedTimestamp> \n' +
'    <ShipmentStatus>SHIPPED</ShipmentStatus> \n' +
'    <OrderType>Consumer</OrderType> \n' +
'    <ShippedDate>2019-01-18T14:16:37.550</ShippedDate> \n' +
'    <ExpectedDeliveryDate>2019-01-18T00:00:00</ExpectedDeliveryDate> <DeliveredTimestamp /> <DeliveryException />             \n' +
'    <Warehouse id="160"> \n' +
'       <Name>Greenwood, IN</Name> \n' +
'       <Address>1415 Collins Rd.</Address> \n' +
'       <City>Greenwood</City> \n' +
'       <State>IN</State> \n' +
'       <PostalCode>46143</PostalCode> \n' +
'       <Country>US</Country> \n' +
'    </Warehouse> \n' +
'    <ShipMethod>Newgistics Parcel Select</ShipMethod> \n' +
'    <ShipMethodCode>NGSPS</ShipMethodCode> \n' +
'    <Tracking>9200000000000629213249</Tracking>                  <TrackingUrl>http://shipment.co/tracking/2817/9200000000000629213249</TrackingUrl> \n' +
'     <Weight>4.000000</Weight> \n' +
'     <Postage /> \n' +
'     <GiftWrap>false</GiftWrap> \n' +
'     <CustomFields> \n' +
'         <BillingAddress1>1620 N Penny Ln</BillingAddress1> \n' +
'         <BillingCity>Schaumburg</BillingCity> \n' +
'         <BillingCompany>Cherry Hills Community Church</BillingCompany> \n' +
'         <BillingCountry>United States</BillingCountry> \n' +
'         <BillingEmail>silviagibson@mailinator.com</BillingEmail> \n' +
'         <BillingFirstName>Heather</BillingFirstName> \n' +
'         <BillingLastName>Oliver</BillingLastName> \n' +
'         <BillingPhone>(866) 292-6227</BillingPhone> \n' +
'         <BillingState>IL</BillingState> \n' +
'          <BillingZip>60173</BillingZip> \n' +
'           <Shipping>17.87</Shipping> \n' +
'           <Total>190.52</Total> \n' +
'      </CustomFields> \n' +
'      <BackorderedItems /> \n' +
'      <Items> \n' +
'         <Item id="1807577"> \n' +
'               <SKU>94900</SKU> \n' +
'                <UPC /> \n' +
'                 <Description>Cubbies AppleSeed Handbook Music CD NIV</Description> \n' +
'                <Lot /> \n' +
'                <Qty>2</Qty> \n' +
'               <CustomFields /> \n' +
'               <AssemblyItems /> \n' +
'       </Item> \n' +
'      <Item id="1807606"> \n' +
'             <SKU>96543</SKU> \n' +
'             <UPC /> \n' +
'             <Description>Cubbies HoneyComb Teaching Plans NKJV</Description> \n' +
'             <Lot /> \n' +
'             <Qty>1</Qty> \n' +
'             <CustomFields />  \n' +
'             <AssemblyItems /> \n' +
'      </Item> \n' +
'      <Item id="1807670"> \n' +
'           <SKU>96918</SKU> \n' +
'           <UPC /> \n' +
'           <Description>Game Pin (4)</Description> \n' +
'           <Lot /> \n' +
'           <Qty>4</Qty> \n' +
'           <CustomFields /> \n' +
'           <AssemblyItems /> \n' +
'     </Item> \n' +
'        <Item id="1807691"> \n' +
'          <SKU>46421</SKU> \n' +
'          <UPC /> \n' +
'          <Description>Gray Blouse, Leader Size 4X</Description> <Lot /> \n' +
'         <Qty>3</Qty> <CustomFields /> \n' +
'          <AssemblyItems /> \n' +
'     </Item> \n' +
'  </Items> \n' +
'   <Package id="86892375"> \n' +
'      <TrackingNumber>9200000000000629213249</TrackingNumber>\n' +
'      <Weight>4.30507</Weight> \n' +
'      <BillableWeight>4.00000</BillableWeight> \n' +
'      <Height>7.00000</Height> \n' +
'      <Width>4.00000</Width>  \n' +
'      <Depth>6.00000</Depth> \n' +
'</Package>\n' +
'</Shipment> \n';
XPath xp = new XPath(xml);
Dom.XmlNode[] items = xp.find('/Shipment/Items/Item');

for (Dom.XmlNode item : items) {
    String item_id = item.getAttribute('id',null);   
    String item_weight = xp.getText(item, '', './SKU');
    String item_description = xp.getText(item, '', './Description');  
    system.debug('item:' + item_id + ' = ' + item_weight + ' = ' + item_description);


  public static Map<Lead, List<Account>> getFn(Map<Lead, String> maptest) {
     Id temp= Account.sObjectType.getDescribe().getRecordTypeInfosByDeveloperName().get('RecodNameEx').getRecordTypeId();

When i put this line i get below error:

Method does not exist or incorrect signature: void getRecordTypeInfosByDeveloperName() from the type Schema.DescribeSObjectResult
Best Answer chosen by Sandrine
Raj VakatiRaj Vakati
Change is like this
Id temp = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('RecodNameEx').getRecordTypeId();

complete code
public static Map<Lead, List<Account>> getFn(Map<Lead, String> maptest) {
	 Id temp = Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('RecodNameEx').getRecordTypeId();

Niraj Singh 28Niraj Singh 28 
Hello All,

I needed to change value of messageWhenValueMissing using javascript.

Thanks & HNY2019
Best Answer chosen by Niraj Singh 28
Raj VakatiRaj Vakati
Try like this
<aura:component >
    <aura:attribute name="truthy" default="true" type="boolean"/>
	    <aura:attribute name="mesasge" default="First name is required" type="boolean"/>

    <lightning:button label="Click Me" onclick="{!c.clickMe}" />
     <aura:if isTrue="{!v.truthy}">
    <lightning:input type="text" name="firstName" required="true" aura:id="firstName" label="First Name" value="{!v.firstName}" 
   com.set('v.mesasge','Error from JS');

Juan GarcíaJuan García 
Hi Devs,

I have some problems with a component that is going to be using a <lightning:datatable /> object.
There are data not visible, and the ddbb this values are filled. This values not load in the table.
Name is ok, the table can be editabled, and the sort works, but values not load (the fields are number, 16 with 2decimals). If I click on the column, show the value, but if I dont click, the value not is shown)

<aura:component controller="TCK_DesglCoste_ByOpp_Ctr"
                access="global" >
    <!-- handlers-->
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
    <aura:handler event="force:refreshView" action="{!c.doInit}" />
    <!-- attributes -->
    <aura:attribute name="columnsDesglose" type="List"/>
    <aura:attribute name="desgloseCosteList" type="Desglose_Coste__c[]"/>
    <aura:attribute name="sortedBy" type="String" default="Name"/>
    <aura:attribute name="sortedDirection" type="String" default="asc"/>
    <div class="slds-page-header">
        <div class="slds-grid">
            <div class="slds-col slds-has-flexi-truncate">
                <div class="slds-media slds-no-space slds-grow">
                    <div class="slds-media__figure">
                        <lightning:icon iconName="custom:custom105" size="large" alternativeText="Indicates approval"/>
                    <div class="slds-media__body">
                        <p class="slds-text-title_caps slds-line-height_reset">Object</p>
                        <h1 class="slds-page-header__title slds-m-right_small slds-align-middle slds-truncate" title="My Contacts">My object</h1>
                         columns="{! v.columnsDesglose }"
                         data="{! v.desgloseCosteList }"
                         onsave ="{!c.onSave}"
                         onrowaction="{! c.handleRowAction }"
Controller, helper and CTR
    doInit : function(cmp, event, helper) {
        cmp.set('v.columnsDesglose', [
            {label: 'Name', fieldName: 'Name', type: 'text', sortable: true, editable:'true'},
            {label: 'Month 1', fieldName: 'Mes_1__c', type: 'double', sortable: true, editable:'true'},
            {label: 'Month 2', fieldName: 'Mes_2__c', type: 'double', sortable: true, editable:'true'},
            {label: 'Month 3', fieldName: 'Mes_3__c', type: 'double', sortable: true, editable:'true'},
            {label: 'Month 4', fieldName: 'Mes_4__c', type: 'double', sortable: true, editable:'true'},
            {label: 'Month 5', fieldName: 'Mes_5__c', type: 'double', sortable: true, editable:'true'},
            helper.loadDesglose(cmp, helper);
    updateColumnSorting : function (cmp, event, helper) {
            var fieldName = event.getParam('fieldName');
            var sortDirection = event.getParam('sortDirection');
            cmp.set("v.sortedBy", fieldName);
            cmp.set("v.sortedDirection", sortDirection);
            helper.sortData(cmp, fieldName, sortDirection);
    onSave : function (component, event, helper) {
            helper.saveDataTable(component, event, helper);

    loadDesglose : function(cmp, helper) {
        var action = cmp.get("c.getAllDesgloseCoste");
        action.setParams({opportunityId: cmp.get('v.recordId')});   
        action.setCallback(this, function(response) {
            var state = response.getState();
            if (state === "SUCCESS") {
                cmp.set("v.desgloseCosteList", response.getReturnValue());
                helper.sortData(cmp, cmp.get("v.sortedBy"), cmp.get("v.sortedDirection"));
    sortData: function (cmp, fieldName, sortDirection) {
        var data = cmp.get("v.desgloseCosteList");
        var reverse = sortDirection !== 'asc';
        data.sort(this.sortBy(fieldName, reverse))
        cmp.set("v.desgloseCosteList", data);
    sortBy: function (field, reverse, primer) {
        var key = primer ?
            function(x) {return primer(x[field])} :
        function(x) {return x[field]};
        reverse = !reverse ? 1 : -1;
        return function (a, b) {
            return a = key(a), b = key(b), reverse * ((a > b) - (b > a));
    saveDataTable : function(component, event, helper) {
        var editedRecords =  component.find("desgloseCosteDataTable").get("v.draftValues");
        var totalRecordEdited = editedRecords.length;
        var action = component.get("c.updateDesgloseCoste");
            'editedDesglCosteList' : editedRecords
        action.setCallback(this,function(response) {
            var state = response.getState();
            if (state === "SUCCESS") {
                //if update is successful
                if(response.getReturnValue() === true){
                        "title": "Record Update",
                        "type": "success",
                        "message": totalRecordEdited+" Registros actualizados"
                } else{ //if update got failed
                        "title": "Error!!",
                        "type": "error",
                        "message": "Error en la actualización"

     * Show toast with provided params
     * */
    showToast : function(params){
        var toastEvent = $A.get("e.force:showToast");
        } else{

     * reload data table
     * */
    reloadDataTable : function(){
    var refreshEvent = $A.get("e.force:refreshView");

    public static list<Desglose_Coste__c> getAllDesgloseCoste(Id opportunityId){
        return [SELECT Name, Mes_1__c, Mes_2__c, Mes_3__c, Mes_4__c, Mes_5__c, Mes_6__c, Mes_7__c, Mes_8__c, Mes_9__c, Mes_10__c, Mes_11__c, Mes_12__c,
                Opportunity__c, Opportunity__r.Name, LastModifiedById
                FROM Desglose_Coste__c
                WHERE Opportunity__c =:opportunityId];
    public static boolean updateDesgloseCoste(List<Desglose_Coste__c> editedDesglCosteList){
            system.debug('Total de registros: ' + editedDesglCosteList);
            update editedDesglCosteList;
            return true;
        } catch(Exception e){
            return false;

Best Answer chosen by Juan García
Juan GarcíaJuan García
I fixed, the problem was in the type of decimal numbers. The correct is: type: 'number'