+ 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
Andrew EversleyAndrew Eversley 
Hello Community,

I'm having an issue with this particular challenge below: 

Write an Apex trigger that fires before records are inserted and ensures that the ShippingState field has the same value as the BillingState field.
Create an Apex class named AccountTriggerHandler that contains a public static method called CreateAccounts to accept the List of Account objects.
For each Account record, before saving, ensure that the ShippingState field has the same value as the BillingState field.
Write an Apex trigger named AccountTrigger that fires before records are inserted.
The Apex trigger must call the AccountTriggerHandler.CreateAccounts() method with the collection of new records.
Create a test class named AccountTriggerTest that inserts 200 Account records with a BillingState of CA. After the insert, test to ensure that all 200 records have a ShippingState of CA.
Before verifying this challenge, run your test class at least once using the Developer Console Run All feature.

This is my Challenge Error:

Challenge Not yet complete... here's what's wrong: 
The Trigger 'AccountTrigger' does not appear to be calling the AccountTriggerHandler class correctly or using isBefore or isInsert content variables.

These are my codings below :
AccountTriggerHandler
User-added image

AccountTrigger - Trigger On Account Object
User-added image

AccountTriggerTest
User-added image

P.S. I'm pretty new to the developing with Apex so I'm learning and growing so the help is appreciated community. 
Best Answer chosen by Andrew Eversley
Amit Chaudhary 8Amit Chaudhary 8
Hi Andrew ,
Please check below post for Test class level change also.
1) https://developer.salesforce.com/forums/ForumsMain?id=906F0000000DBLFIA4

1) AccountTrigger  Trigger
trigger AccountTrigger on Account (before insert) 
{
    if (Trigger.isBefore && Trigger.isInsert) 
   {
 	AccountTriggerHandler.CreateAccounts(Trigger.new);
   }	
}
2) AccountTriggerHandler Apex class.
public class AccountTriggerHandler 
{
    public static void CreateAccounts(List<Account> acclist)
    {
        for(Account a:acclist)
        {
            if(a.ShippingState!=a.BillingState)
            {
                a.ShippingState = a.BillingState; // you need to update ShippingState
            }
        }
    }
}
3) AccountTriggerTest Test class.
@isTest
public class AccountTriggerTest {
    
    @isTest static void TestCreate200Records()
    {
        List<Account> accts = new List<Account>();
        for(Integer i=0; i < 200; i++) 
        {
            Account acct = new Account(Name='Test Account ' + i, BillingState = 'CA');
            accts.add(acct);
        }
        
        Test.startTest();
            insert accts ;
        Test.stopTest();
        // Please query all record once again to check assert
        List<Account> lstAccount = [select ShippingState from Account];
        for (Account a: lstAccount )
        {
            System.assertEquals('CA', a.ShippingState, 'ERROR');
        }
        
    }
}

Please let me know if this will help you

Thanks
Amit Chaudhary

 
Cody Drennon 6Cody Drennon 6 
Hello,

So i am trying to implement the "Infinite Scrolling to Load More Rows" in a datatable.  I am trying to implement the example found at https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/aura_compref_lightning_datatable.htm.  However there is a helper method called in the JS Controller called "fetchData" that is not there and i cant for the life of me make it myself.  I have tried everything.  Any help would be greatly appreciated.

Please see code below.

Component:
<aura:component controller="ContactController" implements="force:appHostable,flexipage:availableForAllPageTypes" access="global">
    <aura:attribute name="mydata" type="Object" />
    <aura:attribute name="mycolumns" type="List"/>
    <aura:attribute name="isLoading" type="Boolean" default="true"/>
    <aura:attribute name="contactId" type="Id" />
    <aura:attribute name="sortedBy" type="String" />
    <aura:attribute name="sortedDirection" type="String" /> 
    <aura:attribute name="enableInfiniteLoading" type="Boolean" default="true"/>
    <aura:attribute name="initialRows" type="Integer" default="10"/>
    <aura:attribute name="rowsToLoad" type="Integer" default="50"/>
    <aura:attribute name="totalNumberOfRows" type="Integer" default="300"/>
    <aura:attribute name="loadMoreStatus" type="String" default=""/>
    <aura:handler name="init" value="{! this }" action="{! c.init }"/>
    <div style="height: 500px">
        <lightning:datatable data="{! v.mydata}" 
                             columns="{! v.mycolumns }" 
                             keyField="id"
                             onsort="{!c.updateColumnSorting}"
                             sortedBy="{!v.sortedBy}"
                             sortedDirection="{!v.sortedDirection}"
                             enableInfiniteLoading="true"
                             onloadmore="{! c.loadMoreData }"/>
        
    </div>
    {! v.loadMoreStatus}
