• Dinesh_Kumar_Nagarathinam
  • -2 Points
  • Member since 2017

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 2
  • 9
I have created a custom visualforce quick action in a lightning environment. The quick action randered the vf page in desktop but not in mobile, that too in sandbox Org only. When i tested the same vf quick action in my personal development org, it was working as expected in mobile.
Lightning Component Framework Specialist Superbadge Step 6 Issue
Lightning Specialist Superbadge Issue
creating a record in a custom object using the form approach in lightning component, but it is returning a null id.
following is the code of component:-
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId"
                access="global" controller="createUserRecord">
    <aura:attribute name="newUser" type="User_Request__c" default="{'sobjectType':'User_Request__c',
                                                                   'Last_Name__c    ':'',
                                                                   'Manager__c':'false' ,
                                                                   'Deactivation_Date__c':''}"  />

        <fieldset class="myBoxArea">
    <lightning:layout verticalAlign="end">
        <lightning:layoutItem >
            <div class="blue">                 
                envision CRM and Commercial Application Access Request ALCON 
            <div class="white">
        <div class="slds-align_absolute-center slds-box lightblue" style="height: 5rem;">
        <lightning:layout class="slds-box">
            <lightning:layoutItem size="6" class="left-align">
                <div >
                    <form class="slds-form slds-form_horizontal">          
                        <lightning:input aura:id="itemform" label="First Name"
                                         type="input text"
                        <lightning:input aura:id="itemform" label="Username"
                                         type="input text"
                        <lightning:input aura:id="itemform" label="Manager's Email"
                        <lightning:input aura:id="itemform" label="Copy profile from"
                                         type="input text"
                        <lightning:input aura:id="itemform" label="Access End Date"
                        <lightning:input type="toggle" label="Manager"
            <lightning:layoutItem size="6" class="right-align">
                <div >
                    <form class="slds-form slds-form_horizontal">          
                        <lightning:input aura:id="itemform" label="Last Name"
                                         type="input text"
                        <lightning:input aura:id="itemform" label="Email Address"
                        <lightning:input aura:id="itemform" label="User 5-2-1"
                                         type="input text"
                        <lightning:input aura:id="itemform" label="Company/Mobile Phone #"
                                         type="input text"
                        <lightning:input aura:id="itemform" label="Requestor 5-2-1"
                                         type="input text"
                        <lightning:input aura:id="itemform" label="Country"
                                         type="input text"
            <lightning:layoutItem class="slds-align_absolute-center">        
                        <lightning:button label="Send for approval" 
