Skip to main content

#Lightning Component0 utenti parlano di questo argomento

I use the Lightning Component "Tab" on a lightning page. Is there a way to get the URL to one of the component's tabs? Hovering over a tab just shows "javascript:void(0)".

 

For example, I want to give a user a direct link to the "Decisions" tab. But I can't because I don't know the URL to that tab.

URL to Lightning Component Tab?

 

Thanks,

 

Marc

 

#Lightning Component  #Lightning Web Components

5 risposte
0/9000

 We have just integrated Sharepoint with Salesforce in our sandbox. We understand that in order to Share or attach specific documents on an account record, we must use the Chatter Attachment to search and attach file.   Is there a way to created a custom application for Salesforce–SharePoint integration with the Lightning Component framework? We would like the application to appear as a separate section on the account record. We would like it to also allow the following:

  • Searching for SharePoint files from Salesforce.
  • Uploading files from Salesforce directly into SharePoint.
  • Uploading files from Outlook integrated with Salesforce into SharePoint.
  • Previewing and downloading SharePoint files right from Salesforce.
  • Relating SharePoint files to particular Salesforce Account, Contact and Opportunity records.

Any help would be appreciated. Referencing How-To-Guides would be REALLY great

 

#Lightning Component #Salesforce&SharePoint.  Thanks! 

3 risposte
0/9000

So, it's been a while since I've posted about this @Michael Orr, @Andrew Cafourek.  Has there been any update regarding lookup fields working on mobile using the lightning:inputField component?  It's really becoming a major issue to have lookups that behave as text fields (which is not useful) on a mobile or tablet.  Do you know when this massive issue is going to be fixed?

 

Also, any word on when we will be able to add a lightning component to a list view in lightning communities?

 

These issues are costing us too many hours and too many high-value customers.

 

Cheers

Nic

7 commenti
  1. 5 giu 2023, 18:04

    So, my custom look up to contact field on my custom object works great on the desktop but cannot find the same record on the mobile app. Is this a "known issue"? I guess the workaround is to look up the contact first and create the custom object record from there. SMH

0/9000

I am running following function in helper.js Lightening component. It is opening  https://www.xxxxxxx.com/s/login page instead of https://www.xxxxxxx.com/login.

 

var urlEvent = $A.get("e.force:navigateToURL"); urlEvent.setParams({ "url": "/login"}); urlEvent.fire();

 

Regards,

 

#Lightning Component  #Salesforce Developer

3 risposte
  1. Ines Garcia (get: Agile) Forum Ambassador
    26 gen 2022, 11:59

    Any community will append that '/s'

    is 'standard'

0/9000

Created the custom component with the contents, and it is working fine for the System admin profile. But it is not visible in the Standard USER.  I mean the Custom Component is visible on the page, but its CONTENTS /list of values is not visible.     I have enabled the permission sets and also access to records in the profile. But still not able to fix it. any idea? 

 

#Salesforce Admin #Lightning #Lightning Component 

2 risposte
  1. 12 ott 2021, 12:29

    @Praful Jain Thank you for the suggestion.   I figured out the solution, it was Profile permission in the apex classes. Which need to be enabled. 

0/9000

Hello,

 

I am able to redirect from a lightning component to another lightning component using:

<c:SecondLighningComp recordId="{!v.recordId}" />

 

But I cannot redirect to second lightning component on click of a button.

<lightning:button label="Click me" variant="brand" onclick="{!c.handleYes}"></lightning:button>

function:

handleYes: function(component, event, helper) {

var urlEvent = $A.get("e.force:navigateToComponent");

urlEvent.params({

componentDef: "c:SecondLighningComp",

componentAttributes: {}

});

urlEvent.fire();

}

 

The second component calls an apex class that uses ApexPages.currentPage().getParameters().get.(Multiple record values) which is returning null. I cannot change anything in the apex class.

 

How to approach this?

#Salesforce Developer

1 risposta
  1. 29 ott 2021, 02:00

    Hi  shylesh,

     

    Starting in API version 43.0, the force:navigateToComponent event is deprecated. For more information, see Components with Minimum API Version Requirements. We recommend implementing the lightning:isUrlAddressable interface on your target component and navigating to the component using lightning:navigation component with the standard__component page type instead. This generates a route in the format /cmp/{componentName}?myAttr=attrValue.

     

    https://developer.salesforce.com/docs/component-library/bundle/force:navigateToComponent/documentation

     

    Migrate to lightning:isUrlAddressable from force:navigateToComponent

    https://developer.salesforce.com/docs/atlas.en-us.234.0.lightning.meta/lightning/components_navigation_migrate_to_isUrlAddressable.htm

0/9000

Hello,

 

I tried creating a server-side action and came across a weird issue. I tried checking online for solutions and am still stuck. Could you help me?

 

Lightning Component: TunaFishCheck.cmp

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

<aura:attribute name="tuna" type="Boolean" default="false"/>

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

<aura:if isTrue="{!tuna}">

<div>true</div>

<aura:set attribute="else">

<div>false</div>

</aura:set>

</aura:if>

</aura:component>

 

function

tunaCheck: function (cmp){

console.log('Its inside');

var tuna= cmp.get("c.doAction");

console.log('Check: ' + tuna);

action.setCallback(this, function(response){

var stateF = response.getReturnValue();

alert("Check: " + stateF);

if (stateF === 'SUCCESS'){

component.set("{!v.tuna}", response.getReturnValue());

} else {

console.log('Unsuccessful return value');

}

});

$A.enqueueAction(tuna);

}

 

Apex Component