</aura:component>

JS Controller:

({
    init: function (cmp, event, helper) {

        var actions = [
            { label: 'Show details', name: 'show_details' },
            { label: 'Delete', name: 'delete' }
        ];
        cmp.set('v.mycolumns', [
            // Other column data here
            { type: 'action', typeAttributes: { rowActions: actions } }
        ]);
        cmp.set('v.mycolumns', [
            {label: 'Contact Name', fieldName: 'Name', type: 'string', sortable: 'true'},
            {label: 'Phone', fieldName: 'Phone', type: 'phone', sortable: 'true'},
            {label: 'Email', fieldName: 'Email', type: 'email', sortable: 'true'}
        ]);
        helper.getData(cmp);
    },
    
    getSelectedName: function (cmp, event) {
        var selectedRows = event.getParam('selectedRows');
        // Display that fieldName of the selected rows
        for (var i = 0; i < selectedRows.length; i++){
            alert("You selected: " + selectedRows[i].Name);
        }
    },
    
    handleRowAction: function (cmp, event, helper) {
        var action = event.getParam('action');
        var row = event.getParam('row');
        switch (action.name) {
            case 'show_details':
                alert('Showing Details: ' + JSON.stringify(row));
                cmp.set('v.contactId', row.Id);
                alert(cmp.get('v.contactId'));
                $A.util.removeClass(cmp.find("childDiv"),'toggle');
                $A.util.addClass(cmp.find("listDiv"),'toggle');
                var attribute1 = cmp.get('v.contactId');
                var childComponent = cmp.find('child');
                childComponent.reInit(attribute1);
                break;
            case 'delete':
                var rows = cmp.get('v.mydata');
                var rowIndex = rows.indexOf(row);
                rows.splice(rowIndex, 1);
                cmp.set('v.mydata', rows);
                break;
        }
    },
    
    //Client-side controller called by the onsort event handler
    updateColumnSorting: function (cmp, event, helper) {
        var fieldName = event.getParam('fieldName');
        var sortDirection = event.getParam('sortDirection');
        // assign the latest attribute with the sorted column fieldName and sorted direction
        cmp.set("v.sortedBy", fieldName);
        cmp.set("v.sortedDirection", sortDirection);
        helper.sortData(cmp, fieldName, sortDirection);     
        
        
    },
    
    loadMoreData: function (cmp, event, helper) {
        //Display a spinner to signal that data is being loaded
        event.getSource().set("v.isLoading", true);
        //Display "Loading" when more data is being loaded
        cmp.set('v.loadMoreStatus', 'Loading');
        helper.fetchData(cmp, cmp.get('v.rowsToLoad'))
            .then($A.getCallback(function (data) {
                if (cmp.get('v.mydata').length >= cmp.get('v.totalNumberOfRows')) {
                    cmp.set('v.enableInfiniteLoading', false);
                    cmp.set('v.loadMoreStatus', 'No more data to load');
                } else {
                    var currentData = cmp.get('v.mydata');
                    //Appends new data to the end of the table
                    var newData = currentData.concat(data);
                    cmp.set('v.mydata', newData);
                    cmp.set('v.loadMoreStatus', '');
                }
               event.getSource().set("v.isLoading", false);
            }));
    }
    
})

HELPER

