• Nashle Pak
  • NEWBIE
  • 60 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 14
    Questions
  • 23
    Replies
Hello Ohana,
I use Lightning Out to integrate my LWCs on external sites.

My LWC displays contact records and works perfectly on my Salesforce app homepage.
User-added image

On an external site, my LWC is displayed but not the records.
User-added image
The code of the LWC and my application is available at this address:https://github.com/Nashle/lightningout/
The live is available at this address:https://nashle.github.io/lightningout/

Do I need to create an application connected with OAuth to allow GestUsers to access the application's data? And if so, how should it be configured to allow my LWC to display the data when it is hosted on a remote site?

Can you help me please ?
Hello Ohana,

I use Lightning Out for embed my LWCs into my external website.

In my Lightning app I have paste this line for add SLDS at my application : 
<aura:application access="GLOBAL" extends="ltng:outApp" implements="ltng:allowGuestAccess">
    <ltng:require styles="{!$Resource.SLDS283 +
        '/styles/salesforce-lightning-design-system.css'}" />
    <aura:dependency resource="c:helloWorld" />>
    <!--<aura:dependency resource="c:expenses"/>-->
    <aura:dependency resource="c:FlowC13" />
</aura:application>

In addition to adding slds as a static resource in Salesforce, in my repository, I add the static SLDS resource under 2 different directory names: "-slds" and "slds".

But I still do not see SVG and fonts are not recovered.

User-added image

Can you help me ?


My project is available online at this address:
https://nashle.github.io/lightningout/

You can check the contents of my repository at this url:https://github.com/Nashle/lightningout/

Aloha!
Hello Ohana,

I am currently developing skills in LWC development. This is the trailhead module I'm doing :
https://trailhead.salesforce.com/fr/content/learn/modules/lightning-web-components-basics/push-lightning-web-component-files?trail_id=build-lightning-web-components

I'm at the last part, "Deploy Files" I happen to be unable to deploy. My console displays this message:
User-added image

For steps 1, 2 and 3, I entered the following commands:
 
sfdx force:auth:web:login -d -a myhuborg 
On the login screen, I use the same username that I use to connect to my TP.
sfdx force:source:deploy -p force-app -u brice.dardeau@resourceful-bear-qbqogg.com // This is the username with which I connect to my TP. The same as before

And I get the error message above.

Can you help me please ?
 
Hello to all Ohana,

I am working on a model and I can not find a solution to my problem. it is available here:

https://developer.salesforce.com/forums/ForumsMain?id=9062I000000XnesQAC

How can I find help outside the community?
I absolutely need the help of an expert.

Is there a platform, site or person for me to connect with a Lightning Aura Component and Lightning Out development expert, please?

I can not get official salesforce support because I only have one Trailhead Playground organization right now.

Aloha !
Hello Ohana !


To test Lightning Out on an external site, I use the application created in the "Aura Components Basics" module: expensesApp

This one works very well the proof in image:
User-added imagePour To make my application available with lightning out, I helped myself to this blog: https://newstechnologystuff.com/2019/05/28/use-lightning-web-components-in-lightning-out/

1. I add the url of site which must integrate my application in the CORS.User-added image2. I created a new dedicated application for lightning out "LightOutApp" 
<aura:application access="GLOBAL" extends="ltng:outApp">
    <aura:dependency resource="c:expenses" type="COMPONENT"/>
</aura:application>
Here's the code for my expenses component :
<aura:component controller="ExpensesController">
    
    <aura:attribute name="expenses" type="Expense__c[]"/>
    
    <aura:handler name="updateExpense" event="c:expensesItemUpdate"
                  action="{!c.handleUpdateExpense}"/>
    <aura:handler name="createExpense" event="c:expensesItemUpdate"
                  action="{!c.handleCreateExpense}"/>
    
    <aura:handler name="init" action="{!c.doInit}" value="{!this}"/>
    
    <!-- PAGE HEADER -->
    <lightning:layout class="slds-page-header slds-page-header--object-home">
        <lightning:layoutItem>
            <lightning:icon iconName="standard:scan_card" alternativeText="My Expenses"/>
        </lightning:layoutItem>
        <lightning:layoutItem padding="horizontal-small">
            <div class="page-section page-header">
                <h1 class="slds-text-heading--label">Expenses</h1>
                <h2 class="slds-text-heading--medium">My Expenses</h2>
            </div>
        </lightning:layoutItem>
    </lightning:layout>
    <!-- / PAGE HEADER -->
    <!-- NEW EXPENSE FORM -->
    <lightning:layout >
        <lightning:layoutItem padding="around-small" size="6">
            <c:expenseForm/>
        </lightning:layoutItem>
    </lightning:layout>
    
    <lightning:layout>
        <lightning:layoutItem padding="around-small" size="6">
            <c:expensesList expenses="{!v.expenses}"/>
        </lightning:layoutItem>
        <lightning:layoutItem padding="around-small" size="6">
            Put something cool here
        </lightning:layoutItem>
    </lightning:layout>
    
