• Greg Finzer
  • NEWBIE
  • 113 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 5
    Likes Given
  • 17
    Questions
  • 17
    Replies
I have over 2000 checkboxes in my lightning component and the componet loads within 6 seconds.  However when saving Salesforce Lightning crawls and takes a minute on my machine to save and for our QA Tester it is taking over two minutes to save.  The back end is only taking 300 milliseconds.

Here is the log for the front end:
JSON.stringify: 257.11669921875ms
FRCElementMatrixComponent.js:246 JSON.parse: 26.737060546875ms
FRCElementMatrixComponent.js:261 filter: 4.0048828125ms
FRCElementMatrixComponent.js:278 clear v.elements: 4213.22509765625ms
FRCElementMatrixComponent.js:287 saveAction: 32226.1650390625ms
FRCElementMatrixComponent.js:331 loadElementMatrixData: 12743.0830078125ms

 
var saveAction = component.get("c.saveElements"); 

console.time('JSON.stringify');
var allJson = JSON.stringify(component.get("v.elements"));
console.timeEnd('JSON.stringify'); 

console.time('JSON.parse');
var allObj = JSON.parse(allJson);
console.timeEnd('JSON.parse');

//Only save elements that are enabled and that have changed
function checkElement(element) {
	if (element.checkboxDisabled)
		return false;
	if (element.IsGroupRow)
		return false;
	
	return element.Renovated != element.RenovatedOriginal;
}

console.time('filter');
var onlyEnabledObj = allObj.filter(checkElement);
var onlyEnabledJson = JSON.stringify(onlyEnabledObj);
console.timeEnd('filter');                
		
//Clear everything because it results in less save time
allJson = null;
allObj = null;        

console.time('clear v.elements');
component.set("v.elements", []); 
console.timeEnd('clear v.elements');

saveAction.setParams({
	accountId : component.get("v.recordId"),
	elementsJson : onlyEnabledJson
});

saveAction.setCallback(this, function(a) {
	if (a.getState() === "SUCCESS") {
		console.timeEnd('saveAction');
		//We have to load after we save to re-calculate everything
		var loadAfterSaveAction = component.get('c.doLoadAfterSave');
		$A.enqueueAction(loadAfterSaveAction);
	} else if (a.getState() === "ERROR") {
		$A.log("Errors", a.getError());
	}
});

console.time('saveAction');
$A.enqueueAction(saveAction);



 
I have a lightning application with a Reports Tab.  I created two reports and I would like to have them show in the Reports Tab dropdown for all users.  How do I do this?

I also have a Dashboards Tab.  I created a dashboard and I would like it to show in the Dashboards Tab dropdown for all users.
My lightning component has over 1000 checkboxes.  Salesforce is extremely slow when clicking or unclicking a checkbox (around 20 seconds).  Here is my checkbox defininition:
 
<ui:inputCheckbox aura:id="elementCheckbox" name="{!element.GroupId}" value="{!element.Renovated}" click="{!c.handleCheckboxClick}" />

The custom code in the handleCheckboxClick event returns immediately (milliseconds) but there is something else happening in Salesforce that is taking all of the 20 seconds.  

Is there something I can do to speed up performance?

Can I bind to a regular HTML checkbox in lightning with the same click event?
I have a standard report in Salesforce that has a bar chart on it.  When I export it to excel it just has the detail and not the bar chart.  How do I include the bar chart?
I have an existing Salesforce custom object that I need to add 200 custom fields to.  The list of Field Label and Field Names are in a CSV file.  Is it possible to import and create the custom fields?  They will all be date fields.  I am a .NET developer.  I have not been able to find anything how to dynamically add a custom field to an object using the tooling API with C#.
I have this lightning checkbox.  How do I get the auraid of the checkbox that was clicked?
 
<ui:inputCheckbox aura:id="{!element.GroupId}" value="{!element.Renovated}" click="{!c.handleCheckboxClick}" />

Here is the corresponding controller method:
 
handleCheckboxClick : function(component, event, helper) {

}


 
I have an icon associated with a custom object, it is the Handsaw icon.  How do I show this icon in my lightning component?

Do I have to hard code the icon as custom70?
https://www.lightningdesignsystem.com/icons/
 
I have created an Add/Edit modal popup that is working well.  I have a couple required validations and also a couple custom validation rules.  How do I get the validation errors and display them?

