Quantcast
Channel: Active questions tagged lightning-experience - Salesforce Stack Exchange
Viewing all 3003 articles
Browse latest View live

Lightning Service Console - need a mini detail component?

$
0
0

In classic service console, we have our page layouts that drive the record details. On the left side of the page, there is a small "component" that uses the OOTB mini page layout stuff and custom console components from the page layout screen in settings for that object. For example, on Case, on the left side is a small area that has the most common fields the users will use and edit. It also shows fields for other linked objects as well. We can also go to the details tab to see all fields.

We are converting to lightning service console now and I cant seem to find a way to get this to show up. The closest thing I have found is compact layouts that just show up when hovering over a lookup field but these are not editable fields. So without doing this completely custom (web components), is there a way to select a subset of object fields and display them in a different area of the page in lightning service console.


Nested Checkbox in Lightning Component

$
0
0

I need to build nested checkbox in lightning component, like the below image.

enter image description here

I tried to achieve this using ul and li tag but its not appearing like the image:

<lightning:layoutItem size="2">
            <ul>
                <li>
            <lightning:input type="checkbox" name="dentures" label="Dentures:"/>
                </li>
                <ul>
                    <li>
                        <lightning:input type="checkbox" name="upper" label="Upper"/>
                        <lightning:input type="checkbox" name="lower" label="Lower"/>
                        <lightning:input type="checkbox" name="partial" label="Partial"/>
                    </li>
                </ul>
            </ul>
</lightning:layoutItem>

How to add multi line input field with Underline

$
0
0

I need to add multi-line input field in my lightning component like the below example: enter image description here

I'm not sure how to add this multi-line input field, below is the code which I tried:

<table class="slds-table slds-table_cell-buffer slds-table_bordered slds-table_col-bordered">

                <th>
                    <lightning:layoutItem size="4">

                        <lightning:input type="checkbox" name="otherSpecify" label="Other (specify):"/>   
                    </lightning:layoutItem>
                </th>
                <th>
                    <lightning:layoutItem size="4">
                        <lightning:input type="checkbox" name="specialInstructions" label="Special Instructions:"/>   
                    </lightning:layoutItem>
                </th>
            </table>

I couldn't find proper tag to add this kind of style

Record Level Translation in sfdc

$
0
0

I came across a requirement in which users should be able to input the record data in salesforce using thier native language and should be able to view in thier native language. I know this is not possible from salesforce OOTB translation.

Is there any third party tool? any app exchange applications or any workaround for this?

The challange here seems to be the insertion and updation of records. I mean if a spanish user provides inputs in spanish, then how do we save those data, how the validations will work? how those data would be retrived by any other user in thier native language.

Can anyone suggest me something related to this??

Thank You

How to pass record id From VF page to Lightning component?

$
0
0

VF Page:

<apex:page standardController="Opportunity" extensions="P2EcRequestType" lightningStylesheets="true" standardStylesheets="false">
<apex:slds />
<apex:includeLightning />
<div id="lightning" />
<script>
function callApex(){
    callApexMethod();    
}
function lightning(){
    $Lightning.use("c:liu_NewRFIOnOpportunityApp", function() {
        $Lightning.createComponent("c:liu_NewRFIOnOpportunity",
                                   { recordId : '{!Opportunity.id}' },
                                   "lightning",
                                   function(cmp) {
                                   });
    });
}
</script>

<apex:sectionHeader title="Case" subtitle="RFI Type"/>

<style>
 body .bEditBlock .pbBottomButtons>table { padding-left : 227px; }
.bPageBlock.bEditBlock .pbBody .data2Col { padding-left : 650px;}
 .apexp .bPageBlock .pbBottomButtons .btn { margin-right : 40px; } 