This is where i need the help to come up with a helper method that is referenced in the JS controller.  THANK YOU!

 
Best Answer chosen by Cody Drennon 6
Raj VakatiRaj Vakati
Here is the code you can refer ... You have complete Datatable features are in this examples including infinity scrolling 
 
public class BookController {
    @AuraEnabled
    public static List<Book_Categories__c> getBooksByAllCategories(){
        
        List<Book_Categories__c> categeroy = [Select  Name,(Select Name, Author_Name__c, Book_Categories__c,Publisher_Id__c from Books__r) from Book_Categories__c];
        return categeroy;
    } 
    
    @AuraEnabled
    public static List<Book_Categories__c> getBooksCategories(){
        List<Book_Categories__c> categeroy = [Select  Name,Id from Book_Categories__c];
        return categeroy;
    }
    @AuraEnabled
    public static List<Books__c> getBooks(Integer limits , Integer offsets){
        System.debug('limits'+limits);
        System.debug('offsets'+offsets);
        Integer intlimits = integer.valueof(limits);
        Integer intoffsets = integer.valueof(offsets);
        
        List<Books__c> books = [Select Name,Is_Available__c,CreatedDate,publish_status__c,
                                URL__c ,Author_Name__c, Book_Categories__c,Publisher_Id__c from Books__c Order by Name Limit :intlimits Offset :intoffsets];
        return books;
    } 
    
    @AuraEnabled
    public static void setBookStatus(String status , List<Books__c> books){
        System.debug('--'+status);
        System.debug('--books --'+books);
        for(Books__c b :books){
            b.publish_status__c = status ;
        }
        
        update books;
    } 
    
    @AuraEnabled
    public static Integer getTotalCount(){
        AggregateResult results = [select  count(Id) total  from Books__c ];
        Integer total =(Integer)results.get('total') ; 
        return total;
    } 
    @AuraEnabled
    public static void deleteBooks(String ids ){
        Delete [Select id from Books__c where  id=:ids];
    } 
    
    
}
 
<aura:component controller="BookController" implements="force:appHostable">
    <!-- attributes -->
    <aura:attribute name="data" type="Object"/>
    <aura:attribute name="columns" type="List"/>
    <aura:attribute name="selectedRowsCount" type="Integer" default="0"/>
    <aura:attribute name="selectedRowsDetails" type="Object" />
    <aura:attribute name="selectedRowsList" type="List" />
    
    <aura:attribute name="maxRowSelection" type="Integer" default="5"/>
    <aura:attribute name="selectedRows" type="List" />
    
    <!--- enableInfiniteLoading  -->
    <aura:attribute name="enableInfiniteLoading" type="Boolean" default="true"/>
    <aura:attribute name="initialRows" type="Integer" default="30"/>
    <aura:attribute name="rowsToLoad" type="Integer" default="10"/>
    <aura:attribute name="totalNumberOfRows" type="Integer" default="10"/>
    <aura:attribute name="loadMoreStatus" type="String" default="Loading .... "/>
    <aura:attribute name="showRowNumberColumn" type="Boolean" default="false"/>
    <aura:attribute name="rowNumberOffset" type="Integer" default="0"/>
    <aura:attribute name="rowsToAdd" type="Integer" default="10"/>
    <aura:attribute name="currentCount" type="Integer" default="10"/>
    
    <aura:attribute name="activeFilter" type="string" default="All" description="The currently selected actions filter"/>
    
    <aura:attribute name="sortedBy" type="String"/>
    <aura:attribute name="sortedDirection" type="String"/>
    <aura:attribute name="defaultSortDirection" type="String"/>
    
    <!-- handlers-->
    <aura:handler name="init" value="{! this }" action="{! c.doInit }"/>
    <div class="my-custom-background">
        <lightning:button label="Complete"  variant="brand" onclick="{!c.handleSelect}"/>
        <lightning:button label="In Completed"  variant="brand" onclick="{!c.handleSelect}"/>
        <lightning:button label="Pre Order"  variant="brand" onclick="{!c.handleSelect}"/>
        
    </div>
    <!-- the container element determine the height of the datatable -->
    <div style="height: 600px">
        <h1> Total Rowns : {! v.totalNumberOfRows}</h1>
        <h1>Selected Rows: {! v.selectedRowsCount }</h1>
        <h1>Selected Objects: {! v.selectedRowsDetails }</h1>
        <h1>Current Offset : {! v.currentCount }</h1>
        
        
        <lightning:datatable columns="{! v.columns }"
                             data="{! v.data }"
                             keyField="id"
                             showRowNumberColumn="true"
                             rowNumberOffset="0"
                             onrowaction="{! c.handleRowAction }"
                             selectedRows="{! v.selectedRows }"
                             maxRowSelection="{! v.maxRowSelection }"
                             onrowselection="{! c.updateSelectedText }"
                             enableInfiniteLoading="true"
                             loadMoreOffset="{! v.loadMoreOffset }"
                             onheaderaction="{! c.handleHeaderAction }"
                             sortedBy="{! v.sortedBy }"
                             sortedDirection="{! v.sortedDirection }"
                             defaultSortDirection="{! v.defaultSortDirection }"
                             onsort="{! c.updateColumnSorting }"
                             onloadmore="{! c.loadMoreData }"/>
    </div>
    {! v.loadMoreStatus }
    