Here is my component:
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId" access="global" controller="FRCAddRenoPopupController">
    <aura:attribute name="accountId" type="Id"/>
	<aura:attribute name="PageHeading" type="String" default="Add Renovation" />
    
    <aura:attribute name="reno" type="FRC_Renovation__c" default="{'sobjectType' : 'FRC_Renovation__c',
                                                                  'Id' : '',
                                                                  'Name' : '',
                                                                  'Property__c' : '',
                                                                  'Renovation_Start_Date__c' : '',
                                                                  'Renovation_End_Date__c' : '',
                                                                  'Renovation_Notes__c' : '',
                                                                  'Scope_Confirmed__c' : false }"/>    
       
    <lightning:button label="Add Renovation"
                      iconName="utility:new_window"
                      iconPosition="left"
                      variant="brand"
                      onclick="{!c.newPopup}"
                      />   
    
    <aura:method name="editPopupMethod" action="{!c.editPopup}" access="public">
      <aura:attribute name="columnIdentifier" type="String" />
    </aura:method>
    
    <div role="dialog" tabindex="-1" aria-labelledby="header43" aura:id="renoAddModal" class="slds-modal slds-modal_large">
        <div class="slds-modal__container" style="width: 65%;">
            <div class="slds-modal__header" style="font-size: 1.5em">
                {!v.PageHeading}             
            </div>
            
            <div class="slds-modal__content slds-p-around--medium">
                <div class="slds-p-left_xx-large slds-p-right_xx-large" style="padding-left:0px">
                    <div class="slds-page-header" style="padding-top: 9px; padding-bottom: 9px;padding-right: 9px;">
                        <h3 style="font-size: 1rem;" title="">Renovation Information</h3>
                    </div> 
                </div>    
                <div class="slds-grid slds-p-top_medium">
                    <div class="slds-size_11-of-12 slds-p-left_xx-large slds-p-horizontal_x-large " >
                        <lightning:input label="Renovation Name" required="true" name="renovationName" value="{!v.reno.Name}"/> 
                    </div>
                </div>
                <div class="slds-grid slds-p-top_x-small">
                    <div class="slds-size_6-of-12 slds-p-left_xx-large slds-p-horizontal_x-large " >
                        <ui:inputDate label="Renovation Start Date" aura:id="renovationStartDate" required="true" value="{!v.reno.Renovation_Start_Date__c}" displayDatePicker="true" format="MM/dd/yyyy"/>
                    </div>
                    <div class="slds-size_5-of-12 slds-p-left_xx-small slds-p-horizontal_x-large " >
                        <ui:inputDate label="Renovation End Date" aura:id="renovationEndDate" value="{!v.reno.Renovation_End_Date__c}" displayDatePicker="true" format="MM/dd/yyyy"/>                        
                    </div>
                </div>
                <div aura:id="scopeConfirmedDiv" class="slds-grid slds-p-top_medium">
                    <div class="slds-size_11-of-12 slds-p-left_xx-large slds-p-horizontal_x-large " >
                        <lightning:input label="Scope Confirmed" type="checkbox" name="scopeConfirmed" checked="{!v.reno.Scope_Confirmed__c}"/> 
                    </div>
                </div>                 
                <div class="slds-grid slds-p-top_medium">
                    <div class="slds-size_11-of-12 slds-p-left_xx-large slds-p-horizontal_x-large " >
                        Renovation Notes<br />
                        <lightning:inputRichText label="Renovation Notes" value="{!v.reno.Renovation_Notes__c}" />
                    </div>
                </div>                
            </div>
            <div class="slds-modal__footer">
                <lightning:button label="Save" onclick="{!c.saveModal}" />
                <lightning:button label="Cancel" onclick="{!c.closeNewModal}" />
            </div>
        </div>
    </div>   
    <div aura:id="Modalbackdrop" class="slds-backdrop"></div>
</aura:component>

Here is my controller:
({
    editPopup : function(component, event, helper)
    {
        var args = event.getParam("arguments");
        var columnIdentifier = args.columnIdentifier;
                
        var action = component.get("c.loadReno");
        action.setParams({renoID  : columnIdentifier});
        
        action.setCallback(this, function(response) {
            var state = response.getState();          
            if (state === "SUCCESS") {
				component.set("v.PageHeading", "Edit Renovation");
                var record = response.getReturnValue();
                component.set("v.reno.Id", record.Id);
                component.set("v.reno.Name", record.Name);
                component.set("v.reno.Property__c", record.Property__c);
                component.set("v.reno.Renovation_Start_Date__c", record.Renovation_Start_Date__c);
                component.set("v.reno.Renovation_End_Date__c", record.Renovation_End_Date__c);
                component.set("v.reno.Renovation_Notes__c", record.Renovation_Notes__c);
                component.set("v.reno.Scope_Confirmed__c", record.Scope_Confirmed__c);

                helper.applyShowFormStyles(component);
            }
            else if (state === "ERROR") {
                var errors = response.getError();
                if (errors) {
                    if (errors[0] && errors[0].message) {
                        console.log("Error message: " + 
                                    errors[0].message);
                    }
                } 
                else {
                    console.log(response.getReturnValue());
                }
            }
        });
        $A.enqueueAction(action);
        
      
    },
    newPopup : function(component, event, helper)
    {
        //Initialize Fields
        component.set("v.PageHeading", "Add Renovation");
        component.set("v.reno.Id", "");
        component.set("v.reno.Name", "");
        component.set("v.reno.Property__c", "");
        component.set("v.reno.Renovation_Start_Date__c", "");
        component.set("v.reno.Renovation_End_Date__c", "");
        component.set("v.reno.Renovation_Notes__c", "");
        component.set("v.reno.Scope_Confirmed__c", false);
        
        helper.applyShowFormStyles(component);
        
        //Hide the scope confirmed checkbox when adding a renovation
        var cmpScopeConfirmed = component.find('scopeConfirmedDiv');
        $A.util.addClass(cmpScopeConfirmed, 'slds-hide');
    },
	closeNewModal : function(component, event, helper)
    {
        helper.applyHideFormStyles(component);
    },
    saveModal : function(component, event, helper){
        var renoAttr = component.get("v.reno");        
        var accountIdAttr = component.get("v.accountId");
        console.log(renoAttr.Id);
        
        if (renoAttr.Id == '')
        {
            helper.insertReno(component, helper, renoAttr, accountIdAttr);
        }
        else
        {
            helper.updateReno(component, helper, renoAttr);
        }		
    },
})