</aura:component>

3. I added the code JS on the page of the site (SAP FIORI) which must display my component, here :
 
<div id="lightningLocator"></div>
<script src="https://playful-fox-o26ov9-dev-ed.lightning.force.com/lightning/lightning.out.js"></script>
<script>
    $Lightning.use("c:LightOutApp",    // name of the Lightning app
        function() {                  // Callback once framework and app loaded
            $Lightning.createComponent(
                "c:expenses", // top-level component of your app
                { },                  // attributes to set on the component when created
                "lightningLocator",   // the DOM location to insert the component
                function(cmp) {
                    // callback when component is created and active on the page
                    console.log("LApp was created")
                }
            );
        },
        'https://playful-fox-o26ov9-dev-ed.lightning.force.com/'
    );
</script>

but when I load the page, I always get the following error in my chrome JS console: 

Access to XMLHttpRequest at 'https://playful-fox-o26ov9-dev-ed.lightning.force.com//c/LightOutApp.app?aura.format=JSON&aura.formatAdapter=LIGHTNING_OUT' from origin 'https://webidetesting6929559-p2000088220trial.dispatcher.hanatrial.ondemand.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
/webapp/resources/sap/ui/core/messagebundle_fr_FR.properties:1 Failed to load resource: the server responded with a status of 404 ()

I forgot something ? The syntax of my code is not good?
Hello Aloha,
I want to use Visual Studio Code to manage my code. I already installed the necessary extensions and I created my project locally then pushed some apex classes.

Today, I want to reconnect with this organization and open the project locally.

To do so, I do Ctrl + Shift + P to enter my cli commands such as:

sfdx force: org: list --all
sfdx force: auth: logout -u <hub alias>
sfdx force: org: open
....

But my orders are not recognized. Only these are offered to me:
User-added image
How do I use the keyboard shortcut Ctrl + Shift + P to reconnect to my organization and open the project file tree locally, please?
Hello everyone,

My goal is to build on Salesforce user interface integration in third-party applications.

Several options open to me:

1. Use API UI
2. Create visualforce pages and then embed them in Sites to display them in iframes
3. Create Lightning Apps and Add Lightning Out Dependence

As far as my tools are concerned, I have a Trailhead Playground environment and a SAP FIORI (third-party application) environment.

So I evaluated each of my options, the 1st seems out of reach from a point of view of my technical skills and those of my colleagues because the stack JS is really too demanding. For the 2nd solution, it seems to me the most affordable but the interface of my applications would not look like the interface of Lightning. The 3rd seems to be the best compromise. In addition to being able to add the SLDS style to my components, I've also done some development with Aura components last year so the learning curve should be reduced.

Let me know if I'm wrong in my reasoning.

My question is therefore whether it will be possible for me to create components, to add them to applications to distribute them with Lightning Out in JS in SAP FIORI without finding myself blocked by the limits of TP environment. I'm thinking in particular about authentication ...
Hi Aloha !

I created a super flow of death with flow builder here:

User-added image

This flow works well is integrated perfectly in my organization with the lightning application generator, the proof in image:

User-added image

I want to integrate my flow into an external site (third party). To do this, I have to use Lightning Out.

So I created a lightning component to embed my flow with the following code: 
 
<aura:component>
    <aura:handler name="init" value="{!this}" action="{!c.init}" />
    <lightning:flow aura:id="flowData" />
</aura:component>
and
({
    init : function (component) {
        // Find the component whose aura:id is "flowData"
        var flow = component.find("flowData");
        // In that component, start your flow. Reference the flow's API Name.
        flow.startFlow("myFlow");
    },
})
This code, I got it from the official salesforce documentation here: https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/components_using_flow_cmp.htm

Obviously, I replace the value "myFlow" by the API name of my flow.

Puis, j'intégre mon flow à une application lightning pour le tester avec le code suivant :
 
