• Nethra Raghupathy
  • NEWBIE
  • 10 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 30
    Questions
  • 23
    Replies
Hi,
 
I have a react application which is hosted on cloud. I would like to render it inside the salesforce lightning app. 
I see iframe is not the best approach (https://trailhead.salesforce.com/en/content/learn/modules/lex_dev_visualforce/lex_dev_visualforce_known_issues).
 
Can you guide me what is the best way to achieve it? 
Hi,

I have created a lightning component which I want in customer's opportunity record page.

So I have created a package with lightning app builder (record page). On installation of the package, Lightning component is available in customer's account but its not available in customer's opportunity record page. Is there a way to achieve it?   
Hi,
 
I have created a package with lightning component. Installation of the package in Partner Enterprise Edition shows the following issue "Your org doesn't have access to component cooper:companyInsightTeaserCard" but it works fine in developer edition. 
 
Can please guide me how to resolve this issue?
Hi,

I have a lightning app, which sets a variable during first time. From next time when the user users the app it should fetch from the memory. 

what is the best place to store the variable details? (local storage/cookie/custom object etc) 
Hi,

I need to render an existing component with attribute based on the output from an API call (callback).

FirstController.js 
init: function (component) { 
        
       component.set('v.oppId','25978371');
       component.set("v.userId", $A.get("$SObjectType.CurrentUser.Id"));
    
            var orgDetailsAction = component.get("c.getLocalAPI");
             
            orgDetailsAction.setCallback(this, function(data) {
                console.log(data.getReturnValue())
                data = JSON.parse(data.getReturnValue());
                
                if(!data.result){
                     
                   component.set('v.sidebar','disabled');
                   component.set("v.domainPopup", true);
                    console.log(component.get("v.domainPopup"))
               }
                else{
                    if(data.api1==null)
                       component.set('v.sidebar','disabled');
                    else
                    component.set('v.SFDCEndpoint',data.api1);
                }
                
                var action1 = component.get("c.getExternalAPI");
                
                
                action1.setCallback(this, function(data) {
                    var state = data.getState();
                    var role = JSON.parse(data.getReturnValue()).data;
                          component.set("v.userRole", role);
                            console.log(component.get('v.SFDCEndpoint'))
                             
                            $A.createComponent(component.get("v.sidebar")!='disabled' ?
                                               ((component.get("v.userRole")=='A1'||component.get("v.userRole")=='A2')
                                                ? "c:testOne":"c:testTwo")
                                               : "c:testThree",{
                                                   endpoint: component.get('v.SFDCEndpoint'),
                                               },
                                              function(newCmp,status, errorMessage){
                                                    
                                                   if(status === "SUCCESS"){
                                                       if (component.isValid()) {
                                                           component.set("v.currentContent", newCmp);
                                                       }}
                                                    
                                                       
                                               }
                                              );
                   
                });
                 
                $A.enqueueAction(action1); 
                 
            });
            $A.enqueueAction(orgDetailsAction);
                
         
    },

Based on action1 testOne.cmp gets created.

testOne.cmp
I have the endpoint attribute defined in component
 
<aura:handler name="init" value="{!this}" action="{!c.onLoad}"/> 
<aura:attribute name="endpoint" type="String"/>

testOneController.js:
onLoad : function(component, event, helper) {
         
        console.log(component.get('v.endpoint'));
}

testOne component gets rendered in 'currentContent' but the endpoint attribute is not getting passed in $A.createComponent.

Is there a way to use $A.createComponent inside an API callback?
Hi,

I'm calling a existing component using create component and trying to pass attribute for it.
oneController.js
var id='25978371';
        $A.createComponent(
            "c:InDetails",
            {
                oppId: id,
            },
            function(newCmp){
                    component.set("v.currentContent", newCmp);
            }
        );
InDetails.cmp
<aura:attribute name="oppId" type="String"/>
InDetailsController.js
console.log(component.get("v.oppId"))

Indeatails components gets created in component one but console.log of oppId gives me undefined. I couldn't pass the attribute from one component to another.  
 
Hi All,
 
I have developed a lightning application which requires adding of remote site settings dynamically via apex metadata service (Andrew Fawcett approach).
It throws following error to authorize my SOAP API. But it works fine in anonymous window. 
 
"IO Exception: Unauthorized endpoint, please check Setup->Security->Remote site settings. endpoint = https://xxxx.xxx.visual.force.com/services/Soap/m/44.0" 
 
Is there a way to do it without manually adding the SOAP API in remote site settings? 
 
Apex
@AuraEnabled 
    public static void getCreateRemoteSiteSetting()
    {
        MetadataService.MetadataPort service = createService();
        MetadataService.RemoteSiteSetting remoteSiteSettings = new MetadataService.RemoteSiteSetting();
        remoteSiteSettings.fullName = 'hello123';
        remoteSiteSettings.url = 'http://www.hello123.com';
        remoteSiteSettings.isActive=true;
        remoteSiteSettings.disableProtocolSecurity=false;
        system.debug(remoteSiteSettings);
        service.createMetadata(new List<MetadataService.Metadata> { remoteSiteSettings });
        
    }
    
    public static MetadataService.MetadataPort createService()
    {
        MetadataService.MetadataPort service = new MetadataService.MetadataPort();
        service.SessionHeader = new MetadataService.SessionHeader_element();
        service.SessionHeader.sessionId = UserInfo.getSessionId();
        return service;
    }

Component Controller:
function(component, event, helper){
        var remoteSite = component.get("c.getCreateRemoteSiteSetting");
        remoteSite.setCallback(this, function(data) {
            console.log(data);
        });
        $A.enqueueAction(remoteSite);
    }

 
Hi,

I have partner account with salesforce. My source code resides in development org, created using environment hub.
Now when I login into the 'sourcescanner' portal with my dev org where my code resides. It says "Org ID not attached to your Appexchange Publishing Console".

Am I doing something wrong?  
Hi,

I have a lightning app which uses cloud storage to provide data to the app via API.
First time when an user installs it, entire app is disabled and a pop up appears asking user to enter few configuration details which is required for the app. Once that details are provided, entire app becomes available. So next time when the user logs in he/she shouldn't be prompted to enter those configuration details. 

Which is the best place to store whether this configuration is provided by the user or not? Is there a way to store inside SFDC? or should I store in cloud storage and check that API every single time?  
I have a lightning app which has the remote site settings dynamic.
So, is it a good practice to use metadataService.class (http://technome2.blogspot.com/2017/05/creating-remote-site-settings.html) in post-installation script to add remote site settings for the org?
Hi,

Fields from Opportunity object like FiscalQuarter, FiscalYear were available when we created a developer account but while we were doing the incremental fetch of the data these column were not present in Opportunity object. We checked in UI “Opportunity Fields”, these column we couldn’t see and also did SOQL where we got the error saying field doesn’t exists.Any idea why is that so?
Hi,

I created a managed package which is calling lightning component from visualforce page. It shows internal server error on load of the managed package. But it works fine in classic account where I created the page.
<apex:page sidebar="false" showheader="false">
    <apex:includeLightning />   
    <div id="userContainer" style="height:100%"/>

    <script>
$Lightning.use("c:ClassicApp", function() {
    $Lightning.createComponent("c:FIRST",
 {
 
 },
 "userContainer",
 function(cmp) {
     });
});
</script>
    
    
</apex:page>
What might be the error?
 
Hi,

Is there a way to run algorithm in force.com? or should we use Heroku which resides in AWS?
I created a visualforce tab in admin. If I login as salesforce platform user, that tab is visible but onclick it shows, 
"An internal server error has occurred
Error ID: 529756903-133043 (-993347769)"
Hi,

I have create a application using lightning components. One component is to add user. Initially the app will be installed to the admin. Admin will use add user component to make the app available for other users in the org. How can I make it happen in lightning component?
So that when a user who has been added by admin, login into SFDC, my application should be available.
Hi,

I want to navigate from one page to another on a button click. It should work for both Lightning and classic.
button.cmp: lightning component
<lightning:button label="View Interview" value="{!row.oppId+'@'+indx}" iconPosition="left" disabled="{!row.interviewFlag}" onclick="{!c.displayInterview}"/>
buttonController.js: lightning controller
displayInterview : function (component, event, helper) {
       
    /*var urlEvent = $A.get("e.force:navigateToURL");
    urlEvent.setParams({
      "url": "/apex/home"
    });
    urlEvent.fire();*/
       
    var action = component.get("c.displayInterviewApex");
        action.setCallback(this, function(data) {
            	console.log(data.getReturnValue());
        });
}
Commented part works for lightning but not in classic.
ButtonController.apxc : Apex controller
public class ButtonController {
public static pagereference displayInterviewApex(){
      system.debug('called');
      Pagereference redirectedPage = New PageReference('/apex/home');  
      return redirectedPage;
   }
}
displayInterviewApex function is not called as its not aura enabled. If I add @AuraEnabled, pagereference is not supported. Is there a way to do for both classic and lightning?


 
Hi,

We have a side bar. On click of navigation link in side bar, it should navigate between 2 lightning components (which are already created). This should work for both classic and lightning. Is there a way to do it?
Hi,

I'm using chatter api (https://xx.salesforce.com/services/data/v42.0/chatter/feed-elements) to post in salesforce chatter. For authentication I'm using admin credentials, Is it possible to use salesforce chatter user credentials to post instead of admin.
 
How can external users use chatter endpoint url to post inside salesforce chatter?
We are fetching Salesforce data through Talend job. Before data leaves salesforce we want it to be masked. 
Is there any way we can call apex class whenever there is a SFDC data change and mask it before sending it through Talend?
Similarly unmask the masked data while consuming in the appplication. 
I'm trying to create different charts based on user selection. I tried implementing it in visual force using javascript innerhtml. Below is my visualforce segment which holds the checkbox, which on selection displays the chart in "thepanel" outputPanel.
<apex:outputPanel layout="block">
        <label for="checkbox">line chart</label>
        <input id="checkbox" type="checkbox"
            onclick="load_home(this,'{!$Component.thePanel}');"/>
</apex:outputPanel>
<apex:outputPanel id="thePanel" layout="block">
</apex:outputPanel>
Javascript function:
function load_home(input, textid){
               if(input.checked) {                   
                   document.getElementById(textid).innerHTML='<apex:chart height="400" width="700" data="{!Data}"><apex:axis type="Numeric" position="left" fields="data1" title="Opportunities Closed" grid="true"/><apex:axis type="Category" position="bottom" fields="name" title="Month of the Year"></apex:axis><apex:lineSeries axis="left" fill="true" xField="name" yField="data1" markerType="cross" markerSize="4" markerFill="#FF0000"/></apex:chart>;
               
          }
}
Apex code:
public List<Data> getData() {
        return FileUploader.getChartData();
    }
public static List<Data> getChartData() {
        List<Data> data = new List<Data>();
        data.add(new Data('Jan', 30, 90, 55));
        data.add(new Data('Feb', 44, 15, 65));
        data.add(new Data('Mar', 25, 32, 75));
        data.add(new Data('Apr', 74, 28, 85));
        data.add(new Data('May', 65, 51, 95));
        data.add(new Data('Jun', 33, 45, 99));
        data.add(new Data('Jul', 92, 82, 30));
        data.add(new Data('Aug', 87, 73, 45));
        data.add(new Data('Sep', 34, 65, 55));
        data.add(new Data('Oct', 78, 66, 56));
        data.add(new Data('Nov', 80, 67, 53));
        data.add(new Data('Dec', 17, 70, 70));
       
        return data;
    }
Function in the controller is called and the data list is returned but its not displaying in visualforce page.
Hi,
 
I have created a package with lightning component. Installation of the package in Partner Enterprise Edition shows the following issue "Your org doesn't have access to component cooper:companyInsightTeaserCard" but it works fine in developer edition. 
 
Can please guide me how to resolve this issue?
Hi,

I have a lightning app, which sets a variable during first time. From next time when the user users the app it should fetch from the memory. 

what is the best place to store the variable details? (local storage/cookie/custom object etc) 
Hi,

I'm calling a existing component using create component and trying to pass attribute for it.
oneController.js
var id='25978371';
        $A.createComponent(
            "c:InDetails",
            {
                oppId: id,
            },
            function(newCmp){
                    component.set("v.currentContent", newCmp);
            }
        );
InDetails.cmp
<aura:attribute name="oppId" type="String"/>
InDetailsController.js
console.log(component.get("v.oppId"))

Indeatails components gets created in component one but console.log of oppId gives me undefined. I couldn't pass the attribute from one component to another.  
 
Hi All,
 
I have developed a lightning application which requires adding of remote site settings dynamically via apex metadata service (Andrew Fawcett approach).
It throws following error to authorize my SOAP API. But it works fine in anonymous window. 
 
"IO Exception: Unauthorized endpoint, please check Setup->Security->Remote site settings. endpoint = https://xxxx.xxx.visual.force.com/services/Soap/m/44.0" 
 
Is there a way to do it without manually adding the SOAP API in remote site settings? 
 
Apex
@AuraEnabled 
    public static void getCreateRemoteSiteSetting()
    {
        MetadataService.MetadataPort service = createService();
        MetadataService.RemoteSiteSetting remoteSiteSettings = new MetadataService.RemoteSiteSetting();
        remoteSiteSettings.fullName = 'hello123';
        remoteSiteSettings.url = 'http://www.hello123.com';
        remoteSiteSettings.isActive=true;
        remoteSiteSettings.disableProtocolSecurity=false;
        system.debug(remoteSiteSettings);
        service.createMetadata(new List<MetadataService.Metadata> { remoteSiteSettings });
        
    }
    
    public static MetadataService.MetadataPort createService()
    {
        MetadataService.MetadataPort service = new MetadataService.MetadataPort();
        service.SessionHeader = new MetadataService.SessionHeader_element();
        service.SessionHeader.sessionId = UserInfo.getSessionId();
        return service;
    }

Component Controller:
function(component, event, helper){
        var remoteSite = component.get("c.getCreateRemoteSiteSetting");
        remoteSite.setCallback(this, function(data) {
            console.log(data);
        });
        $A.enqueueAction(remoteSite);
    }

 
Hi,

I have partner account with salesforce. My source code resides in development org, created using environment hub.
Now when I login into the 'sourcescanner' portal with my dev org where my code resides. It says "Org ID not attached to your Appexchange Publishing Console".

Am I doing something wrong?  
I have a lightning app which has the remote site settings dynamic.
So, is it a good practice to use metadataService.class (http://technome2.blogspot.com/2017/05/creating-remote-site-settings.html) in post-installation script to add remote site settings for the org?
How can external users use chatter endpoint url to post inside salesforce chatter?
I have developed a Salesforce classic app with vfp and  apex. Is it possible to make it available for mobile? 
Hi,

We are trying to develop a Lightning application. Following link tells Professional edition doesn't support Lightning component development. https://releasenotes.docs.salesforce.com/en-us/summer15/release-notes/rn_lightning.htm 

I created a 30 day trial version of Enterprise edition using the following link https://www.salesforce.com/in/editions-pricing/sales-cloud/ but in company details it say as 'Professional edition' yet I was able to create Lightning component but not apex class.

Both are contradicting. Please guide me. 
Hi,

We have professional edition of Salesforce. Is it possible to do lightning app development in it? On creation of developer sandbox I see apex class is disabled. 
Hi,

I have one basic doubt. I have developed a custom lightning app, which imports few lightning components. How to make that app available as a tab ?
With Preview I'm able to view the app.
UserDetails.app
<aura:application extends="force:slds">
	<c:UserDetails1 />
        <c:UserDetails2 />
        <c:UserDetails3 />
</aura:application>

 
Hi,
I'm trying to have dynamic dropdown list but I'm not sure how to communicate with controller. It shows error as "Invalid attribute "name": Source" in aura:attribute and aura:handler
UserDetails.cmp:
<aura:component implements="force:appHostable" >
    <lightning:layout class="slds-page-header slds-page-header--object-home">
        <lightning:layoutItem>
            <lightning:icon iconName="standard:scan_card" alternativeText="Add User"/>
        </lightning:layoutItem>
        <lightning:layoutItem padding="horizontal-small">
            <div class="page-section page-header">
                <h1 class="slds-text-heading--label">Add User</h1>
                <h2 class="slds-text-heading--medium">Add User</h2>
            </div>
        </lightning:layoutItem>
    </lightning:layout>
    <lightning:layout>
        <lightning:layoutItem padding="around-small" size="6">
        <div aria-labelledby="newexpenseform">
        <!-- BOXED AREA -->
        <fieldset class="slds-box slds-theme--default slds-container--small">
        <legend id="newexpenseform" class="slds-text-heading--small 
          slds-p-vertical--medium">
          Add User
        </legend>
        <form class="slds-form--stacked">
            <aura:attribute name="users" type="List" />
    		<aura:attribute name="selectedUser" type="String" />
            <aura:handler name="init" value="{!this}" action="{!c.loadOptions}" />
            <lightning:select name="mySelect1" label="Select Role:" aura:id="mySelect1" value="{!v.selectedValue}">
        		<aura:iteration items="{!v.options}" var="item">
            		<option text="{!item.label}" value="{!item.value}" selected="{!item.selected}"/>
         		</aura:iteration>
    		</lightning:select>
        </form>
  
      </fieldset>
    </div>
</lightning:layoutItem>
</lightning:layout>
</aura:component>

UserDetailsController.js:
({
    loadOptions: function (component, event, helper) {
        var roles = [
            { value: "Manager", label: "Manager" },
            { value: "team", label: "team" }
         ];
         component.set("v.options", roles);
        
        var users = [
            { value: "x", label: "x" },
            { value: "y", label: "y" },
            { Value: "z" , label: "z"}
         ];
         component.set("v.users", users);
    }
})