Here is my helper:
({
	applyHideFormStyles : function(component) {
		var cmpTarget = component.find('renoAddModal');
        $A.util.removeClass(cmpTarget, 'slds-fade-in-open');

        var cmpBack = component.find('Modalbackdrop');
        $A.util.removeClass(cmpBack,'slds-backdrop_open');        
                        
        var cmpScopeConfirmed = component.find('scopeConfirmedDiv');
        $A.util.removeClass(cmpScopeConfirmed, 'slds-hide');
	},
	applyShowFormStyles : function(component) {
        var cmpTarget = component.find('renoAddModal');
        $A.util.addClass(cmpTarget, 'slds-fade-in-open');

        var cmpBack = component.find('Modalbackdrop');
        $A.util.addClass(cmpBack, 'slds-backdrop_open');
	},
	insertReno : function(component, helper, renoAttr, accountIdAttr) {
        var action = component.get("c.insertReno");
        action.setParams({reno  : renoAttr, accountId  : accountIdAttr});
        action.setCallback(this, function(response) {
            var state = response.getState();          
            if (state === "SUCCESS") {
                $A.get('e.force:refreshView').fire();
                helper.applyHideFormStyles(component);               
            }
            else if (state === "ERROR") {
                var errors = response.getError();
                if (errors) {
                    if (errors[0] && errors[0].message) {
                        console.log("Error message: " + 
                                    errors[0].message);
                    }
                } 
                else {
                    console.log(response.getReturnValue());
                }
            }
        });
        $A.enqueueAction(action);
	},
	updateReno : function(component, helper, renoAttr) {
        var action = component.get("c.updateReno");
        action.setParams({reno  : renoAttr});
        action.setCallback(this, function(response) {
            var state = response.getState();          
            if (state === "SUCCESS") {
                $A.get('e.force:refreshView').fire();
                helper.applyHideFormStyles(component);               
            }
            else if (state === "ERROR") {
                var errors = response.getError();
                if (errors) {
                    if (errors[0] && errors[0].message) {
                        console.log("Error message: " + 
                                    errors[0].message);
                    }
                } 
                else {
                    console.log(response.getReturnValue());
                }
            }
        });
        $A.enqueueAction(action);
	}      
})



 
I am implementing a popup and it is working well but I need to have a backdrop like other lightning modals.  What am I missing?
 
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId" access="global" controller="FRCAddRenoPopupController">
    <aura:attribute name="accountId" type="Id"/>
    <aura:attribute name="PageHeading" type="String" default="Add Renovation" />
    
    <aura:attribute name="reno" type="FRC_Renovation__c" default="{'sobjectType' : 'FRC_Renovation__c',
                                                                  'Name' : '',
                                                                  'Renovation_Start_Date__c' : '',
                                                                  'Renovation_End_Date__c' : ''}"/>    
       
    <lightning:button label="Add Renovation"
                      iconName="utility:new_window"
                      iconPosition="left"
                      variant="brand"
                      onclick="{!c.newPopup}"
                      />   
    
    <div role="dialog" tabindex="-1" aria-labelledby="header43" aura:id="renoAddModal" class="slds-modal slds-modal_large">
        <div class="slds-modal__container" style="width: 65%;">
            <div class="slds-modal__header" style="font-size: 1.5em">
                Add Renovation             
            </div>
            
            <div class="slds-modal__content slds-p-around--medium">
                <div class="slds-p-left_xx-large slds-p-right_xx-large" style="padding-left:0px">
                    <div class="slds-page-header" style="padding-top: 9px; padding-bottom: 9px;padding-right: 9px;">
                        <h3 style="font-size: 1rem;" title="">Renovation Information</h3>
                    </div> 
                </div>    
                <div class="slds-grid slds-p-top_medium">
                    <div class="slds-size_11-of-12 slds-p-left_xx-large slds-p-horizontal_x-large " >
                        <lightning:input label="Renovation Name" required="true" name="renovationName" value="{!v.reno.Name}"/> 
                    </div>
                </div>
                <div class="slds-grid slds-p-top_x-small">
                    <div class="slds-size_6-of-12 slds-p-left_xx-large slds-p-horizontal_x-large " >
                        <ui:inputDate aura:id="renovationStartDate" required="true" value="{!v.reno.Renovation_Start_Date__c}" displayDatePicker="true" format="MM/dd/yyyy"/>
                    </div>
                    <div class="slds-size_5-of-12 slds-p-left_xx-small slds-p-horizontal_x-large " >
                        <ui:inputDate aura:id="renovationEndDate" value="{!v.reno.Renovation_End_Date__c}" displayDatePicker="true" format="MM/dd/yyyy"/>                        
                    </div>
                </div>
            </div>
            <div class="slds-modal__footer">
                <lightning:button label="Save" onclick="{!c.saveModal}" />
                <lightning:button label="Cancel" onclick="{!c.closeNewModal}" />
            </div>
        </div>
    </div>    