</aura:component>
 
({
    doInit : function(component, event, helper) {
        
        var totalCnt = component.get("c.getTotalCount");
        totalCnt.setCallback(this, function(a) {
            component.set("v.totalNumberOfRows", a.getReturnValue());
        });
        $A.enqueueAction(totalCnt);
        
        
        var actions = [
            { label: 'Show details', name: 'show_details' },
            { label: 'Delete', name: 'delete' }
        ];
        var headerActions = [
            {
                label: 'All',
                checked: true,
                name:'All'
            },
            {
                label: 'Completed',
                checked: false,
                name:'Completed'
            },
            {
                label: 'In Completed',
                checked: false,
                name:'In Completed'
            },
            {
                label: 'Pre Order',
                checked: false,
                name:'Pre Order'
            }
        ];
        
        component.set('v.columns', [
            {label: 'Name', fieldName: 'Name', type: 'text',sortable:true ,actions: headerActions},
            {label: 'URL', fieldName: 'URL__c', type: 'url',sortable:true,actions: headerActions},
            {label: 'Author Name', fieldName: 'Author_Name__c', type: 'text',sortable:true},
            {label: 'publish status', fieldName: 'publish_status__c', type: 'text',sortable:true},
            {label: 'Publisher Id', fieldName: 'Publisher_Id__c', type: 'text',sortable:true,actions: headerActions},
            { type: 'action', typeAttributes: { rowActions: actions } } 
        ]);
        helper.getData(component);
    },
    updateSelectedText : function(component, event, helper){
        var selectedRows = event.getParam('selectedRows');
        //  console.log('selectedRows'+selectedRows);
        component.set("v.selectedRowsCount" ,selectedRows.length );
        let obj =[] ; 
        for (var i = 0; i < selectedRows.length; i++){
            
            obj.push({Name:selectedRows[i].Name});
            
        }
        
        
        component.set("v.selectedRowsDetails" ,JSON.stringify(obj) );
        component.set("v.selectedRowsList" ,event.getParam('selectedRows') );
        
    },
    handleSelect: function (component, event, helper) {
        var arr = component.get('v.data');
        var obj =  component.get("v.selectedRowsList");
        console.log('obj '+JSON.stringify(obj) );
        var selectedButtonLabel = event.getSource().get("v.label");
        console.log('Button label: ' + selectedButtonLabel);
        var updateAction = component.get("c.setBookStatus");
        updateAction.setParams({ status : selectedButtonLabel , books: obj});
        updateAction.setCallback(this, function(a) {
            $A.get('e.force:refreshView').fire();
        });
        $A.enqueueAction(updateAction);
        
        
        
    },
    loadMoreData: function (component, event, helper) {
        //Display a spinner to signal that data is being loaded
        event.getSource().set("v.isLoading", true);
        //Display "Loading" when more data is being loaded
        component.set('v.loadMoreStatus', 'Loading');
        helper.fetchData(component, component.get('v.rowsToLoad')).then($A.getCallback(function (data) {
            if (component.get('v.data').length >= component.get('v.totalNumberOfRows')) {
                component.set('v.enableInfiniteLoading', false);
                component.set('v.loadMoreStatus', 'No more data to load');
            } else {
                var currentData = component.get('v.data');
                //Appends new data to the end of the table
                var newData = currentData.concat(data);
                component.set('v.data', newData);
                component.set('v.loadMoreStatus', 'Please wait ');
            }
            event.getSource().set("v.isLoading", false);
        }));
    },
    
    
    handleRowAction: function (cmp, event, helper) {
        var action = event.getParam('action');
        var row = event.getParam('row');
        switch (action.name) {
            case 'show_details':
                var navEvt = $A.get("e.force:navigateToSObject");
                navEvt.setParams({
                    "recordId": row.Id,
                    "slideDevName": "detail"
                });
                navEvt.fire();
                break;
            case 'delete':
                var rows = cmp.get('v.data');
                var rowIndex = rows.indexOf(row);
                console.log('rowIndex'+rowIndex);
                console.log('rowIndex row'+rows[rowIndex].Id);
                var deleteAct = cmp.get("c.deleteBooks");
                deleteAct.setParams({ ids : rows[rowIndex].Id });
                $A.enqueueAction(deleteAct);
                var toastEvent = $A.get("e.force:showToast");
                toastEvent.setParams({
                    "title": "Success!",
                    "message": "The record has been delete successfully."
                });
                toastEvent.fire();
                rows.splice(rowIndex, 1);
                cmp.set('v.data', rows);
                break;
        }
    },
    handleHeaderAction: function (cmp, event, helper) {
        
        // helper.getData(cmp);
        
        
        var actionName = event.getParam('action').name;
        var colDef = event.getParam('columnDefinition');
        var columns = cmp.get('v.columns');
        var activeFilter = cmp.get('v.activeFilter');
        console.log('activeFilter-->'+activeFilter);
        if (actionName !== activeFilter) {
            var idx = columns.indexOf(colDef);
            var actions = columns[idx].actions;
            console.log('actions'+actions)
            actions.forEach(function (action) {
                action.checked = action.name === actionName;
            });
            cmp.set('v.activeFilter', actionName);
            helper.updateBooks(cmp);
            cmp.set('v.columns', columns);
        }
    },
    
    // Client-side controller called by the onsort event handler
    updateColumnSorting: function (cmp, event, helper) {
        var fieldName = event.getParam('fieldName');
        var sortDirection = event.getParam('sortDirection');
        // assign the latest attribute with the sorted column fieldName and sorted direction
        cmp.set("v.sortedBy", fieldName);
        cmp.set("v.sortedDirection", sortDirection);
        helper.sortData(cmp, fieldName, sortDirection);
    },
    
    
    
    
    
})
 
