Skip to main content

#Aura0 debatiendo

Integrating Cloud Files with LWC via Visualforce and Aura

In a recent project, I encountered a challenge while trying to integrate Cloud Files, a feature that was part of a managed package, into a Lightning Web Component (LWC). As many developers are aware, it’s not possible to directly invoke an Aura component from LWC. However, given the requirements of the project, I needed to find a workaround to make this integration work seamlessly.

The Solution:

I devised a solution by leveraging Visualforce pages to act as a bridge between LWC and Aura components. Here’s how I approached the problem:

1. Calling Visualforce from LWC:

I embedded a Visualforce page within my LWC using the <iframe> approach. This allowed me to invoke the Visualforce page directly from within the LWC framework.

2. Invoking Aura from Visualforce:

From the Visualforce page, I utilized JavaScript to call an Aura application. This app served as a middle layer between Visualforce and the Aura components.

3. Connecting to the Aura Component:

Finally, from the Aura application, I invoked the necessary Aura components that were required to interact with the Cloud Files managed package.

This layered approach allowed me to successfully integrate Cloud Files functionality within my LWC while respecting the architectural boundaries between LWC and Aura. Although not a direct method, this solution provided a seamless user experience and ensured that I could leverage managed package components in a modern LWC environment.

How else would you approach this issue?

Share your ideas and aske me your questions if there is one!

#Aura #Salesforce Developer #LightningWebComponent
0/9000

Hi All,

I made Screen Flow and I write Lightning code for Navigates to an sObject record specified by recordId. using below documentation.

https://help.salesforce.com/s/articleView?id=sf.flow_concepts_finish_override.htm&type=5

But I am not able to redirect. Please help me here to resolve this issue.

 

I placed my Lightning component at the last as an Action. As shown below.

Hi All,I made Screen Flow and I write Lightning code for Navigates to an sObject record specified by recordId. using below documentation.https://help.salesforce.com/s/articleView?id=sf.

 

#Flow  #Salesforce Developer

 

#Aura  #Lightning Experience  #Lightning App Builder  #Lightning Flow

0/9000

In customer portal(community portal) we have two tabs one is asset map & another one is smart tracks(both are aura component). If i open asset map it is visible, if i go to smart tracks it is visible, if i again go to asset map tab the component is not visible its shows blank in portal. 

 

#Salesforce Developer  #Aura  #Help  #Customer Portal Users

0/9000

お世話になっております。

 

他の方がLWCで処理を実装し、それを商談のアクションから実行できるようになっております。

これをエクスペリエンスサイトからでも実行できるようにする方法を調べております。

どうやら標準では方法がないようですが(何故…?)、Stack ExchangeによるとAuraでラップすることで解決するようです。

そこで下記Auraを作成し、Lightningアクションとして配置しました。

<aura:component implements="flexipage:availableForAllPageTypes,force:hasRecordId,force:lightningQuickAction">

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

</aura:component>

その結果、エクスペリエンスサイト上でアクションが表示されるようになったのですが、実行したところ処理が正常に行われません。

 

LWCの内容には直接関与していないのでちゃんとしたことは把握できていないのですが、どうやら関連するオブジェクトのデータを取得してExcelファイル(.xlsx)をダウンロードさせる処理のようです。

LWCを直接呼び出すアクションで正常動作を確認しており、上記Auraを呼び出すアクションを内部環境(サイトじゃない普通のSalesforce環境)で実行したところ、Excelファイルがダウンロードできました。

しかし、エクスペリエンスサイトから実行するとExcelファイルがダウンロードされません。

(いずれもシステム管理者で実行)

開発者コンソールを起動させていてもログが出力されないので、実行自体されていないのかもしれません。

 

エクスペリエンスサイトからこのLWCを実行するにはどうすればよいでしょうか。

私自信LWCに慣れていないのと直接実装に関わっていないこともあって、なるべくLWCには手を加えたくないと思っております。

 

以上、よろしくお願いいたします。

#LWC #Aura

4 respuestas
  1. 29 ene 2024, 03:32

    @Keiji Otsuboさん

     

    ありがとうございます。

    そういえばそうでしたね、昔別件でその辺苦労したのを思い出しました…

    私の関わってないところなのであまり触りたくはないですが、時間のある時に確認してみます。

0/9000

Does anyone have a workaround for the limitation that prevents LWCs to invoke aura components?

 

Here's a situation: we created a complex LWC which displays a list of records from custom object and has a ton of added features. We have a requirement to implement a record-level button menu which would invoke custom actions like add to campaign, log a call, create a meeting, etc. each of those should in turn invoke modals that contain existing complex custom aura components, however due to the limitation that aura cannot be invoked from a LWC we're running into an unsupported challenge.

 