</aura:component>

​​​​​​​
I have a flat set of data that I need to turn into a pivot table in a lightning component.

Initially I tried this:

        <aura:iteration var="element" items="{!v.elements}">
            <!-- Begin Table Row -->
            <aura:If isTrue="{!element.StartElement}">
                <aura:unescapedHtml value="<tr>" />
            </aura:If>  

I am presented with this error:
            Failed to save FRCElementMatrixComponent.cmp: c:FRCElementMatrixComponent:57,44: ParseError at [row,col]:[58,44] Message: The value of attribute "value" associated with an element type "aura:unescapedHtml" must not contain the '<' character.: Source

So I tried to set an attribute called beginTR and set the value in JavaScript:
            <aura:If isTrue="{!element.StartElement}">
                <aura:unescapedHtml value="{!v.beginTR}" />
            </aura:If> 

This does not work as it cleans out the <tr> before it is output.  

Is there any way I can output straight HTML in lightning?  If not is there any other way to it in Salesforce?  Visual Force, React, etc.
 
I just started using lightning today.  Sorry for the simple question.  I am creating a lightning component where I need to display some fields from the Account on the lightning page and then pass the Account.Id to a controller to get some calculated data.

<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId" access="global" >

What goes here?

<span>{!v.Name}</span>
</aura:component>
I have a custom object called Renovation and a child object called Renovation Element. I want to create a ListView on the Renovation Lightning Page with inline editing enabled that has a list of the Renovation Elements. The Renovation Element custom object is not available to be chosen in the Object Drop Down List when creating the list view. Why is that? How do I create a New List View of Renovation Elements that are related to the Renovation? FYI, I have Inline Editing enabled and also enhanced lists enabled in the org.
I am getting an error when trying to do a sfdx retrieve:
ERROR:  Cannot read property 'fileName' of undefined.

Here is the command that is being issued in VS Code when I click on the package.xml file and retrive source from org:
sfdx force:source:retrieve --manifest c:\_hilton\BossReno\manifest\package.xml

The development environment is Salesforce Spring 2019
Here is my version of sfdx:
sfdx-cli/6.53.0-67a9cbb60c (windows-x64) node-v8.9.4


This package.xml file was generated by VS Code extension.  Here it is:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>*</members>
<name>ApexClass</name>
</types>
<types>
<members>*</members>
<name>ApexComponent</name>
</types>
<types>
<members>*</members>
<name>ApexPage</name>
</types>
<types>
<members>*</members>
<name>ApexTestSuite</name>
</types>
<types>
<members>*</members>
<name>ApexTrigger</name>
</types>
<types>
<members>*</members>
<name>AuraDefinitionBundle</name>
</types>
<types>
<members>*</members>
<name>StaticResource</name>
</types>
<version>45.0</version>
</Package>
We have a business requirement to periodically download an XML file that was generated by Peoplesoft via SFTP and storing it in Salesforce.  We will have apex code to parse the file and update several custom objects based on business rules.  This is not a simple mapping of the XML file.  This is not a one time operation but a daily operation.  I have looked at all the marketplace for SFTP.  
https://appexchange.salesforce.com/appxSearchKeywordResults?keywords=sftp&searchType=simpleSearch

It seems there are only two varieties:
1.  Download a file and update an object using a mapping
2.  After creating an attachment in Salesforce, upload it to an SFTP server

Is there any App that will simply download the file with SFTP and store it somewhere without using a mapping?
There is a command in VS Code called SFDX: Push Source to Default Scratch Org.