({
    getData : function(component) {
        
        var action = component.get("c.getBooks");
        action.setParams({
            "limits": component.get("v.initialRows"),
            "offsets": component.get("v.rowNumberOffset")
        });
        action.setCallback(this, function(a) {
            component.set("v.data", a.getReturnValue());
            component.set("v.currentCount", component.get("v.initialRows"));
            
        });
        $A.enqueueAction(action);
    },
    sortData: function (cmp, fieldName, sortDirection) {
        var data = cmp.get("v.data");
        var reverse = sortDirection !== 'asc';
        //sorts the rows based on the column header that's clicked
        data.sort(this.sortBy(fieldName, reverse))
        cmp.set("v.data", data);
    },
    sortBy: function (field, reverse, primer) {
        var key = primer ?
            function(x) {return primer(x[field])} :
        function(x) {return x[field]};
        //checks if the two rows should switch places
        reverse = !reverse ? 1 : -1;
        return function (a, b) {
            return a = key(a), b = key(b), reverse * ((a > b) - (b > a));
        }
    },
    fetchData: function(component , rows){
        return new Promise($A.getCallback(function(resolve, reject) {
            var currentDatatemp = component.get('c.getBooks');
            var counts = component.get("v.currentCount");
            currentDatatemp.setParams({
                "limits": component.get("v.initialRows"),
                "offsets": counts 
            });
            currentDatatemp.setCallback(this, function(a) {
                resolve(a.getReturnValue());
                var countstemps = component.get("v.currentCount");
                countstemps = countstemps+component.get("v.initialRows");
                component.set("v.currentCount",countstemps);
                
            });
            $A.enqueueAction(currentDatatemp);
            
            
        }));
        
    } ,
    updateBooks: function (cmp) {
        var rows = cmp.get('v.data');
        var activeFilter = cmp.get('v.activeFilter');
        console.log('activeFilter Helper'+activeFilter)
        var filteredRows = rows;
        if (activeFilter == 'All') {
            return  rows; 
        }
        if (activeFilter !== 'All') {
            filteredRows = rows.filter(function (row) {
                console.log('Each Row'+row.publish_status__c);
                if(row.publish_status__c == activeFilter){
                    return  row; 
                }
                // return (activeFilter === 'In_Completed') ||(activeFilter === 'Pre_Order');
            });
        }
        cmp.set('v.data', filteredRows);
    },
    
})

 
Brett MahoneyBrett Mahoney 
Hello everyone, 