</style> 
<apex:form id="form">
    <apex:actionFunction name='callApexMethod' action="{!Submit}" oncomplete="lightning();" />
    <apex:pageMessages ></apex:pageMessages> 
    <apex:pageBlock Title="Choose RFI Type and SubType" tabstyle="CostShare__c"> 
        <apex:pageBlockSection id="RFITypeSec">
            <apex:inputField value="{!RFICase.RFI_Type__c}"/>
            <apex:inputField value="{!RFICase.RFI_SubType__c}"/>
        </apex:pageBlockSection>    

        <apex:pageBlockButtons location="bottom" html-align="center">
            <apex:commandButton styleClass="slds-button slds-button_neutral" value="Submit" onclick="lightning(); return false;" rerender="form"/>   
            <apex:commandButton styleClass="slds-button slds-button_neutral" value="Cancel" action="{!cancel}"/>
            </apex:pageBlockButtons>        
    </apex:pageBlock>
</apex:form>

Component:

<aura:component controller="P2EcNewRFIonOpportunity" implements="lightning:actionOverride,force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickActionWithoutHeader,force:hasSObjectName" access="global">

<aura:attribute name="recordId" type="Id" />
<aura:attribute name="access" type="string" />
<aura:attribute name="anlasis" type="string" />
<aura:attribute name="review" type="string" />
<aura:attribute name="Actual" type="string" />

<aura:attribute name="NewRFI" type="Case" default="{'sobjectType':'Case'}"/>
<aura:handler name="init" action="{!c.doInit}" value="{!this}"/>

controller:

({
doInit : function(component,event,helper){
    var recordId = component.get("v.recordId");        
    var action = component.get("c.newrfiopportunity"); 
    console.log('recordid####:'+recordId);
    action.setParams({
        "recordId":recordId
    });
    console.log('recordid1####:'+recordId);
    action.setCallback(this, function(response) {
        if (response.getState() ===  "SUCCESS") {  
            if(response.getReturnValue() != null ) {
                 var storeResponse = response.getReturnValue();
                helper.recordCreation(component,storeResponse);
            component.set("v.NewRFI", storeResponse);                 
            }     
        }
    });
    $A.enqueueAction(action);
}
})

Helper:

({
recordCreation : function(component,cse) {

    var windowHash = window.location.hash;
    var evt = $A.get("e.force:createRecord");
    console.log('evt%%%%'+evt);
    evt.setParams({
        'entityApiName':'Case',
        'defaultFieldValues': {
            'AccountId':cse.AccountId,
            'Related_Opportunity__c':cse.Related_Opportunity__c
        },
    });
    evt.fire();

  }
})

Apex controller of Component:

public class P2EcNewRFIonOpportunity {

 @AuraEnabled
public static Case newrfiopportunity(Id recordId){

    Opportunity Opprty = new Opportunity();     
    List<RecordType> lstRecType = new List<RecordType>();
    Map<String,Id> mapRecType = new Map<String,Id>();
    Case cse = new Case();


    String sObjectparentId = '';
    String CaseRecType = '';
    sObjectparentId = recordId;

    lstRecType = [SELECT Id,DeveloperName FROM RecordType WHERE sobjecttype = 'Case'];
    if(!lstRecType.isEmpty()){
        for(RecordType rec: lstRecType){
            mapRecType.put(rec.DeveloperName,rec.Id);   
        }
    }
    if(!String.isBlank(sObjectparentId)){
            Opprty = [select id, AccountId from opportunity where id=:sObjectparentId];
        }
       CaseRecType = 'RFI_Geo'; 
       cse.Related_Opportunity__c= Opprty.id;
       cse.AccountId = Opprty.AccountId;
       cse.RecordTypeId =mapRecType.get(CaseRecType); 

    return cse;
}

@AuraEnabled
public static Case saveCase(Case css){
    upsert css;
    return css;
    }

  }

In VF Page I am calling above lighting component when I click on the Submit Button. I have an input field(Picklist -accessanalysisreviewactual) on the same page.

the input field is RFICase.RFI_Type__c

Now I need to pass the Opportunity id to the lightning component and Picklist values also. Based on picklist values I need to populate the standard record creation page of the object with different record types from the lighting component.