What is the command to merge the code from the Scratch Org to the Real Org using VS Code or the SFDX cli?

Or is there some way you do it in Salesforce UI?
What is the call limit and data limit for an external rest API?  I am planning to write an APEX batch job what will be scheduled to run hourly.  This batch job will call an external Rest API up to 300 times and retrieve 4500 records which will be inserted as Big Objects.  Is this possible with Salesforce?
I have a client that needs to use big objects.  I have unsuccesfully been able to define a big object in my Trailhead org playground.  Has anyone else been able to define a big object yet?  

I tried uploading a zip file via workbench for this trailhead.  All I did was copy and paste the xml into files and zip it up.  I verified the directory structure in the zip file:
https://trailhead.salesforce.com/content/learn/modules/big_objects/big_objects_define_custom_big_objects

It gives this error which I created a support ticket for:
Exception 2015936646-114094 (-407009801)

I also tried using the Custom Big Object Creator by Salesforce
http://www.sfdc.co/BigObjectCreator

I followed these instructions
https://quip.com/qPbzAFtGDQe3

After clicking the Deploy button instead of giving a grey bar in the instructions it does nothing.  No Big Object is created.
I have a lightning application with a Reports Tab.  I created two reports and I would like to have them show in the Reports Tab dropdown for all users.  How do I do this?

I also have a Dashboards Tab.  I created a dashboard and I would like it to show in the Dashboards Tab dropdown for all users.
I have this lightning checkbox.  How do I get the auraid of the checkbox that was clicked?
 
<ui:inputCheckbox aura:id="{!element.GroupId}" value="{!element.Renovated}" click="{!c.handleCheckboxClick}" />

Here is the corresponding controller method:
 
handleCheckboxClick : function(component, event, helper) {

}


 
I have an icon associated with a custom object, it is the Handsaw icon.  How do I show this icon in my lightning component?

Do I have to hard code the icon as custom70?
https://www.lightningdesignsystem.com/icons/
 
I have created an Add/Edit modal popup that is working well.  I have a couple required validations and also a couple custom validation rules.  How do I get the validation errors and display them?

Here is my component:
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId" access="global" controller="FRCAddRenoPopupController">
    <aura:attribute name="accountId" type="Id"/>
	<aura:attribute name="PageHeading" type="String" default="Add Renovation" />
    
    <aura:attribute name="reno" type="FRC_Renovation__c" default="{'sobjectType' : 'FRC_Renovation__c',
                                                                  'Id' : '',
                                                                  'Name' : '',
                                                                  'Property__c' : '',
                                                                  'Renovation_Start_Date__c' : '',
                                                                  'Renovation_End_Date__c' : '',
                                                                  'Renovation_Notes__c' : '',
                                                                  'Scope_Confirmed__c' : false }"/>    
       
    <lightning:button label="Add Renovation"
                      iconName="utility:new_window"
                      iconPosition="left"
                      variant="brand"
                      onclick="{!c.newPopup}"
                      />   
    
    <aura:method name="editPopupMethod" action="{!c.editPopup}" access="public">
      <aura:attribute name="columnIdentifier" type="String" />
    </aura:method>
    
    <div role="dialog" tabindex="-1" aria-labelledby="header43" aura:id="renoAddModal" class="slds-modal slds-modal_large">
        <div class="slds-modal__container" style="width: 65%;">
            <div class="slds-modal__header" style="font-size: 1.5em">
                {!v.PageHeading}             
            </div>
            
            <div class="slds-modal__content slds-p-around--medium">
                <div class="slds-p-left_xx-large slds-p-right_xx-large" style="padding-left:0px">
                    <div class="slds-page-header" style="padding-top: 9px; padding-bottom: 9px;padding-right: 9px;">
                        <h3 style="font-size: 1rem;" title="">Renovation Information</h3>
                    </div> 
                </div>    
                <div class="slds-grid slds-p-top_medium">
                    <div class="slds-size_11-of-12 slds-p-left_xx-large slds-p-horizontal_x-large " >
                        <lightning:input label="Renovation Name" required="true" name="renovationName" value="{!v.reno.Name}"/> 
                    </div>
                </div>
                <div class="slds-grid slds-p-top_x-small">
                    <div class="slds-size_6-of-12 slds-p-left_xx-large slds-p-horizontal_x-large " >
                        <ui:inputDate label="Renovation Start Date" aura:id="renovationStartDate" required="true" value="{!v.reno.Renovation_Start_Date__c}" displayDatePicker="true" format="MM/dd/yyyy"/>
                    </div>
                    <div class="slds-size_5-of-12 slds-p-left_xx-small slds-p-horizontal_x-large " >
                        <ui:inputDate label="Renovation End Date" aura:id="renovationEndDate" value="{!v.reno.Renovation_End_Date__c}" displayDatePicker="true" format="MM/dd/yyyy"/>                        
                    </div>
                </div>
                <div aura:id="scopeConfirmedDiv" class="slds-grid slds-p-top_medium">
                    <div class="slds-size_11-of-12 slds-p-left_xx-large slds-p-horizontal_x-large " >
                        <lightning:input label="Scope Confirmed" type="checkbox" name="scopeConfirmed" checked="{!v.reno.Scope_Confirmed__c}"/> 
                    </div>
                </div>                 
                <div class="slds-grid slds-p-top_medium">
                    <div class="slds-size_11-of-12 slds-p-left_xx-large slds-p-horizontal_x-large " >
                        Renovation Notes<br />
                        <lightning:inputRichText label="Renovation Notes" value="{!v.reno.Renovation_Notes__c}" />
                    </div>
                </div>                
            </div>
            <div class="slds-modal__footer">
                <lightning:button label="Save" onclick="{!c.saveModal}" />
                <lightning:button label="Cancel" onclick="{!c.closeNewModal}" />
            </div>
        </div>
    </div>   
    <div aura:id="Modalbackdrop" class="slds-backdrop"></div>