public with sharing class SeaFood {

ApexPages.StandardController sc;

public SeaFood(ApexPages.StandardController controll){

this.sc = controll;

}

@AuraEnabled

public static Boolean doAction(){

PageReference refPage;

Boolean fish = fishCheck()();

if (fish){

return true;

} else if (!fish){

return false;

}

return fish;

}

@AuraEnabled

Public static Boolean fishCheck(){

//censored functionality code

return true;

}

 

Note: while running,

console log shows: 

Its Inside

Check:

SecureAction: [object Object]{ key: {"namespace":"c"}

UI:

error while creating componenet for lightning component quick action [Action failed c:TunaFishCheck$controller$tunaCheck [action is not defined]]

 

Noticed that console.log('Check: ' + tuna); doesn't have a value

How can I fix these issues?

 

#Salesforce Developer #Custom Actions #Apex Class #Aura Lightning Components #Lightning Component #Lightning Flow

5 risposte
  1. 29 ott 2021, 03:14

    @Suraj Tripathi I able to add the value but there seems to be a bug. The code does not do initialization and goes directly to <aura:set attribute="else"> statement. If I remove the else statement, then only it goes into <aura:if>. Any suggestions?

     

    Note: I have the initialization command in the code

    <aura:attribute name="tuna" type="Boolean" default=""/>

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

0/9000

I am facing issues when I create a custom Lightning Search Component using my VS Code . It is not deploying it to my org . 

Error Msg :- Unable To Find Apex Action Method Referenced as   AccountSearchCls.getAccounts() ;

 

here's my code 

 

controller :- 

 

public with sharing class AccountController {  

  

    @AuraEnabled( cacheable = true )  

    public static List< Account > getAccounts( String searchKey ) {  

        String strKey = '%' + searchKey + '%';  

        return [ SELECT Id, Name, Industry,Website FROM Account WHERE Name LIKE: strKey];  

          

    }  

      

 

JS File :-

 

import { LightningElement,track  } from 'lwc';

import fetchAccounts from '@salesforce/apex/AccountSearchCls.fetchAccounts'; 

const columns = [  

    { label: 'Name', fieldName: 'Name' },  

    { label: 'Industry', fieldName: 'Industry' },

    { label: 'Website', fieldName: 'Website' },    

];  

  

export default class AccountSearchUsingLWC extends LightningElement {

  

     accounts;  

     error;

     columns = columns;  

  

     handleKeyChange( event ) {  

          

        const searchKey = event.target.value;  

  

        if ( searchKey ) {  

  

            fetchAccounts( { searchKey } )    

            .then(result => {    

                this.accounts = result; 

            })  

            .catch(error => {  

  

                this.error = error;  

  

            });  

  

        } else  

        this.accounts = undefined;  

  

    }  

 

XML File :-

 

 <?xml version="1.0" encoding="UTF-8"?>

<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">

    <apiVersion>48.0</apiVersion>

    <isExposed>true</isExposed>

     <targets>

        <target>lightning__AppPage</target>

        <target>lightning__RecordPage</target>

        <target>lightning__HomePage</target>

    </targets>

</LightningComponentBundle> 

 

HTML File ":-

 

<template>  

      

    <lightning-card title = "Search Accounts using lwc">  

  

        <div class = "slds-m-around_medium">  

  

            <lightning-input type = "search" onchange = {handleKeyChange} class = "slds-m-bottom_small" label = "Search" >  

            </lightning-input>  

  

            <template if:true = {accounts}>  

                  

                <div>  

  

                    <lightning-datatable key-field="Id"  

                                         data={accounts}  

                                         columns={columns}  

                                         hide-checkbox-column="true"  

                                         show-row-number-column="true">  

                    </lightning-datatable>  

  

                </div>                   

      

            </template> 

 

Can anyone help me out here ? I am not able to understand what's the issue  here .

 

#Lightning Web Components  #Lightning Component  #Sales Cloud  #Nonprofit  #Trailhead  #New Releases

      

            <template if:true={error}>  

                No records found!

 

            </template>  

 

        </div>  

  

    </lightning-card>  

  

</template> 

2 risposte
  1. 6 ott 2021, 06:13

    Hi Yash Muley,

    You are mistaking one line in JS file.

     

    Incorrect line in JS file i.e. second line.

    import fetchAccounts from '@salesforce/apex/AccountSearchCls.fetchAccounts';

     

    Correct line in that file according to the above controller will be:

    import fetchAccounts from '@salesforce/apex/AccountController.getAccounts';

     

                                         OR(you can also write this)

     

    import getAccounts from '@salesforce/apex/AccountController.getAccounts';

     

    I hope. These line will help you.

     

    Thank you!

    Regards,

    Suraj Tripathi 

0/9000

Lightning Configuration Webinar Alert ⚡  Coming your way TOMORROW! - 📣 Are you (or your customers) new to lightning and curious how to use certain features or customize for your needs? 

 

Join us for the "Getting Started: Platform: Lightning Configuration and Customization" Webinar to learn from Lightning Experts as we guide you through high-level configurations, customization, and personalization capabilities in the Lightning UI.   

 

Webinar: Getting Started: Platform: Lightning Configuration and Customization

Date/Time: Tuesday September 28th, 10 - 11:30 am PST / 1pm - 2:30pm EST

Format: Virtual, Listen-Only Webinar

REGISTER HERE: https://cs.salesforce.com/events/7013y000002hJ6aAAE  

 

Questions are always welcome, and We look forward to seeing you soon! 

 

#Lightning #Lightning Knowledge #Lightning App Builder #Lightning Configuration #Lightning Component #Lightning Record Page #Lightning Pages

0/9000

I have created a tab using aura component name 'sign up' on my login page. Now i want to redirect this 'sign up'

 

#Lightning Component tab to my custom object name 'user info', in such a way that whenever some user click that tab of sign up, that  custom object open and user can enter a record.

2 risposte
0/9000