Missing New Task and Log a Call button in Lightning
how to unlock a record in approval process in lightning mode
I have an approval process on an object which is triggered via lightning action button.
when a record is under this approval process, the record should be locked as per the approval process. but it's editable in lightning mode and working fine in classic mode
The unlock record button also not visible in lightning mode.
Any workarround for this ??
lightning:menuItem in lightning:buttonMenu is not working in a nested component
I have two lightning components. One gets account's basic information on load and iterates over it and another displays the each account's basic information in a row. I have explained the div tag after the code snippet
Here's the code: viewAccountsList.cmp
<aura:iteration items="{!v.accountsList}" var="account" indexVar="i">
<c:accountListItem account="{!account}" />
</aura:iteration>
<div class="slds-truncate" title="Actions">
<lightning:buttonMenu alternativeText="Toggle menu">
<lightning:menuItem label="Some Account Action" value="someAction" iconName="utility:table" />
</lightning:buttonMenu>
</div>
accountListItem.cmp
<table class="slds-table slds-table_bordered">
<thead>
<th scope="col">
<div class="slds-truncate slds-text-heading_small" title="Account Name">Account Name</div>
</th>
<th scope="col">
<div class="slds-truncate slds-text-heading_small" title="Account Status">Account Status</div>
</th>
<th scope="col">
<div class="slds-truncate slds-text-heading_small" title="Account Balance">Account Balance</div>
</th>
<th scope="col">
<div class="slds-truncate slds-text-heading_small" title="Account Balance">Actions</div>
</th>
</thead>
<tbody>
<td data-label="Account Name">
<div class="slds-truncate" title="Account Name">
{!v.account.name}
</div>
</td>
<td data-label="Account Status">
<div class="slds-truncate" title="Account Status">{!v.account.status}</div>
</td>
<td data-label="Account Balance">
<div class="slds-truncate" title="Account Balance">{!v.account.balance}</div>
</td>
<td data-label="Account Balance">
<div class="slds-truncate" title="Actions">
<lightning:buttonMenu alternativeText="Toggle menu">
<lightning:menuItem label="Some Account Action" value="someAction" iconName="utility:table" />
</lightning:buttonMenu>
</div>
</td>
</tbody>
</table>
I want to add a lightning:buttonMenu to do additional operations on the account in the child component. The last div tag in the child component doesn't show the menuItem but the same div tag in the parent component does.
Why is this happening?
how to make Attachment mandatory specified attribute values
currently attachment is mandatory while clicking on Submit button for saving record(Please see in picture).
I need to make attachment mandatory for attribute values like :Support-User Creation,Support-User Termination,Support-User Update Permissions(as shown in picture).
Please find my component and javascript controller in code sample and suggest me how to make attachment mandatory for attribute values like :Support-User Creation,Support-User Termination,Support-User Update Permissions.whenever user selects this values i have show them a validation saying that attachment is mandatory for following values.
<aura:component controller="ctssupportform" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction">
<aura:attribute name="pageHeading" type="string" default="CEP Helpdesk"/>
<aura:attribute name="userCreation" type="boolean" default="false"/>
<aura:attribute name="UserTermination" type="boolean" default="false"/>
<aura:attribute name="updatePermission" type="boolean" default="false"/>
<aura:attribute name="isDataSubmitted" type="Boolean" default="true" />
<aura:attribute name="Isforsecond" type="Boolean" default="false"/>
<aura:attribute name="radioSelect" type="String" default=""/>
<aura:attribute name="fileName" type="String" default="No File Selected.." />
<aura:attribute name="Nxtbuttonvalidate" type="boolean" default="false"/>
<aura:attribute name="frameWidth" type="String" default="200" /><!--250-->
<aura:attribute name="frameHeight" type="String" default="80" /><!--30-->
<aura:attribute name="recordId" type="Id" default="'sobjectType':'attachment','Id':''"/>
<!-- Needed to send messages to VF page. But we will get it from VF itself -->
<aura:attribute name="vfHost" type="String" default="" />
<!-- Domain of LC for VF to send message -->
<aura:attribute name="lcHost" type="String" />
<aura:attribute name="body" type="string" default=""/>
<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
<aura:attribute name="frameSrc" type="String" />
<aura:attribute name="applicationdata" type="string[]" default="--None--,Please select an application,
CTS,
Support-ECOs,
Knowledge Base,
Lithium(Community),
Support-LMS,
My net,
Support Site,
Yapper,
Support-IVR or dial tone call Routing,
Support-Telco line Issue,
Support-Others,
Support-User Creation,
Support-User Termination,
Support-User Update Permissions,Chat"/>
<aura:attribute name="urgdata" type="string[]" default="Low,Medium,High"/>
<aura:attribute name="Impactdata" type="string[]" default="Low,Medium,High"/>
<aura:attribute name="casedata" type="Case" default="{'sobjectType':'Case'}"/>
<aura:attribute name="options" type="List" default="[
{'label': 'I want to report a down time with an application', 'value': 'I want to report a down time with an application'},
{'label': 'I want to request a new user account / update permissions to an existing account/terminate an existing account', 'value': 'I want to request a new user account / update permissions to an existing account/terminate an existing account'},
{'label': 'I want to report a bug / issue', 'value': 'I want to report a bug / issue'},
{'label': 'I want to request a new report', 'value': 'I want to request a new report'},
{'label': 'I want to request a new functionality / project', 'value': 'I want to request a new functionality / project'},
{'label': 'I want to report a telco issue', 'value': 'I want to report a telco issue'},
{'label': 'I want to request technical assistance', 'value': 'I want to request technical assistance'}]"
/>
<aura:handler event="aura:waiting" action="{!c.waiting}"/>
<aura:handler event="aura:doneWaiting" action="{!c.doneWaiting}"/>
<div class="slds-m-top--xx-large">
<div class="slds-page-header">
<div class="slds-align--absolute-center">
<div class="slds-text-heading--large">
<div class="slds-media">
<div class="slds-media__figure">
<span class="slds-icon_container slds-icon-standard-opportunity" title="Description of icon when needed">
</span>
</div>
<div class="slds-media__body">
<h1 class="slds-page-header__title slds-truncate slds-align-middle" title="Rohde Corp - 80,000 Widgets">{!v.pageHeading}</h1>
</div>
</div>
</div>
</div>
<br/><br/>
<div class="slds-align--absolute-center">
<div class="slds-size--3-of-8">
<!-- <lightning:accordion activeSectionName="Page1">
<lightning:accordionSection name="page1" label="Select the type of ticket:">-->
<lightning:radioGroup aura:id="mygroup" name="radioButtonGroup" label="" options="{! v.options }" value="{! v.casedata.Type_Of_Ticket__c}" onchange="{!c.handleChange }"> </lightning:radioGroup><br/>
<div class="setcolorwhite">
<lightning:select label="Please select one Applications" name="mySelect" value="{!v.casedata.Applications__c}" aura:id="mySelect" class="labelcolor" onchange="{!c.toggle}">
<aura:iteration items="{!v.applicationdata}" var="appl">
<option value="{!appl}" text="{!appl}"/>
</aura:iteration>
</lightning:select>
</div>
//Excel form will display based on the picklist value
<aura:if isTrue="{!and(v.options, v.userCreation)}">
<div aura:id="Support-User Creation" class="slds-grid slds-wrap slds-p-vertical_medium">
<span class="excel_format" style="display:inline;">
<a href='https://help.net-support.com/User_Management_template_version1.0.xlsx' target="_blank">Download sample and attach to ticket</a>
</span>
</div>
</aura:if>
<aura:if isTrue="{!and(v.options, v.UserTermination)}">
<div aura:id="Support-User Termination" class="demo-only demo-only--sizing slds-grid slds-wrap slds-p-vertical_medium">
<span class="excel_format" style="display:inline;">
<a href='https://help.net-support.com/User_Management_template_version1.0.xlsx' target="_blank">Download sample and attach to ticket</a>
</span>
</div>
</aura:if>
<aura:if isTrue="{!and(v.options, v.updatePermission)}">
<div aura:id="Support-User Update Permissions" class="demo-only demo-only--sizing slds-grid slds-wrap slds-p-vertical_medium">
<span class="excel_format" style="display:inline;">
<a href='https://help.net-support.com/User_Management_template_version1.0.xlsx' target="_blank">Download sample and attach to ticket</a>
</span>
</div>
</aura:if>
<div class="slds-m-top_large">
<lightning:button type="button" class="slds-button slds-button_brand" label="NEXT" onclick="{!c.nextButtonClickHandler}"/>
</div>
<!--<lightning:accordionSection name="page2" label="Please fill out the following form :">-->
<aura:if isTrue="{!v.Isforsecond}">
<lightning:input label="Subject" name="myname" value="{!v.casedata.Subject}" required="true"/>
<lightning:select label="Urgency" name="urgency" value="{!v.casedata.Urgency__c}">
<aura:iteration items="{!v.urgdata}" var="urg">
<option value="{!urg}" text="{!urg}"/>
</aura:iteration>
</lightning:select>
<lightning:select label="Impact" name="impact" value="{!v.casedata.Impact__c}">
<aura:iteration items="{!v.Impactdata}" var="imd">
<option value="{!imd}" text="{!imd}"/>
</aura:iteration>
</lightning:select>
<lightning:input label="Description" name="string" value="{!v.casedata.Description}" required="true"/>
<lightning:input label="Justification" name="justify" value="{!v.casedata.Justification__c}" required="true"/><br/>
<lightning:input aura:id="fileId" onchange="{!c.handleFilesChange}" type="file" name="file" label="Upload Attachment" multiple="false"/>
<div class="slds-text-body_small">{!v.fileName} </div>
<div class="slds-m-top_large">
<p><lightning:button iconName="utility:Submit" class="slds-button slds-button_brand" label="Submit" variant="border-filled" onclick="{!c.doSubmit}"/></p>
<br/>
</div>
</aura:if>
</div>
</div>
</div>
</div>
({ doSubmit : function(cmp, evt, hlpr) { var fileInput = cmp.find("fileId").get("v.files"); var file = fileInput[0];
var objFileReader = new FileReader();
//alert(file);
//console.log(file);
objFileReader.onload = $A.getCallback(function() {
var fileContents = objFileReader.result;
var base64 = 'base64,';
var dataStart = fileContents.indexOf(base64) + base64.length;
fileContents = fileContents.substring(dataStart);
console.log(encodeURIComponent(fileContents));
// call apex function SaveRegistrationDetail to save data in reg form
// also we have to pass RegForm as a parameter
var casedata = cmp.get("v.casedata");
// you can specify the base url
//var redUrl ="https://ntgr--fullcopy.lightning.force.com/one/one.app#/sObject/";
//window.open(redUrl+firstId);
// create a one-time use instance of the SaveRegistrationDetail action
// in the server-side controller
var action = cmp.get("c.Savesupportform");
action.setParams({
casedata : casedata,
fileName: file.name,
base64Data: encodeURIComponent(fileContents),
contentType: file.type
});
// Create a callback that is executed after
// the server-side action returns
action.setCallback(this, function(response) {
var state = response.getState();
//alert(state);
if (state === "SUCCESS") {
// Alert the user with the value returned
// from the server
cmp.set("v.isDataSubmitted", 'True');
var parentId = response.getReturnValue();
cmp.set("v.RegistrationRecordId",parentId);
//alert('Record created succesfully'+''+ parentId);
window.location.href = "/" + parentId;
}
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("Unknown error");
}
}
});
// $A.enqueueAction adds the server-side action to the queue.
var radio=cmp.get('c.handleChange');
$A.enqueueAction(action,radio);
});
objFileReader.readAsDataURL(file);
},
handleFilesChange: function(component, event, helper) {
//alert('fileselected');
var fileName = 'No File Selected..';
if (event.getSource().get("v.files").length > 0) {
fileName = event.getSource().get("v.files")[0]['name'];
}
component.set("v.fileName", fileName);
//alert(fileName);
},
handleClick : function (component ,event,helper){
var nxtbtnonRadio=component.get("v.options");
var nxtbtonSelect=component.find("mySelect");
var nxtSelect=nxtbtonSelect.get("v.value");
if(nxtbtnonRadio != null && nxtSelect.trim() != null ){
component.set("isDataSubmitted", true);
}
},
handleChange: function (cmp, event) {
var changeValue = event.getParam("value");
console.log("On change : "+changeValue);
cmp.set("v.radioSelect", changeValue);
//alert(changeValue);
//var actn=component.get("c.handleClick");
//actn.$meth$();
},
toggle: function (component, event, helper) {
var sel = component.find("mySelect");
var nav = sel.get("v.value");
if (nav.trim() == "Support-User Creation") {
component.set("v.userCreation", true);
}
else{
component.set("v.userCreation", false);
}
if(nav.trim() == "Support-User Termination"){
component.set("v.UserTermination", true);
}
else{
component.set("v.UserTermination", false);
}
if(nav.trim() == "Support-User Update Permissions"){
component.set("v.updatePermission" , true);
}
else{
component.set("v.updatePermission" , false);
}
},
nextButtonClickHandler : function(component, event, helper){
var sel = component.find("mySelect");
var nav = sel.get("v.value");
if(nav !== '--None--'&& component.get("v.radioSelect") !== '') {
component.set("v.Isforsecond", true);
}
},
doInit : function(component, event, helper) {
/*
//Send LC Host as parameter to VF page so VF page can send message to LC; make it all dynamic
component.set('v.lcHost', window.location.hostname);
var frameSrc = '/apex/UploadFilePage?id=' + component.get('v.RegistrationRecordId') + '&lcHost=' + component.get('v.lcHost');
console.log('frameSrc:' , frameSrc);
component.set('v.frameSrc', frameSrc);
//Add message listener
window.addEventListener("message", function(event) {
console.log('event.data:', event.data);
// Handle the message
if(event.data.state == 'LOADED'){
//Set vfHost which will be used later to send message
component.set('v.vfHost', event.data.vfHost);
//alert('file loaded');
}
if(event.data.state == 'uploadFileSelected'){
component.find('uploadFileButton').set('v.disabled', false);
//alert('upload file selected');
}
if(event.data.state == 'fileUploadprocessed'){
var uiMessage = component.find('uiMessage');
//Disable Upload button until file is selected again
component.find('uploadFileButton').set('v.disabled', true);
//alert('file upload is true');
$A.createComponents([
["markup://ui:message",{
"body" : event.data.message,
"severity" : event.data.messageType,
}]
],
function(components, status, errorMessage){
//alert('create component');
if (status === "SUCCESS") {
var message = components[0];
// set the body of the ui:message to be the ui:outputText
component.find('uiMessage').set("v.body", message);
}
else if (status === "INCOMPLETE") {
console.log("No response from server or client is offline.")
// Show offline error
}
else if (status === "ERROR") {
console.log("Error: " + errorMessage);
// Show error message
}
}
);
}
}, false);
*/
},
sendMessageone: function(component, event, helper) {
//Clear UI message before trying for file upload again
component.find('uiMessage').set("v.body",[]);
//Prepare message in the format required in VF page
var message = {
"uploadFile" : true
} ;
//Send message to VF
var sndmsg=component.set("v.sendmsg", true);
helper.sendMessage(component, message);
},
setIframeCaseId : function(component, event, helper) {
component.set("v.formSubmitStatus", "");
var message = {
"recordId" : event.target.value
};
helper.sendMessage(component, helper, message);
},
handleFormSubmit: function(component, event, helper) {
//alert('file is uploading');
console.log('file is uploading');
var message = {
"uploadFile" : true
};
helper.sendMessage(component, helper, message);
}
})
Fix the Lightning component on app page
How to call lightning component from custom button?
Quick Action doesnt show up in the Layout
lightning:listview component: unable to display list views from managed packages
I have an app page that needs to display records from a particular list view. I have created a simple component using lightning:listview component.
I am able to use this to display a custom list view for a managed package object. But when I try to display a managed package list view for the same managed package object I get a message "The list view you requested was deleted, or you don't have permission to view it".
I am logged in as the system administrator. I can view the contents of the list view if I go that object's tab and select that list view. The code for my sample component is below.
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,forceCommunity:availableForAllPageTypes" access="global">
<lightning:listView aura:id="listViewAccounts"
objectApiName="namespace__objectname__c"
listName="All"
rows="5"
showActionBar="true"
enableInlineEdit="true"
showRowLevelActions="true"
/></aura:component>
The error message that I am seeing
Let me know if you can spot what I am doing wrong. Your response will be greatly appreciated.
How to Pass or Set Automatically Value to the Custom Lookup Component in lightning Components(Aura)
I have one Custom Lookup Component I want this Field to be set automatically when I'm Passing the Id but it is not happening.
Here you go
<aura:attribute name="selectedLookUpRecord" type="Account" default="{}"/>
<aura:handler name="init" action="{!c.quotebody}" value="{!this}"/> //Using this Here I'm loading with data but custom lookup field one is not taking
<c:customLookup aura:id="custlookid" objectAPIName="account" IconName="standard:account" selectedRecord="{!v.selectedLookUpRecord}" />
How I'm passing Value to the Custom lookup on Controller here it is:
cmp.set("v.selectedLookUpRecord.Id",quotedetailes1.Account_Name__c);
In the backend, value is storing in the attribute but in the user interface side lookup field is empty.
Here is the image for reference:
It is empty like above field image this I'm passing the value also.
I want the field to be filled like this automatically.
Quick Action and flow to create a record in ligthning
I am trying to create a quick Action that calls the flow and lightning component to create a record as suggested in the blog here. I need to create a record of custom object from Opportunity record , using the Quick action as suggested in the blog. I created a flow like below with the Action which calls the lightning component createAXProjectRecords
And the Lightning component is like
createAXProjectRecords.cmp
<aura:component implements="lightning:availableForFlowActions">
<aura:attribute name="InputContactID" type="String" />
<aura:attribute name="InputAccountID" type="String" />
</aura:component>
createAXProjectRecords.design
<design:component>
<design:attribute name="InputContactID" />
<design:attribute name="InputAccountID" />
</design:component>
createAXProjectRecordsController.js
({
invoke : function(component, event, helper){
var ContactID = component.get("v.InputContactID");
var AccountID = component.get("v.InputAccountID");
var createRecordEvent = $A.get("e.force:createRecord");
createRecordEvent.setParams({
"entityApiName": "AX_Project__c",
"defaultFieldValues": {
'Contact__c' : ContactID,
'Account__c': AccountID
}
});
createRecordEvent.fire();
}
})
When I try to click on the Quick Action on the Opportunity record I get
I tried running the flow to debug but it is also throwing
Unhandled fault exception
. Can anyone suggest me what I am missing here.
Error in the flow
How to display image in a lightning component
My files are stored in 'files' under App launcher.
I have a Rich text box field 'description' in a object wherein i enter text and images. Here, the images are entered as tags. the 'src' attribute of tag contain the public url of the image which i stored in 'files' in the App launcher.
For eg:
<img src="https://<domain>.cs21.my.salesforce.com/sfc/p/#q00000000sNA/a/q00000008a0b/6woo3x9YQNR7vTXR2oOOmknAOjpytHMEnZc2nGQ3F54"/>
Now, i want to build a lightning component 'preview', which will take this field 'description' and read the image and show the text and image to the client to review.
I am stuck on how to read the img and display the image from the URL.
I am new to lightning. Can you please help me to achieve this?
What is all that thing in Lightning Pages about?
I know it's a "who cares" question, but somehow I care and I wanted to have this documented somewhere in the WWW :)
In Lightning Pages the whole DOM is full of <!--render facet: 5:0-->
statements.
Not only standard UIs are affected, also my own components are full of these debugs. Why is that happening? can we get rid of those?
I mean nothing bad is happening, but it is weird and spamming the whole DOM. In a simple Table Component, it appears 655 times.
Is seems to appear whenever I use any aura rendering mechanism like aura:if
or aura:iteration
that does not affect the DOM.
<aura:if isTrue="{!false}">
False
</aura:if>
<aura:if isTrue="{!true}">
True
</aura:if>
<aura:if isTrue="{!false}">
False
</aura:if>
Results in
<!--render facet: 4368:929;a-->
True
<!--render facet: 4367:929;a-->
Same for iteration
<aura:iteration items="[]" var="value">
{!value}
</aura:iteration>
<aura:iteration items="[1]" var="value">
{!value}
</aura:iteration>
Results in
<!--render facet: 4367:929;a-->
1
So the main question is, can we avoid it or switch it of?
How to limit email lookup fields to account contacts while sending email from account in Lightning?
While sending an email from an account in Lightning using the standard Activities email component, the address lookup appears to first pull matching users ("Bob" in my example) from account contacts, then pull other contacts from other sources, including other accounts. If we don't have any account contacts, it will just pull from other sources:
It's easy to see how this could be a problem if you accidentally select a "Bob" from the wrong account and send him sensitive information about your intended "Bob".
Is there a way to limit this component to just show contacts related to the account you are sending from?
Salesforce Keyboard shortcuts
Can we use any keyboard shortcuts in Salesforce Apps? Not Console apps. I only found from this doc
e
-> edit
/
-> navigate to search
esc
-> close create/edit record
The others do not seem to work.
Also, if they exist, are they configurable?
Quick Action on related list
In lightning you are not able to do URL hacking. In order to do any prepopulation of fields, it is suggested to use a quick action.
If we have a related list object and we are trying to prepopulate the object of the related list, we would make a quick action and remove the "New" button. However, to a user, this will probably be very confusing since sometimes the new button is on the related list, sometimes you have to go to the top right/highlights panel to find the quick action button. Is there anyway to standardize both quick action and "new" button?
The link below mentions that it is not possible to put the quick action onto the related list.
https://success.salesforce.com/answers?id=9063A000000pDJlQAM
I thought about the idea of overriding the "New" button to call a quick action, but that doesn't seem to be possible.
Any suggestions is greatly appreciated!
Getting an issue record Highlights with Compact Layouts
I am getting an Issue with record Highlights with Compact Layouts when I edit the record detail page in Lightning app Builder It shows Person Account. but When I save the page It only shows Account in Highlights panel.Its working fine in Dev but no in QA Org. I have checked all the recordtype, pagelayout setting , Profile permission, Lightning record page.
Sending wrapper object to apex controller from lightning component
I am trying to send a wrapper class from lightning component to Apex controller. But it is throwing following error:
This page has an error. You might just need to refresh it.
Error in $A.getCallback() [Cannot read property 'name' of null]
Failing descriptor: {ui:input}
Following are the classes and components:
Wrapper Class:
public class WrapperAccountContact {
@AuraEnabled
public String name{get;set;}
@AuraEnabled
public String accountNumber{get;set;}
}
Apex Controller:
public class CreateAccountContact {
@AuraEnabled
public static void createRecord (String candidates){
try{
System.debug('CreateCandidateRecord::createRecord::candidate'+candidates);
if(candidates != null){
WrapperAccountContact obj = (WrapperAccountContact)JSON.deserialize(candidates, WrapperAccountContact.class);
Account a = new Account();
a.name = obj.Name;
a.AccountNumber = obj.AccountNumber;
insert a;
}
} catch (Exception ex){
System.debug('Exceptionnnn:'+ex);
}
}
}
JS Controller:
({
create : function(component, event, helper) {
console.log('Create record');
//getting the candidate information
var candidates = component.get("v.candidate");
//Validation
/*if($A.util.isEmpty(candidate.name) || $A.util.isUndefined(candidate.name)){
alert('Name is Required');
return;
}
if($A.util.isEmpty(candidate.accountNumber) || $A.util.isUndefined(candidate.accountNumber)){
alert('AccountNumber is Required');
return;
}*/
//Calling the Apex Function
var action = component.get("c.createRecord");
//Setting the Apex Parameter
/* action.setParams({
candidate : candidate
});*/
action.setParams({ "candidates" : JSON.stringify(candidates) });
//Setting the Callback
action.setCallback(this,function(a){
//get the response state
var state = a.getState();
//check if result is successfull
if(state == "SUCCESS"){
//Reset Form
/*var newCandidate = {'sobjectType': 'WrapperAccountContact',
'name': '',
'accountNumber': ''
};
//resetting the Values in the form
component.set("v.candidate",newCandidate);*/
alert('Record is Created Successfully');
} else if(state == "ERROR"){
alert('Error in calling server side action');
}
});
//adds the server-side action to the queue
$A.enqueueAction(action);
}
})
Lightning Component:
<aura:component controller="CreateAccountContact" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes"
access="global">
<ltng:require styles="/resource/Bootstrap/Bootstrapzip/bootstrap.min.css"
scripts="/resource/JQuery/jquery-3.3.1.min.js,/resource/Bootstrap/Bootstrapzip/bootstrap.min.js"/>
<aura:attribute name="candidate" type="WrapperAccountContact"/>
<div class="container-fluid">
<h3>Please Enter Account Information</h3>
<div class="form-group">
<label>Name</label>
<ui:inputText class="form-control" value="{!v.candidate.name}"/>
</div>
<div class="form-group">
<label>AccountNumber</label>
<ui:inputText class="form-control" value="{!v.candidate.accountNumber}"/>
</div>
</div>
<div class="col-md-4 text-center">
<ui:button class="btn btn-default" press="{!c.create}">Create Contact</ui:button>
</div>
</aura:component>
Please let me know if there is any problem with input tags of component and how to resolve the following error:
This page has an error. You might just need to refresh it.
Error in $A.getCallback() [Cannot read property 'name' of null]
Failing descriptor: {ui:input}
Thanks!
Error message from server side controller lightning
Hi i want the error message to be displayed, i am getting value in response.getError() function, i want message argument in this function. Below is the snippet of how i'm doing, i am getting undefined in str console statement.
JS
var errors = response.getError();
if (errors) {
var str = errors[0].message;
console.log('str' + JSON.stringify(str));
component.set("v.Error", str);
console.log('Here cmp' + component.get("v.Error")); }
Problem with static resource and Lightning Component
I am trying to use JQuery DataTables Library in a Lightning Component but I am finding problems with static resources.
I upload three static resources (versions as DataTables Documentation):
- jQuery v1.12.4
- DataTables 1.10.13
- DataTable Style
I am trying with a Visualforce Page and it's ok:
Visualforce Page:
<apex:page showHeader="false" sidebar="false" standardStylesheets="false" applyBodyTag="false" applyHtmlTag="false">
<head>
<apex:includeScript value="{!URLFOR($Resource.jquery)}"/>
<apex:includeScript value="{!URLFOR($Resource.table)}"/>
<apex:stylesheet value="{!URLFOR($Resource.stile)}"/>
</head>
<body>
<table id="example" class="display" cellspacing="0" width="100%">
<thead>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</tfoot>
<tbody>
<tr>
<td>Tiger Nixon</td>
<td>System Architect</td>
<td>Edinburgh</td>
<td>61</td>
<td>2011/04/25</td>
<td>$320,800</td>
</tr>
<tr>
<td>Garrett Winters</td>
<td>Accountant</td>
<td>Tokyo</td>
<td>63</td>
<td>2011/07/25</td>
<td>$170,750</td>
</tr>
<tr>
<td>Ashton Cox</td>
<td>Junior Technical Author</td>
<td>San Francisco</td>
<td>66</td>
<td>2009/01/12</td>
<td>$86,000</td>
</tr>
</tbody>
</table>
<script>
$(document).ready(function() {
$('#example').DataTable();
} );
</script>
</body>
So, after Visualforce Page I want to use Lightning Component and my code is:
Component:
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes" access="global">
<ltng:require scripts="{!join(',', $Resource.table, $Resource.jquery)}"
styles="{!$Resource.stile}" afterScriptsLoaded="{!c.afterLoadedDataTables}"/>
<table id="example" class="display" cellspacing="0" width="100%">
<thead>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Start date</th>
<th>Salary</th>
</tr>
</tfoot>
<tbody>
<tr>
<td>Tiger Nixon</td>
<td>System Architect</td>
<td>Edinburgh</td>
<td>61</td>
<td>2011/04/25</td>
<td>$320,800</td>
</tr>
<tr>
<td>Garrett Winters</td>
<td>Accountant</td>
<td>Tokyo</td>
<td>63</td>
<td>2011/07/25</td>
<td>$170,750</td>
</tr>
<tr>
<td>Ashton Cox</td>
<td>Junior Technical Author</td>
<td>San Francisco</td>
<td>66</td>
<td>2009/01/12</td>
<td>$86,000</td>
</tr>
</tbody>
</table>
JavaScript Controller:
({
afterLoadedDataTables : function(component, event, helper) {
$('#example').DataTable();
}})
The problem is that only the first js library is downloaded and not both in scripts attribute. So if I write:
ltng:require scripts="{!join(',', $Resource.table, $Resource.jquery)}"
styles="{!$Resource.stile}" afterScriptsLoaded="{!c.afterLoadedDataTables}"/>
are downloaded table js library and stile css but not jquery js library. If I write:
<ltng:require scripts="{!join(',', $Resource.jquery, $Resource.table)}"
styles="{!$Resource.stile}" afterScriptsLoaded="{!c.afterLoadedDataTables}"/>
are downloaded jqueryjs library and stile css but not table js library.
Webhook / View Object Data from a Website (Wordpress)
Is there a way to access records from a custom object and then put those records on a website without using API? Specifically, feed-like-RSS that could generate JSON/XML?
The CRM I'm working in does not (and will not) have an API-specific user. So, I'm trying to get a public feed from the CRM that I can style in the website.
Is there a secure way to do this without API? Maybe I'm thinking like how people used to get RSS feeds?