</aura:component>

Here is my controller:
({
    editPopup : function(component, event, helper)
    {
        var args = event.getParam("arguments");
        var columnIdentifier = args.columnIdentifier;
                
        var action = component.get("c.loadReno");
        action.setParams({renoID  : columnIdentifier});
        
        action.setCallback(this, function(response) {
            var state = response.getState();          
            if (state === "SUCCESS") {
				component.set("v.PageHeading", "Edit Renovation");
                var record = response.getReturnValue();
                component.set("v.reno.Id", record.Id);
                component.set("v.reno.Name", record.Name);
                component.set("v.reno.Property__c", record.Property__c);
                component.set("v.reno.Renovation_Start_Date__c", record.Renovation_Start_Date__c);
                component.set("v.reno.Renovation_End_Date__c", record.Renovation_End_Date__c);
                component.set("v.reno.Renovation_Notes__c", record.Renovation_Notes__c);
                component.set("v.reno.Scope_Confirmed__c", record.Scope_Confirmed__c);

                helper.applyShowFormStyles(component);
            }
            else if (state === "ERROR") {
                var errors = response.getError();
                if (errors) {
                    if (errors[0] && errors[0].message) {
                        console.log("Error message: " + 
                                    errors[0].message);
                    }
                } 
                else {
                    console.log(response.getReturnValue());
                }
            }
        });
        $A.enqueueAction(action);
        
      
    },
    newPopup : function(component, event, helper)
    {
        //Initialize Fields
        component.set("v.PageHeading", "Add Renovation");
        component.set("v.reno.Id", "");
        component.set("v.reno.Name", "");
        component.set("v.reno.Property__c", "");
        component.set("v.reno.Renovation_Start_Date__c", "");
        component.set("v.reno.Renovation_End_Date__c", "");
        component.set("v.reno.Renovation_Notes__c", "");
        component.set("v.reno.Scope_Confirmed__c", false);
        
        helper.applyShowFormStyles(component);
        
        //Hide the scope confirmed checkbox when adding a renovation
        var cmpScopeConfirmed = component.find('scopeConfirmedDiv');
        $A.util.addClass(cmpScopeConfirmed, 'slds-hide');
    },
	closeNewModal : function(component, event, helper)
    {
        helper.applyHideFormStyles(component);
    },
    saveModal : function(component, event, helper){
        var renoAttr = component.get("v.reno");        
        var accountIdAttr = component.get("v.accountId");
        console.log(renoAttr.Id);
        
        if (renoAttr.Id == '')
        {
            helper.insertReno(component, helper, renoAttr, accountIdAttr);
        }
        else
        {
            helper.updateReno(component, helper, renoAttr);
        }		
    },
})