apex class is:-
public class createUserRecord {
    public static id createUserRecordNew(User_Request__c UR){
     upsert UR;
    return UR.id;
}    }
controller i am using is:-
 save : function(component, event, helper) {     
     var action = component.get("c.createUserRecordNew");
            var userId = result.getReturnValue();
app for execution:-
<aura:application extends="force:slds">
I have created a custom visualforce quick action in a lightning environment. The quick action randered the vf page in desktop but not in mobile, that too in sandbox Org only. When i tested the same vf quick action in my personal development org, it was working as expected in mobile.
VF Page
<apex:page standardController="Account" cache="true" extensions="BussinessController" sidebar="false" showHeader="false">
    <title>Trade History - {!Account.Name}</title>
<apex:pageMessages />

        function setFocusOnLoad() {} 
    <apex:form id="th_form">
    <td width="230px">
    <apex:selectRadio value="{!report}" style="font-weight: bold;">
        <apex:selectOptions value="{!reporttypes}"/>
    <td width="250px">
    <apex:OutputLabel value="Start Date" for="c_startDate" />
    <apex:inputField id="c_startDate" value="{!Start.ActivityDate}" />
    <td width="250px">
    <apex:OutputLabel value="End Date" for="c_endDate" />
    <apex:inputField id="c_endDate" value="{!End.ActivityDate}" />
    <apex:commandButton action="{!th_loaddata}" value="Retrieve Data"  status="thtab_status"/>

    <apex:outputPanel id="th_out">
    <apex:actionstatus id="thtab_status" startText="Requesting...">
    <apex:facet name="stop">
        <apex:outputPanel >
            <apex:outputText value="{!ErrorMessage}" style="font-style:italic; font-weight: bold; font-size: 12px;color: #AF0B1C;"/>            

<apex:iframe src="https://cognos-prod" />


Apex Class:

public with sharing class BUssinessController {
    private Account acct;
    private String report = '1';
    private Task edit_task1=null;
    private Task edit_task2=null;
    private String s_StartDate = null;
    private String s_EndDate = null;
    private String s_ErrorMessage = '';
    private Boolean bshow_thMashup = true;
    private String userId = '';
    private Spotfire sptfire = new Spotfire();
    public String FICClientID
        get { return sptfire.ficClientID;}
    public Task getStart()
        return edit_task1;
    public Task getEnd()
        return edit_task2;
    public String getStartDate()
        if(edit_task1 == null || edit_task1.ActivityDate==null ) return '';
        else return s_StartDate;
    public String getEndDate()
        if(edit_task2 == null || edit_task2.ActivityDate==null) return '';
        else return s_EndDate;        
    public String getErrorMessage()
        return s_ErrorMessage;
    public Boolean show_thMashup
        get{return bshow_thMashup;}
    public PageReference th_loaddata() {
        if(report == '1')
            edit_task1.ActivityDate = null;
            edit_task2.ActivityDate = null; 
            System.debug('report by date range!!! ' + edit_task1.ActivityDate + ', '+ edit_task2.ActivityDate);
            if(edit_task1.ActivityDate == null || edit_task2.ActivityDate==null)
                s_ErrorMessage = 'WARNING! Please enter a date range before retrieving data.';
            else if(edit_task1.ActivityDate > edit_task2.ActivityDate )
                System.debug('ERRROR 2 is set');
                s_ErrorMessage = 'WARNING! The end date must occur after the selected start date.';
                System.debug('NO ERROR for radio2!!');
                Date ds = edit_task1.ActivityDate; 
                String s_year = String.valueOf(ds.year());
                String s_month = String.valueOf(ds.month());
                if(s_month.length()<2) s_month = '0' + s_month;
                String s_day = String.valueOf(ds.day());
                if(s_day.length()<2) s_day = '0' + s_day;
                s_StartDate = s_year+s_month+s_day;
                Date de = edit_task2.ActivityDate; 
                String e_year = String.valueOf(de.year());
                String e_month = String.valueOf(de.month());
                if(e_month.length()<2) e_month = '0' + e_month;
                String e_day = String.valueOf(de.day());
                if(e_day.length()<2) e_day = '0' + e_day;
                s_EndDate = e_year+e_month+e_day;           
        return null;
    public List<SelectOption> getreporttypes() {
        List<SelectOption> options = new List<SelectOption>();
        options.add(new SelectOption('1','Last 20 Deals'));
        options.add(new SelectOption('2','By Date Range:'));
        return options;
    public String getreport() {
        return report;
    public void setreport(String r) 
        this.report = r; 
    public string Url {   
     get     { return GeneralSettings.getValue(GeneralSettings.SpotfireURL);  
    // Constructor
    public BUssinessController(ApexPages.StandardController stdController)
        Apexpages.currentPage().getHeaders().put('X-UA-Compatible', 'IE=10');        
        this.acct= (Account)stdController.getRecord();
        userId = UserInfo.getUserId();   
        // Initialize tasks        
        edit_task1= new Task();
        edit_task1.OwnerId = userId; 
        edit_task1.Priority = 'Normal';
        edit_task1.ActivityDate = System.TODAY();
        edit_task2= new Task();
        edit_task2.OwnerId = userId; 
        edit_task2.Priority = 'Normal';
        edit_task2.ActivityDate = System.TODAY();

I have a lightning datatable which is having various no. of columns.
Problem is that User has to scroll to right end to find the vertical scrollbar, I want the vertical scroller to be on the screen always so that whenver user wants to scroll down he can do it through scroller.
Please suggest any ideas how to achieve this.
DatatableDatatable vertical scroller
I am implementing lightning:tabset and lightning:tab to display tabs in a lightning component. I have 2 tabs inside the tabset. I am trying to display error when user tries to fill tab 2 first by leaving tab 1 fields empty. Does anyone have any insight into how
 to achieve this functionality?
I am using lightning:treegrid to display hierarchy of accounts.
When I select a child from the hierarchy and then collapse its parent and expand again - the selection is gone.

This is also reproducible in the lightning component library

Expand/Collapse should not affect any selection.

When I am trying to convert a array of task into JSON string in my lightning controller, only the 1st element is returned always even though the array has more values. Here is the code. Has anyone faced the same issue.

<aura:attribute type="Task[]" name="listTask" />

var taskList = component.get("v.listTask"); //tried var taskList = component.get("v.listTask").slice(); as well
console.log(taskList.length); //Length is returned correctly e.g. 3

//converting the array into JSON string
var JSONStr = JSON.stringify(taskList); 
console.log(JSONStr); // [{"sobjectType":"Task","ActivityDate":"2016-3-3","Status":"In Progress","Subject":"task1"},[],[]]

I'm having issues communicating to a nested component. I would like a component to be able to run a method in the nested-component's controller.js (or helper). I have tried both events and via and no luck. Here is the example markup:
<!-- myEvent.evt --> 
<aura:event type="APPLICATION"> 

<!-- super-component --> 
    <aura:registerEvent name="myEventName" type="c:myEvent"/> 
    <c:my_Nested_Component /> 
    <ui:button press="{!fireEvent}" 

    fireEvent: function(component){ 
        var myEvent = component.getEvent("myEventName"); 
        console.log('event fired'); 


<!-- nested-component --> 
    <aura:handler name="myEventName" event="c:c:myEvent" action="{!c.gotEvent}" /> 

    gotEvent: function(component, event){ 
        console.log('received event!'); 

This does not work. I tried the same exact code that I placed on the nested-component on a super-super-component, and it worked perfectly.The super-super component received the event. But the nested component is not able to. I figured this had to do with events only bubbling up (though the documentation does say that that is only the case with Component events, not application events).

So the other option I read online is using . I tried doing this, but this too did not work for speaking to a nested component.

How can a parent component cause a method on the nested component to fire?

Thank you
Hello everyone!
I have an issue with lightning:container. It throws "Failed to load resource: the server responded with a status of 403 (Forbidden)" error upon loading and refuses to load.
I address the resource in the code like so: 
<lightning:container src="{!$Resource.namespace__resourceName + '/index.html'}"/>
The issue seem to reproduce mostly when I'm logged under a user with reduced permissions. However, the issue reproduces when I'm logged under a user with System Administrator profile as well.
Any help would be greatly appreciated!