I am not able to pass parameters at { recordId : '{!Opportunity.id}' }, in function lightning(){

Can anyone please help me how to pass values from VF Page to lightning component?

Error:

This page has an error. You might just need to refresh it. Error in 
$A.getCallback() [Cannot read property 'setParams' of undefined] 
Callback failed: apex://P2EcNewRFIonOpportunity/ACTION$newrfiopportunity 
Failing descriptor: {c:liu_NewRFIOnOpportunity}

enter image description here

can i set a placeholder on a page layout fields

$
0
0

I am wondering if I can set a place holder in a page layout field for example I added a custom phone field and I am wondering if I can add a place holder say +1(xxx)xxxx-xxxx tried making a formula field but the results are not satisfacotry.

Lightning Components: is there a way to render a Flexipage inside an other Lightning Component yet? Or roadmap? Or never?

$
0
0

As the title says, I want to use an entire Flexipage as a component itself (I bet that behind the scenes a Flexipage actually is one) inside an other Lightning Component as a subcomponent.

  • Is that possible yet?
  • Might it be possible in the future?
  • Or better prepare that it won't come anytime soon or at all?

Futurelooking plus safeharbor hints are very welcome, too.

Partner community dashboard visiblity error [closed]

$
0
0

Why is partner community member's assistant unable to view their dashboard?


Web tabs to display external Web Application

$
0
0

I created a web tab to display an external web application. This is what happens in Classic and Lightning:

Classic - The web tab loads the web application and I can even login into the application. CSS, and other resources gets loaded automatically. No issues here.

Lightning - The application doesn't load and I get the following error:
File not found The resource that you have requested was not found. Please check the link and try again.

I decided to whitelist CORS with the web application URL but the result is the same.

Have you come across this and if so, how to load the external application inside Lightning experience using Web Tabs?

Not able to access event.currentTarget when locker service is enabled

$
0
0

There's a question already asked regarding this here Issue with event.currentTarget

According to Salesforce Known Issues , they've updated that it has already been fixed in almost all the servers (except eight as of now). But, for me it's still not working (it has already been shown as fixed in the instance I'm working on).

My code is as follows:-

Component:-

<div class="slds-form-element__icon" onclick ="{!c.displayPopup}">

Controller:-

displayPopup : function(component) {
        component.set("v.isDisplayPopup", true);
    }

Renderer:-

({
    rerender: function(component, helper) {
        this.superRerender();   
        helper.renderPopup(component, helper);
    }   
})

Helper:-

renderPopup : function(component, helper) {
        if(component.isValid() && component.get("v.isDisplayPopup")) {          
            var selectedItem = event.currentTarget;
            var svgElement = selectedItem.querySelector("svg");
            var scrollableWrapElement = document.getElementsByClassName('scrollableWrap')[0];                                   
            var position = this.getPosition(svgElement);
            var wrapperPosition = this.getPosition(scrollableWrapElement);
            var notesPanelComponent = component.find('notesPanel').getElement();
            var noteObject = notesPanelComponent.querySelectorAll("div")[selectedItem.dataset.rownumber];            
            for(var i=0; i<document.querySelectorAll(".notes").length-1; i = i + 1){

                document.querySelectorAll(".notes:not(#\\3"+noteObject.id+")")[i].classList.remove('slds-visible');    

                document.querySelectorAll(".notes:not(#\\3"+noteObject.id+")")[i].classList.add('slds-hidden');         
            }
            noteObject.classList.toggle('slds-visible');
            noteObject.style.top = position.top - wrapperPosition.top + 35+"px";
            noteObject.style.left = position.left - wrapperPosition.left -127+"px";
            component.set("v.isDisplayNotes", false);
        }
}

When I click on that particular, it throws an error saying [TypeError: Cannot read property 'currentTarget' of undefined]

The event is undefined!

Can anyone tell me why am I not able to access the same here?

Is there any way so that I would be able to access the clicked DOM element from helper?

PS:- I'm trying to access the event.currentTarget from the helper via renderer (and not directly from controller) is because DOM manipulation is involved(which cannot be done outside the rendering lifecycle as per the Lightning Developer Guide), once I get the DOM element.

Updated Values after VF PageReference redirect back to Lightning record page not appearing

$
0
0

I am attempting to emulate a Confirm process that was once handled well by a Javascript button. The idea is to ask for a Confirmation when attempting to deactivate a record.

To do this, I am creating a simple VF page using an controller extension. The PageMessages receive an INFO level confirmation message, and the button will call a method to deactivate and save the record, then redirect back to it:

From the record detail in Lightning Experience, I have a quick action button that references a VF page.

Ultimately the process is working, but when the page redirects back to the original record, the Active switch is still appears as checked, even though one or two hard refreshes show that its actually deactivated in the database. Here is the code

<apex:page standardController="Activity__c" extensions="Deactivate">
<apex:pageMessages />
<apex:form >
    <apex:pageBlock>
        <apex:pageBlockButtons location="top">
            <apex:commandButton action="{!DeActivate}" value="DeActivate Activity" rendered="{!Active = true}"/>
            <apex:commandButton action="{!Cancel}" value="Cancel" />
        </apex:pageBlockButtons>
    </apex:pageBlock>
</apex:form>

public with sharing class DeactivateController{
Public Activity__c pActivity {get; set;}
Public Boolean Active {get; set;}

public Deactivate(ApexPages.StandardController ctr){
    this.pActivity = (Activity__c) ctr.getRecord();
    this.pActivity = [Select id, Active__c from Activity__c Where Id = :this.pActivity.Id];
    Active = this.pActivity.Active__c;
    confirm();
}

private void confirm(){
    if (Active){
        ApexPages.addMessage(new ApexPages.message(ApexPages.severity.INFO,'Confirm Deactivate?'));
    }
}

public pageReference DeActivate(){
    pActivity.Active__c = False;
    update pActivity;
    PageReference pageRef = new PageReference('/'+pActivity.Id);

    pageRef.setRedirect(true);
    return pageRef;

}
}

I've also tried new PageReference('/one/one.app#/sObject/'+pActivityId+'/view'); as well as the full URL with https In all cases, the Record page returns, but Active still appears checked, even though it isn't in the database. If I refresh the page a couple of times, it finally comes up correct.

Content Delivery in Lightning

$
0
0

We are in the process of migrating the our Salesforce instance from classic to lightning. Just realized that the Content delivery is not supported in lightning. Can anyone suggest me what the work around for achieving this in lightning. I also looked in to the Salesforce documentation

In Lightning Email generates delivery-based links as email attachments for Lightning Experience users who have access to the Content Deliveries feature.

I am not able to understand how Email generates delivery-based links as email attachments, can anyone point me to any links/details to understand this in lightning

issue with lightning lookup using lightning input field

$
0
0

Guys I have embedded a lightning component on a VF Page, so there is a lighting lookup field on my component, the lookup is perfectly working fine except onething. So usually when we start typing in a lookup field it does show a magnifying glass below.

For example here when I start typing it shows the account names. So I have an account name called "test". So If I have type until "te" it is showing a magnifying glass symbol below my lookup field but when I click on it it is not showing a list of account names starting with "te". I can understand that it is not working as this component is called from VF Page.Image using Lightning input field

How to get lightning:input field value in Controller

$
0
0

I'm trying to get lightning: input field value in my component controller but its either giving me undefined value if I don't define a default value in my attribute or giving me default value.

Component:

<aura:component >
    <aura:attribute name="booleanvalue" type="boolean" default="false"/>

    <lightning:input type="checkbox" value="{!v.booleanvalue}" label="Test Checkbox"/> 

    <lightning:button label="Save" onclick="{! c.handleSave}"/>
</aura:component>

Controller:

({
    handleSave : function(component, event, helper) {
        console.log('>>> save method... '+component.get("v.booleanvalue"));
    }
})

Not able to subscribe to Reports? Keeps giving error!

$
0
0

I am getting following error when trying to subscribe to reports -
"We couldn't set up your subscription. Try subscribing again. If you still can't subscribe, ask your Salesforce admin for help."

I am doing the Lightning Experience Reports & Dashboards Specialist superbadge.

enter image description here

I checked/unchecked many reports related permissions on Profile, but it keeps giving this error.

I am not able to find why is this happening & its really frustrating as its the last step to complete the Superbadge. Please help.


Lightning Component for quick action

$
0
0

I built a lightning component to make some changes to Lead Record and I added it as a quick action.

This is my helper.js:

changeOwnerAction : function(cmp,event) {

    var recordId = cmp.get("v.recordId");

    var action = cmp.get("c.changeOwnerForSelectedRecord");

    action.setParams({
        recordId : recordId
    });

    action.setCallback(this,function(res){
        var state = res.getState();
        if(state === "SUCCESS"){
            //do something
        }
    });

    $A.enqueueAction(action);
},

closeAction: function(cmp, event){ 
    var recordId = cmp.get("v.recordId");
    var sObectEvent = $A.get("e.force:navigateToSObject");
        sObectEvent .setParams({
        "recordId": recordId,
        "slideDevName": "detail"
    });
    sObectEvent.fire(); 
}

And the controller calls those functions one after another:

doInit : function(component, event, helper) {
    helper.changeOwnerAction(component,event);
    helper.closeAction(component,event);
}

The doInit is used in an handler:

<aura:handler name="init" value="{!this}" action="{!c.doInit}" />

At the end of the action the modal still shows for just a second but I've to wait few seconds to get the update available in the detail view as well as in the Lead state wizard.

has anyone else faced this issue?

My-Domain in Free Trial Org created from Appexchange

$
0
0

We have a listing on the Appexchange that offers a trial option for our ISV product. The trial works and creates the free trial orgs in the correct way.

However, Orgs are generated without my-domain, which is a requirement for our lightning components. We would like to understand if there is a way to generate these free trial orgs with a my-domain already configured.

Thanks!

Reduce Load time of Service Console in Lightning

$
0
0

I would like to reduce the load time of the service console because of which agents are annoyed.

I have one lighting component which gets data from server with soql and then data is bind to wrapper class, which is used to display data.

Currently it takes on average 6.6 sec to load. Is it normal time or on the higher side?

Any inputs on this will be really helpful.

Thanks

Add to Campaign button missing on Campaign Influence in Lightning

$
0
0

We are currently working on moveing from Classic UI to Lightning Interface and I would like to get advice from the experts who are already using Lightning Interface.

I setup all the settings to enable the Customizable Camapaign Influence and I am able to see the Camapign Influence related list on the Lightning Interface with the older Camapign records but the issue is we dont see Add to Camapign button on the related list

enter image description here

As suggested in the forums I created a custom Camapaign Model and made it as default, the issue is it removes all the Camapigns on the existing Opp record. enter image description here

Above picture is on the same Opp record after I enabled the Custom Model as default. I also read this in the Knowledge article here

enter image description here

Do we need to create workflows to add Camapign to Opp with default model? Can anyone please share the info on this

Lightning component quick action - send parameters to the lightning component

$
0
0

I have a lightning component that is available for use as lightning component quick action.

I need to use this component from various object actions, for example, I will add a lightning component quick action to account object and to contact object.

Now on the lightning component itself, I want to know if it was invoked from the account object or from the contact object, but I cannot find a way to do that.

I have found a way to get the record Id by adding <aura:attribute name="recordId" type="String" /> (see code snippet below)

It is working but not good enough.

What I really need is to send a parameter from the lightning component quick action invocation: enter image description here

And get it in my component:

<aura:component implements="force:lightningQuickAction,force:hasRecordId,flexipage:availableForAllPageTypes">
    <aura:attribute name="recordId" type="String" />
    <aura:attribute name="param" type="String"/>
</aura:component>

Is this possible?

And if not - any workaround for achieving that?

Viewing all 3003 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>