Here is my helper:
({
	applyHideFormStyles : function(component) {
		var cmpTarget = component.find('renoAddModal');
        $A.util.removeClass(cmpTarget, 'slds-fade-in-open');

        var cmpBack = component.find('Modalbackdrop');
        $A.util.removeClass(cmpBack,'slds-backdrop_open');        
                        
        var cmpScopeConfirmed = component.find('scopeConfirmedDiv');
        $A.util.removeClass(cmpScopeConfirmed, 'slds-hide');
	},
	applyShowFormStyles : function(component) {
        var cmpTarget = component.find('renoAddModal');
        $A.util.addClass(cmpTarget, 'slds-fade-in-open');

        var cmpBack = component.find('Modalbackdrop');
        $A.util.addClass(cmpBack, 'slds-backdrop_open');
	},
	insertReno : function(component, helper, renoAttr, accountIdAttr) {
        var action = component.get("c.insertReno");
        action.setParams({reno  : renoAttr, accountId  : accountIdAttr});
        action.setCallback(this, function(response) {
            var state = response.getState();          
            if (state === "SUCCESS") {
                $A.get('e.force:refreshView').fire();
                helper.applyHideFormStyles(component);               
            }
            else if (state === "ERROR") {
                var errors = response.getError();
                if (errors) {
                    if (errors[0] && errors[0].message) {
                        console.log("Error message: " + 
                                    errors[0].message);
                    }
                } 
                else {
                    console.log(response.getReturnValue());
                }
            }
        });
        $A.enqueueAction(action);
	},
	updateReno : function(component, helper, renoAttr) {
        var action = component.get("c.updateReno");
        action.setParams({reno  : renoAttr});
        action.setCallback(this, function(response) {
            var state = response.getState();          
            if (state === "SUCCESS") {
                $A.get('e.force:refreshView').fire();
                helper.applyHideFormStyles(component);               
            }
            else if (state === "ERROR") {
                var errors = response.getError();
                if (errors) {
                    if (errors[0] && errors[0].message) {
                        console.log("Error message: " + 
                                    errors[0].message);
                    }
                } 
                else {
                    console.log(response.getReturnValue());
                }
            }
        });
        $A.enqueueAction(action);
	}      
})



 
When keying sfdx from cmd or from the VS Code Terminal, I am getting the error: 'sfdx' is not recognized as an internal or external command, operable program or batch file.

Any clue on how to fix this?
 
  • March 08, 2019
  • Like
  • 0
I have a flat set of data that I need to turn into a pivot table in a lightning component.

Initially I tried this:

        <aura:iteration var="element" items="{!v.elements}">
            <!-- Begin Table Row -->
            <aura:If isTrue="{!element.StartElement}">
                <aura:unescapedHtml value="<tr>" />
            </aura:If>  

I am presented with this error:
            Failed to save FRCElementMatrixComponent.cmp: c:FRCElementMatrixComponent:57,44: ParseError at [row,col]:[58,44] Message: The value of attribute "value" associated with an element type "aura:unescapedHtml" must not contain the '<' character.: Source

So I tried to set an attribute called beginTR and set the value in JavaScript:
            <aura:If isTrue="{!element.StartElement}">
                <aura:unescapedHtml value="{!v.beginTR}" />
            </aura:If> 

This does not work as it cleans out the <tr> before it is output.  

Is there any way I can output straight HTML in lightning?  If not is there any other way to it in Salesforce?  Visual Force, React, etc.
 
I just started using lightning today.  Sorry for the simple question.  I am creating a lightning component where I need to display some fields from the Account on the lightning page and then pass the Account.Id to a controller to get some calculated data.

<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId" access="global" >

What goes here?

<span>{!v.Name}</span>
</aura:component>
I am getting an error when trying to do a sfdx retrieve:
ERROR:  Cannot read property 'fileName' of undefined.

Here is the command that is being issued in VS Code when I click on the package.xml file and retrive source from org:
sfdx force:source:retrieve --manifest c:\_hilton\BossReno\manifest\package.xml

The development environment is Salesforce Spring 2019
Here is my version of sfdx:
sfdx-cli/6.53.0-67a9cbb60c (windows-x64) node-v8.9.4


This package.xml file was generated by VS Code extension.  Here it is:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>*</members>
<name>ApexClass</name>
</types>
<types>
<members>*</members>
<name>ApexComponent</name>
</types>
<types>
<members>*</members>
<name>ApexPage</name>
</types>
<types>
<members>*</members>
<name>ApexTestSuite</name>
</types>
<types>
<members>*</members>
<name>ApexTrigger</name>
</types>
<types>
<members>*</members>
<name>AuraDefinitionBundle</name>
</types>
<types>
<members>*</members>
<name>StaticResource</name>
</types>
<version>45.0</version>
</Package>
There is a command in VS Code called SFDX: Push Source to Default Scratch Org.

What is the command to merge the code from the Scratch Org to the Real Org using VS Code or the SFDX cli?

Or is there some way you do it in Salesforce UI?
I have a client that needs to use big objects.  I have unsuccesfully been able to define a big object in my Trailhead org playground.  Has anyone else been able to define a big object yet?  

I tried uploading a zip file via workbench for this trailhead.  All I did was copy and paste the xml into files and zip it up.  I verified the directory structure in the zip file:
https://trailhead.salesforce.com/content/learn/modules/big_objects/big_objects_define_custom_big_objects

It gives this error which I created a support ticket for:
Exception 2015936646-114094 (-407009801)

I also tried using the Custom Big Object Creator by Salesforce
http://www.sfdc.co/BigObjectCreator

I followed these instructions
https://quip.com/qPbzAFtGDQe3

After clicking the Deploy button instead of giving a grey bar in the instructions it does nothing.  No Big Object is created.
So I'm learning apex via http://www.sfdc99.com/ 