<aura:application >
    <c:testFlow/>
</aura:application>

"testFlow" is the name of my component.

You notice that I did not add Lightning Out dependencies voluntarily, to have a simple overview of my flow in a lightning application.

When I show my flow in with the Previous button of the console, my flow is like this:

User-added image

Someone has an idea of the problem?
Hello to all,

Do you know if Salesforce is performing well for organizations with millions of records?

Specifically, if I have 6 million contacts in Salesforce, can global search succeed?

I wanted to do tests on my Trailhead organization but could not load more than 4,200 contacts ... Limit trailhead environments. The demonstration environments (dev, unlimited, ...) do not allow to import data with dataloader.

If you have any measures to communicate to me or articles to follow me to complete my documentation before sale, it would be great :-).

Regards,
Brice
Good morning all,

I just integrated the display of steps by adding a progress indicator to a Flow Screen.

My flow display now the steps correctly but since the integration of the component on the screens, validation checks that must display an error and click on "previous" button crash the flow is displayed the following message: The delimiter of "Company / Representative "stage is missing.

I used the same code provided on this page:

https://developer.salesforce.com/docs/atlas.en-us.216.0.lightning.meta/lightning/components_config_for_flow_screens_stages.htm

Can you help me please ?
Hello,

Can not find a viable solution to my problem.

When creating an account record, the user must also create an associated object.

When he enters the SIREN number (national company ID) I want to interoperate an API to check that the company is registered in the national repository and then retrieve the company information to complete certain fields of the registration.

1. I first imagined the following solution: On the creation screen of the associated record, display a button on the SIREN field to perform the actions. Alas, it does not seem possible to develop this solution without it requires a lot of development time and learning.

2. The second imagined solution is as follows: A trigger triggered before the registration checks whether the SIRET exists and adds the additional information to the record. Alas, the API call in a trigger is impossible and when it is via the use of a method of an annotated class apex @future, I can not return a list of records.

3. I am now thinking of using flow and see if it will be possible for me to solve all these constraints.

My questions :

1. For my 1st solution, can you confirm to me that it requires to write either a visualforce specific screen for the creation of the recordings and to use JS or worse, to develop lightning components. Can not we integrate a button into a field on standard screens?

2. For my 2nd solution, how can I use a trigger that queries an external API and perform my operations on the records being created?

Thank you very much for your answer.
Hello,

I am currently working on a model for a French energy supplier. I encounter a simple problem for which I do not know of any solution.

Here is the situation:

I have 2 types of accounts, Installation and Company.
I must be able to create a "case" that references for a 1st field a company of type installation and for 2nd an installation.

So I have 2 "case" relationships to account, a standard and a custom to which I apply search filters.

The problem is that for account records that does not exist yet when creating the case. Users are prompted to create a record and a pop-up window asks to select the type of record to create.

I would like to override the request of the type to force the creation of one or the other according to the selected field for the creation.

Here are some pictures to understand my problem.
Case creation screen
User-added image

contextual window when creating an installation or a company
User-added image

Voilà !

I hope this problem can be solved with setting :D

Thank you in advance friends

Hello to all, $

Usually, I use HaoIDE with Sublime Text.

With HaoIDE, I have the possibility to recover elements of my organization to modify them in local: class apex, component lightning, ...

I understand that Salesforce DX pushes us to go through a repository.

But I would like to know if a feature that allows me to recover existing code directly on an organization exists please.

Thank you in advance !
Hello community,

This is my 1st post! 

I am a consultant in a company specializing in the integration of the SAP ERP solution in the energy sector. Salesforce has been in our solution catalog for a short time.

I am a Salesforce consultant.

A customer wants to integrate a Salesforce organization that can communicate with SAP.

Looking quickly at what exists and configuring Salesforce connect, I realize that external records are searchable, which is already not so bad.

Can you tell me if I can create, edit, or delete external records with Salesforce connect and if possible, how?

If this is not possible with Salesforce connect, what is the best way to integrate these features? OData, SOAP, Rest, Jitterbit, Mulesoft, ... I do not master the architecture.

Regards,
Brice
 
Hello Ohana,
I use Lightning Out to integrate my LWCs on external sites.

My LWC displays contact records and works perfectly on my Salesforce app homepage.
User-added image

On an external site, my LWC is displayed but not the records.
User-added image
The code of the LWC and my application is available at this address:https://github.com/Nashle/lightningout/
The live is available at this address:https://nashle.github.io/lightningout/

