+ 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.

Thanks,
Nagendra
 
Juan GarcíaJuan García 
Hi,

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

Thanks
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.

Thanks,
Nagendra
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') ) ) {
                System.debug('*******');
                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 
Hi,
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.

Thanks 
Ravish
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.

Apex:
public class SampleController {
    
    @AuraEnabled //Save Account Data
    Public static void createAccount(Account objacc){
        try{
            //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;
    }
}

Component:
<!--Sample.cmp-->
<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>
            <div class="form-group">
                <lightning:input name="accNumber" type="text" required="true" maxlength="10" label="Account Number" value="{!v.acc.AccountNumber}" />
            </div>
            <div class="form-group">
                <lightning:input name="accEmail" type="email" required="true" maxlength="100" label="Email" value="{!v.acc.Email}" />
            </div>
            <div class="form-group">
                <lightning:input name="accPhone" type="phone" required="true" maxlength="10" label="Phone" value="{!v.acc.Phone}" />
            </div>
            <div class="form-group">
                <!--Lightning radio group component-->
                <lightning:radioGroup name="radioGroup"
                                      label="Industry"
                                      required="true"
                                      options="{!v.industryMap}"
                                      value="{!v.acc.Industry}"
                                      type="radio"/>
            </div>
        </div>
        <br/>
        <lightning:button variant="brand" label="Submit" onclick="{!c.handleAccountSave}" />              
    </div>
    <!--Component End-->
</aura:component>

Controller:
({
    //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");
        alert(indutry);
    }
})

Helper:
({
    //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);
            }
        });
        $A.enqueueAction(action);
    },
    
    //handle Account Save
    saveAccount : function(component, event) {
        var acc = component.get("v.acc");
        var action = component.get("c.createAccount");
        action.setParams({
            objacc : acc
        });
        action.setCallback(this,function(response){
            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) {
                        alert(errors[0].message);
                    }
                }
            }else if (status === "INCOMPLETE") {
                alert('No response from server or client is offline.');
            }
        });       
        $A.enqueueAction(action);
    }
})

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 
Hi,

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

Example:
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

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

Thanks
Best Answer chosen by Juan García
Alain CabonAlain Cabon
Hi,

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

Component:

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

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

 
Best Answer chosen by Tony Williams 9
Alain CabonAlain Cabon
Hi,

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
https://github.com/JenniferSimonds/apex-xpath

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);
}

 
SandrineSandrine 
Hello,

  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}" 
    messageWhenValueMissing="{!v.message}"/>
    </aura:if>     
</aura:component>
 
compCreate:function(com,eve,helper){
   com.set('v.mesasge','Error from JS');
      com.set('v.truthy',true);
}

 
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)
Thanks

Component:
<aura:component controller="TCK_DesglCoste_ByOpp_Ctr"
                implements="force:hasRecordId,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,lightning:actionOverride,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:appHostable"
                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>
                    <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>
                    </div>
                </div>
            </div>
        </div>
    </div>
    
    <lightning:datatable
                         aura:id="desgloseCosteDataTable"
                         columns="{! v.columnsDesglose }"
                         data="{! v.desgloseCosteList }"
                         keyField="Id"
                         hideCheckboxColumn="true"
                         onsort="{!c.updateColumnSorting}"
                         sortedBy="{!v.sortedBy}"  
                         sortedDirection="{!v.sortedDirection}"
                         onsave ="{!c.onSave}"
                         onrowaction="{! c.handleRowAction }"
                         />
    
</aura:component>
Controller, helper and CTR
Controler:
({
    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);
            },
            
})

__________
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"));
            }
        });
        $A.enqueueAction(action);
    },
    
    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");
        action.setParams({
            'editedDesglCosteList' : editedRecords
        });
        action.setCallback(this,function(response) {
            var state = response.getState();
            if (state === "SUCCESS") {
                //if update is successful
                if(response.getReturnValue() === true){
                    helper.showToast({
                        "title": "Record Update",
                        "type": "success",
                        "message": totalRecordEdited+" Registros actualizados"
                    });
                    helper.reloadDataTable();
                } else{ //if update got failed
                    helper.showToast({
                        "title": "Error!!",
                        "type": "error",
                        "message": "Error en la actualización"
                    });
                }
            }
        });
        $A.enqueueAction(action);
    },

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

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


__________
CTR:
    @AuraEnabled
    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];
    }
    
    @AuraEnabled
    public static boolean updateDesgloseCoste(List<Desglose_Coste__c> editedDesglCosteList){
        try{
            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'