Now he simple states, get a free dev org, i did that and then go through steps xyz to connect mavensmate...problem is mavensmate is no longer supported. 

So i installed all the packages need for visual studio code, but for the love of all things holy i cannot figure out how to connect it. Also whenever i log into my free dev org i'm not sure if im in sandbox or in the dev org, there's literally nothing different (other than one has less content).

I also have a corporate account, obviously i cant use the firms enterprise edition...
I'm running on windows 10, sfdx version 6.1.19, and getting an error when I try to pull source froma scratch org.  I feel like I've tracked it down to some code in node_modules\sfdx-cli\node_modules\salesforce-alm\dist\lib\typeDefUtil.js  which seems to assume a POSIX path seperator.  The parameter auraBundleFileProperties is an array of objects representing file properties.  The fullName property doesn't seem consistent in what path separator is being used.  Sometimes it's '/', Sometimes it's '\' -- I was able to solve the issue by changing the line

            const parentBundle = auraBundleFileProperties.find(fileProperty => fileProperty.fullName.split(path.sep)[0] === bundleName);

to

            const parentBundle = auraBundleFileProperties.find(fileProperty => path.normalize(fileProperty.fullName).split(path.sep)[0] === bundleName);

That seemed to work, but I've obviously hacked the original code delivered by SF... Has anyone else run into this issue?

The function was originally written as...
static getDefaultAggregateMetadataPath(devName, typeDef, defaultSrcDir, metadataRegistry, auraBundleFileProperties) {
        let metadataPath;
        const defaultTypeDir = !util.isNullOrUndefined(typeDef.defaultDirectory) ?
            path.join(defaultSrcDir, typeDef.defaultDirectory) : defaultSrcDir;
        if (typeDef.metadataName === metadataRegistry.typeDefs.AuraDefinitionBundle.metadataName) {
            const bundleName = devName.split(path.sep)[0];
            const parentBundle = auraBundleFileProperties.find(fileProperty => fileProperty.fullName.split(path.sep)[0] === bundleName);
            const fileName = `${path.basename(parentBundle.fileName)}${metadataRegistry.metadataFileExt}`;
            metadataPath = path.join(defaultTypeDir, bundleName, fileName);
        }
       .... more code.....
}
So I'm learning apex via http://www.sfdc99.com/ 

Now he simple states, get a free dev org, i did that and then go through steps xyz to connect mavensmate...problem is mavensmate is no longer supported. 

So i installed all the packages need for visual studio code, but for the love of all things holy i cannot figure out how to connect it. Also whenever i log into my free dev org i'm not sure if im in sandbox or in the dev org, there's literally nothing different (other than one has less content).

I also have a corporate account, obviously i cant use the firms enterprise edition...
I'm using a wrapper to display the standard record edit screen in a modal. However, none of the validation rules are being handled. They are still being triggered somehow, because the force:recordSaveSuccess is not being sent when there is an error.

Ideally, I would simply get the same behavior within the modal that I get in the default screen (dependent fields highlighted in red with error messages). As it is, there is no indication of the errors anywhere.

This is how I call the edit screen from within the lightning modal
<force:recordEdit aura:id="edit" recordId="{!v.itemRecordId}"/>

I hope I've stated this clearly. I appreciate any help or suggestions.
  
  • December 12, 2016
  • Like
  • 1

Hi,

Lets say we have an object and on the lightning component we are displaying its details. when ever i click on the button i need to pass record id to the controller.

This how my code look like:-
<aura:iteration items="{! v.vegs}" var="veg">
            <div class='tile' aura:id="test1" press="{! c.tester}" >              
                <img src='{! veg.Image__c}'  onClick="{! c.tester}" aura:id="imgId" value="{! veg.Name }"> </img>
                Name: {! veg.Name } <br></br>             
                price: {! veg.Price__c }   <br></br>
                <ui:button label="Add to cart" press="{! c.addToCart}"  aura:id="btn1" >      </ui:button>               
           </div>
</aura:iteration>

I want something similer to :-
 
<aura:iteration items="{!v.newCases}" var="case">
<button type="button" onclick="{!c.showCaseDeleteModal(case.Id)}">Delete</button>
</aura:iteration>


How can I pass the id to a component controller when the  button gets clicked?


Thank you!

Hi,

 

Is there a way to select everything in SOQL like "SELECT *" in SQL? I have looked at the SOQL manual about SELECT statements but it didn't tell if I can do this or not.

 

Thanks.

  • September 08, 2009
  • Like
  • 1
Hi,
 
How can we format a custom number or text field to pad zeros (0) on the left of a 5-digit number.
For e.g: If user enters 346, then it should be saved and displayed as "00346".
 
Thanks and regards,
Ambili
  • January 21, 2008
  • Like
  • 1