Do I need to create an application connected with OAuth to allow GestUsers to access the application's data? And if so, how should it be configured to allow my LWC to display the data when it is hosted on a remote site?

Can you help me please ?
Hello Ohana !


To test Lightning Out on an external site, I use the application created in the "Aura Components Basics" module: expensesApp

This one works very well the proof in image:
User-added imagePour To make my application available with lightning out, I helped myself to this blog: https://newstechnologystuff.com/2019/05/28/use-lightning-web-components-in-lightning-out/

1. I add the url of site which must integrate my application in the CORS.User-added image2. I created a new dedicated application for lightning out "LightOutApp" 
<aura:application access="GLOBAL" extends="ltng:outApp">
    <aura:dependency resource="c:expenses" type="COMPONENT"/>
</aura:application>
Here's the code for my expenses component :
<aura:component controller="ExpensesController">
    
    <aura:attribute name="expenses" type="Expense__c[]"/>
    
    <aura:handler name="updateExpense" event="c:expensesItemUpdate"
                  action="{!c.handleUpdateExpense}"/>
    <aura:handler name="createExpense" event="c:expensesItemUpdate"
                  action="{!c.handleCreateExpense}"/>
    
    <aura:handler name="init" action="{!c.doInit}" value="{!this}"/>
    
    <!-- PAGE HEADER -->
    <lightning:layout class="slds-page-header slds-page-header--object-home">
        <lightning:layoutItem>
            <lightning:icon iconName="standard:scan_card" alternativeText="My Expenses"/>
        </lightning:layoutItem>
        <lightning:layoutItem padding="horizontal-small">
            <div class="page-section page-header">
                <h1 class="slds-text-heading--label">Expenses</h1>
                <h2 class="slds-text-heading--medium">My Expenses</h2>
            </div>
        </lightning:layoutItem>
    </lightning:layout>
    <!-- / PAGE HEADER -->
    <!-- NEW EXPENSE FORM -->
    <lightning:layout >
        <lightning:layoutItem padding="around-small" size="6">
            <c:expenseForm/>
        </lightning:layoutItem>
    </lightning:layout>
    
    <lightning:layout>
        <lightning:layoutItem padding="around-small" size="6">
            <c:expensesList expenses="{!v.expenses}"/>
        </lightning:layoutItem>
        <lightning:layoutItem padding="around-small" size="6">
            Put something cool here
        </lightning:layoutItem>
    </lightning:layout>
    
</aura:component>

3. I added the code JS on the page of the site (SAP FIORI) which must display my component, here :
 
<div id="lightningLocator"></div>
<script src="https://playful-fox-o26ov9-dev-ed.lightning.force.com/lightning/lightning.out.js"></script>
<script>
    $Lightning.use("c:LightOutApp",    // name of the Lightning app
        function() {                  // Callback once framework and app loaded
            $Lightning.createComponent(
                "c:expenses", // top-level component of your app
                { },                  // attributes to set on the component when created
                "lightningLocator",   // the DOM location to insert the component
                function(cmp) {
                    // callback when component is created and active on the page
                    console.log("LApp was created")
                }
            );
        },
        'https://playful-fox-o26ov9-dev-ed.lightning.force.com/'
    );
</script>

but when I load the page, I always get the following error in my chrome JS console: 

Access to XMLHttpRequest at 'https://playful-fox-o26ov9-dev-ed.lightning.force.com//c/LightOutApp.app?aura.format=JSON&aura.formatAdapter=LIGHTNING_OUT' from origin 'https://webidetesting6929559-p2000088220trial.dispatcher.hanatrial.ondemand.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
/webapp/resources/sap/ui/core/messagebundle_fr_FR.properties:1 Failed to load resource: the server responded with a status of 404 ()

I forgot something ? The syntax of my code is not good?
What would I do without the community!? 
Please assist with the error for the trigger. Thank you! 

CLASS------->
public class RelatedTasks { 
    public static boolean taskmethod(){
        List<Task> tasks = [SELECT id, status from Task WHERE WhatId =:ApexPages.CurrentPage().getparameters().get('id') and status = 'Open'];
        boolean isOpen = false;
        for(Task t : tasks){        
            if(t.Status =='Open'){
                isOpen = true;           
            }
        } 
        return isOpen;
    }
}