I am looking for the best solution available for Apple Mail email to Outlook Windows migration. As there is no direct way available for such migration situation, I am looking for the best application that can migrate my apple mail emails to outlook client in Windows system. Kindly provide the best option. Thanks
Best Answer chosen by Brett Mahoney
George KempGeorge Kemp
You don't say what version of Outlook. This may work:

How to convert Apple Mail Database to PST File (Outlook Windows)
Directly Import MBOX to Outlook for Windows profile by using Apple Mail to Pst Conveterallowstware allow users to bulk import MBOX files to Outlook for Windows by retaining total email attributes intact.

http://applemailtopst.com/how-to-convert-apple-mail-database-to-pst-file-outlook-windows/

I think the software shown only migrates 10 e-mails for each folder. To do the rest you need to pay.
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':
                 

 
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
Praneeth Jonna 2Praneeth Jonna 2 
I have installed salesforce cli windows 64 bit and I also installed it through npm globally. 
I am on windows 7 machine and behind a company firewall and I have proxy set on my computer

C:\Users\XXXXX>sfdx update
panic: Get https://developer.salesforce.com/media/salesforce-cli/sfdx-cli/channe
ls/stable/windows-x64: dial tcp XX.XX.XX.XX:443: connectex: A connection att
empt failed because the connected party did not properly respond after a period
of time, or established connection failed because connected host has failed to r
espond.

goroutine 1 [running]:
panic(0x6632a0, 0xc0420067b0)
        /usr/local/go/src/runtime/panic.go:500 +0x1af
main.must(0x7b92c0, 0xc0420067b0)
        /home/ubuntu/.go_workspace/src/github.com/heroku/cli/io.go:115 +0x63
main.GetUpdateManifest(0x6a4875, 0x7, 0x6a3c0d, 0x3, 0x7b92c0)
        /home/ubuntu/.go_workspace/src/github.com/heroku/cli/install.go:104 +0x2
72
main.GetUpdateManifest(0x6a4875, 0x7, 0x6a3c0d, 0x3, 0x0)
        /home/ubuntu/.go_workspace/src/github.com/heroku/cli/install.go:102 +0x2
f4
main.Install()
        /home/ubuntu/.go_workspace/src/github.com/heroku/cli/install.go:33 +0x10
0
main.main()
        /home/ubuntu/.go_workspace/src/github.com/heroku/cli/main.go:18 +0x3a

 
Best Answer chosen by Praneeth Jonna 2
Praneeth Jonna 2Praneeth Jonna 2
Set http_proxy and https_proxy on windows computer. Proxy value is specfic to the company. 
This article explains how to set the proxy.
https://docs.cloudfoundry.org/cf-cli/http-proxy.html



 
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.