Has anyone been able to successfully wrap the LWC with an aura component and allow that aura modal invocation to be passed through a custom event or some other similar workaround?

 

If so, I'd really appreciate a consult. 

 

Thanks,

 

#LWC  #Aura

3 respuestas
0/9000

The following error occured in the trailhead challange  We can't find an attribute tag with the correct attributes on the campingListItem component.  challange name :attributes and expressions.   my code :  <aura:component >     <aura:attribute name="item" type="Camping_Item__c" required="true"/>     <p>Name:{!v.item.Name}</p>     <p>Price: <lightning:formattedNumber value="{!v.item.price__c}" style="currency"/></p>     <p>Quantity: <lightning:formattedNumber value="{!v.item.Quantity__c}"/></p>     <p><lightning:input type="toggle" label="Packed" checked="{!v.item.Packed__c}"/></p> </aura:component>

 

#Lightning

 

#Lightning  #Aura

 

#Trailhead Challenges

 

#Lightning  #Aura  #Trailhead Challenges  #Lightning Web Components

7 respuestas
0/9000

I am using lightning:combobox seems like required doesn't work, can someone please help me with the code. How can I make this lightning:combobox field required by throwing some validation using client side controller in Lightning Aura

 

#Aura Component  #Aura  #Aura Lightning Components  #Lightning Aura  #Lightning Aura Component

4 respuestas
  1. 2 sept 2021, 06:38

    When I pressed the submit button, I was launching handleChange2 with validity2 set to true on the parent component using this custom component.

     

    the custom component that includes lightning: combobox.

     

    cmp

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

    <aura:handler name="change" value="{!v.validity2}" action="{!c.handleChange2}"/>

     

    controller

    handleChange2 : function(component, event, helper) {

            var inputCmp = component.find("required_ck");//Aura: id for lightning: combobox

            inputCmp.showHelpMessageIfInvalid();

     },

0/9000

Good morning all,

 

Right now we're running into an issue where the afterScriptsLoaded event does not appear to be firing in our Aura components on the "live" version of our Experience site.  In Experience Builder, everything fires off 100% fine every time and our jQuery/JavaScript libraries do as they're asked.  However, when you go to the "live" version of the site, the first time you login everything loads just fine.  As soon as you reload however, the jQuery appears to fail and continues to fail until (it looks like) the session expires and you start a new one.  Hard reloading doesn't work.  I can't find anything talking about this specific issue unfortunately.

 

Turning these into LWCs is not an option because of the nature in which these libraries modify the DOM (we're using SlickJS).

 

Any help would be greatly appreciated.  Thank you! #Aura #Lightning Component

3 respuestas
  1. 5 ago 2021, 13:32

    Ah, I think I got it.  I applied the fix in that link yesterday to one of the components, but not to the others, and it seems that when the others break, it breaks EVERYONE on the page.  The fixed component when all alone or with unproblematic components works just fine.  So, I've got some fixing to do!  But at least this one works!

0/9000

Could anyone help me

 

#Javascript #Aura #Aura Component #Salesforce Developer #Salesforce Developers #Salesforce Development #Developer Forums 

Someone could help me understand what this function does, please?

 

redirect: function (childComponent, pageReference, overrideUrl) {

if(this.isCommunityContext()){

let url = this.buildCommunityUrl(pageReference);

window.parent.location.href = url;

}

else{

var self = this;

const { closeTab, getEnclosingTabId, isConsoleNavigation, openSubtab } = childComponent.getSuper().find("workspace");

isConsoleNavigation()

.then(function (response) {

if (response === true) {

getEnclosingTabId().then(function (enclosingTabId) {

openSubtab({

pageReference: pageReference,

focus: true

}).then(function () {

closeTab({

tabId: enclosingTabId

});

}).catch(function (error) {

console.log(error);

});

});

} else {

let navService = childComponent.getSuper().find("navService");

navService.navigate(pageReference, overrideUrl);

}

}).catch(function (error) {

self.handleError(childComponent, error);

});

}

},

1 respuesta
  1. 5 ago 2021, 07:08

    Hi Yan,

     

    Despite its rather complex look, this function opens a new page in the browser.

     

    By the looks of it, it should be able to handle navigating to another page within a community context as well as console applications, where it knows to open a new console tab instead of a browser tab.

0/9000
3 respuestas
  1. 3 ago 2021, 22:01

    I think true or false will be set.

0/9000