TRIGGER------------>
trigger getOpenTasks on Case (before update) {
    for(Case c : Trigger.New){        
        If(RelatedTasks.taskmethod().isOpen==true){
            c.adderror('You cannot close a case with an open task');
        }
    }
}
ERROR---------> Variable does not exist: isOpen

THANK YOU!!!
Hello Aloha,
I want to use Visual Studio Code to manage my code. I already installed the necessary extensions and I created my project locally then pushed some apex classes.

Today, I want to reconnect with this organization and open the project locally.

To do so, I do Ctrl + Shift + P to enter my cli commands such as:

sfdx force: org: list --all
sfdx force: auth: logout -u <hub alias>
sfdx force: org: open
....

But my orders are not recognized. Only these are offered to me:
User-added image
How do I use the keyboard shortcut Ctrl + Shift + P to reconnect to my organization and open the project file tree locally, please?
Hi Aloha !

I created a super flow of death with flow builder here:

User-added image

This flow works well is integrated perfectly in my organization with the lightning application generator, the proof in image:

User-added image

I want to integrate my flow into an external site (third party). To do this, I have to use Lightning Out.

So I created a lightning component to embed my flow with the following code: 
 
<aura:component>
    <aura:handler name="init" value="{!this}" action="{!c.init}" />
    <lightning:flow aura:id="flowData" />
</aura:component>
and
({
    init : function (component) {
        // Find the component whose aura:id is "flowData"
        var flow = component.find("flowData");
        // In that component, start your flow. Reference the flow's API Name.
        flow.startFlow("myFlow");
    },
})
This code, I got it from the official salesforce documentation here: https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/components_using_flow_cmp.htm

Obviously, I replace the value "myFlow" by the API name of my flow.

Puis, j'intégre mon flow à une application lightning pour le tester avec le code suivant :
 
<aura:application >
    <c:testFlow/>
</aura:application>

"testFlow" is the name of my component.

You notice that I did not add Lightning Out dependencies voluntarily, to have a simple overview of my flow in a lightning application.

When I show my flow in with the Previous button of the console, my flow is like this:

User-added image

Someone has an idea of the problem?
What are the features available in Salesforce CPQ that are not available on Salesforce?
Why to use Salesforce CPQ and not Salesforce CRM?
Good morning all,

I just integrated the display of steps by adding a progress indicator to a Flow Screen.

My flow display now the steps correctly but since the integration of the component on the screens, validation checks that must display an error and click on "previous" button crash the flow is displayed the following message: The delimiter of "Company / Representative "stage is missing.

I used the same code provided on this page:

https://developer.salesforce.com/docs/atlas.en-us.216.0.lightning.meta/lightning/components_config_for_flow_screens_stages.htm

Can you help me please ?
Hello,

Can not find a viable solution to my problem.

When creating an account record, the user must also create an associated object.

When he enters the SIREN number (national company ID) I want to interoperate an API to check that the company is registered in the national repository and then retrieve the company information to complete certain fields of the registration.

1. I first imagined the following solution: On the creation screen of the associated record, display a button on the SIREN field to perform the actions. Alas, it does not seem possible to develop this solution without it requires a lot of development time and learning.

2. The second imagined solution is as follows: A trigger triggered before the registration checks whether the SIRET exists and adds the additional information to the record. Alas, the API call in a trigger is impossible and when it is via the use of a method of an annotated class apex @future, I can not return a list of records.

3. I am now thinking of using flow and see if it will be possible for me to solve all these constraints.

My questions :

1. For my 1st solution, can you confirm to me that it requires to write either a visualforce specific screen for the creation of the recordings and to use JS or worse, to develop lightning components. Can not we integrate a button into a field on standard screens?

2. For my 2nd solution, how can I use a trigger that queries an external API and perform my operations on the records being created?

Thank you very much for your answer.
Hello,

I am currently working on a model for a French energy supplier. I encounter a simple problem for which I do not know of any solution.

Here is the situation:

I have 2 types of accounts, Installation and Company.
I must be able to create a "case" that references for a 1st field a company of type installation and for 2nd an installation.

So I have 2 "case" relationships to account, a standard and a custom to which I apply search filters.

The problem is that for account records that does not exist yet when creating the case. Users are prompted to create a record and a pop-up window asks to select the type of record to create.

I would like to override the request of the type to force the creation of one or the other according to the selected field for the creation.

Here are some pictures to understand my problem.
Case creation screen
User-added image

contextual window when creating an installation or a company
User-added image

Voilà !

I hope this problem can be solved with setting :D

Thank you in advance friends