• Team Codekiat.com
  • 734 Points
  • Member since 2017

  • Chatter
  • 23
    Best Answers
  • 0
    Likes Received
  • 4
    Likes Given
  • 1
  • 312
how to send list<strings> from parent component  to child component  using aura attribute in lightning
 (note : I dont want aura methods or events ) 
I have an issue with lightning bottom menu item's that is within a data table whereby the menu items are not visible if the menu item appears as the last record of the data table (see the 2nd image) or if the data table consists of only 1 record (see the last image). Below is the sample code of the data table with the lightning button menu

Sample Code
<div class="slds-table--header-fixed_container" style="height: 100%">
        <div class="slds-card__body slds-card__body_inner slds-scrollable--y" style="height: 100%">
            <table class="slds-table slds-table--bordered slds-table--header-fixed">
                <tr class="slds-text-title--caps">
                    <aura:iteration items="{!v.columns}" var="col">
                        <th scope="col">
                            <div onclick="{!c.updateColumnSorting}"
                                 class="slds-truncate slds-cell-fixed"
                                 title="{! col.fieldName}" data-field="{! col.fieldName}">
                                {! col.label }
                                    <aura:if isTrue="{!v.sortedBy == col.fieldName}">
                                            {! v.sortAsc ? '&#8593;' : '&#8595;'}
                    <th scope="col"></th>
                <aura:iteration items="{!v.data}"
                                var="record" indexVar="indexVar">
                        <th data-label="Title" class="{! 'popover_'+record.Id +' cell-solution-title-width'}">
                            <div class="slds-truncate cell-solution-title-width" title="{!record.Solution_Title__c}"
                                 data-recordid="{!record.Id}" data-record="{! record}">
                        <th data-label="Category" class="{! 'popover_'+record.Id +' cell-solution-number-width'}">
                            <div class="slds-truncate cell-solution-number-width" title="{! record.Solution_Sub_Category__c}"
                                 data-recordid="{!record.Id}" data-record="{! record.Solution_Sub_Category__c}">
                                {! record.Solution_Sub_Category__c}
                        <th data-label="Status" class="{! 'popover_'+record.Id}">
                            <div class="slds-truncate" title="{!record.Status__c}"
                                 data-recordid="{!record.Id}" data-record="{! record}">
                        <th data-label="Author" class="{! 'popover_'+record.Id}">
                            <div class="slds-truncate" title="{!record.CreatedBy.Name}"
                                 data-recordid="{!record.Id}" data-record="{! record}">
                            <lightning:buttonMenu aura:id="menu" onselect="{! c.handleSelect }"
                                                  alternativeText="Menu" value="{!record.Id}" menuAlignment="right">
                                <lightning:menuItem value="{! 'E,'+record.Id +','+indexVar}" label="Edit"/>
                                <lightning:menuItem value="{! 'A,'+record.Id +','+indexVar}" label="Approve"/>

User-added image
User-added imageUser-added image
Greetings of the day...

I am designing a Lightning component using Developer console and on adding it to Lightning App Builder, I am not finding any custom tab to add my component to the Lightning page.

User-added image

Plz. help us to add a lightning component in the custom section.

I'm a green Salesforce Admin.

I'm trying to close this Booking (Opportunity) by changing the stage fom 'Closed Won' to 'Closed', but gettign the error: 

Object (id = 0060I00000dElwv) is currently in trigger OpportunityTrigger, therefore it cannot recursively update itself

I can see the Apex Trigger in the Object Manager, but I don't have any experience with development, so I can;t tell why this error is occuring. 

Hi Team,

In my project i have the urgent requirement.

At the lookup Field we have an option to create New Record in Lightning View.  
Creating the New Record at Look-Up Field is a Standard Salesforce Out of the box functionality.
1)How can i restrict the user while trying to create the Record at Look-Up in lightning View ?


User-added imageThanks in Advance...

I am trying to create a view to show activity information. However the below code is not displaying any information, only header is showing. Please help.
HTML Component :

    <lightning-card class="slds-text-title_bold"  title = "Activity Information">
        <div class="slds-p-around_medium lgc-bg" style="height: 300px;">
JS File:

import { LightningElement,api,wire,track} from 'lwc';
import ActivitySearchController from '@salesforce/apex/ActivityLeadPage.ActivitySearchController'

const columns = [
    { label: 'Subject', fieldName: 'Subject' },
    { label: 'Due Date', fieldName: 'ActivityDate' },
    { label: 'Status', fieldName: 'Status' },

export default class ActivityLeadPageComponent extends LightningElement {
    @api recordId;
    @track data = [];
    @track columns = columns;
    @wire(ActivitySearchController, { currentID: '$recordID'})
Controller :

public class ActivityLeadPage{
    public static List<Task> ActivitySearchController(String currentID){
        List<Task> TaskList = new List<Task>();
        Map<Id,Lead> leadMap = new Map<Id,Lead>();
                List <Lead> leadList = [SELECT id, Email FROM Lead WHERE ID=:currentId];
                String ldEmail       = leadList[0].Email;
                Set<String> emailIds = new Set<string>();
                TaskList = getTaskList(emailIds);
            catch(Exception e){
                system.debug('getlinenumber-->'+ e.getMessage() +' line '+ e.getLineNumber());
        return TaskList;
    public static List<Task> getTaskList (Set<String> emailIds) {  
        Map<Id,Lead> leadMap = new Map<Id,Lead>();      
        leadMap = new Map<Id,Lead>([SELECT id, Email FROM Lead Where Email IN:emailIds]);       
        Set<Id> leadID = new Set<Id>(); 
        for(Lead lE : leadMap.values()){
        List<Task> TaskList = [Select id, Subject, Description, who.Type, What.Type, Priority, Status, ActivityDate,CreatedDate, LastModifiedDate FROM Task 
                               WHERE whoId IN:leadID ORDER BY createddate DESC LIMIT 20];
        if(TaskList.size() == 0){
            Apexpages.addMessage(new ApexPages.Message(ApexPages.Severity.INFO,''+'No Tasks to Display'));
        return TaskList;
What should i do with this error? Does not let me send quotes by email from the PDF page of the quote...
Hi All,

I have created a lightning component to display a public site from which we can get customers sigup.
I have created the Lightning component for this and able to view the page but, I am unable to fire the toast messages in this.
And also my Save button is not getting disabled after clicking on it. 
This is my code. Any help to solve this is appreciated. Thanks in advance.
Lightning component:
<aura:component controller="CreateContactrecordController" 
             access="global" >
    <!-- Include Static Resource-->
    <ltng:require styles="/resource/bootstrap/css/bootstrap.min.css" 
    <!--aura:attribute name="isSpinner" type="boolean" default="false"/-->
    <aura:attribute name="FirstName" type="String" default="" />
    <aura:attribute name="LastName" type="String" default="" />
    <aura:attribute name="Mobile" type="String" default="" />
    <aura:attribute name="Email" type="String" default="" /> 
    <aura:attribute name="Store" type="String" />
    <aura:attribute name="LanguageList" type="List" />
    <aura:attribute name="SelectedLanguage" type="String" />
    <aura:attribute name="isHide" type="Boolean" default="false" />
     <aura:handler name="onSaveSuccess" event="force:recordSaveSuccess" action="{!c.handleSaveSuccess}"/>
 <force:recordEdit aura:id="edit" recordId=""/>
 <ui:button label="Save" press="{!c.save}"/>
    <div class="slds-page-header">
        <div class="slds-align_absolute-center">
            <div class="slds-text-heading_large">
                <div class="slds-m-top_xx-large">
                    Customer Subscription Form
    <aura:handler name="init" action="{!c.doinIt}" value="{!this}"/> 
    <div class="slds-form-element__control">
         <lightning:input label="First Name" name="firstname" type="text" required="true" value="{!v.FirstName}" />
        <lightning:input label="Last Name" name="lastname" type="text" required="true" value="{!v.LastName}" />
        <lightning:input label="Mobile" type="tel" value="{!v.Mobile}"/>
        <lightning:input label="Email" name="email" type="email" required="true" value="{!v.Email}" />
        <lightning:input label="Store" type="Text" name="Store" value="{!v.Store}" />
        <lightning:select label="Language" name="Language" value="{!v.SelectedLanguage}">
            <aura:iteration items="{!v.LanguageList}" var="Language">
                <option value="{!Language}" text="{!Language}"></option>
   <lightning:button variant="brand" disabled="{!v.isHide}" label="{!v.isHide == true ? 'Save' : 'Save'}" onclick="{!c.savecustomerForm}" /> 
    <!--lightning:button variant="brand" disabled="{!v.isSpinner}" label="{!v.isSpinner == true ? 'Saving...' : 'Save'}" onclick="{!c.savecustomerForm}" /--> 



    doinIt: function(component, event, helper){ 
        var action = component.get('c.getPickListValuesIntoList');          
         // method name i.e. getEntity should be same as defined in apex class         
         // params name i.e. entityType should be same as defined in getEntity method        
        //action.setParams({ "entityType" : component.get('v.componentString') });         
            action.setCallback(this, function(a){             
            var state = a.getState(); // get the response state             
            if(state == 'SUCCESS') {
     savecustomerForm: function(component, event, helper) {
        console.log('Create record');
         var action = component.get("c.save");
        //Setting the Apex Parameter
         action.setParams({"FirstName":component.get("v.FirstName"), "LastName":component.get("v.LastName"),
                           "Email":component.get("v.Email"), "Mobile":component.get("v.Mobile"), 
                           "Store":component.get("v.Store"), "Language":component.get("v.Language")
        //Setting the Callback
            //get the response state
            var state = a.getState();
            var isContactexists = a.getReturnValue();
            //check if result is successfull
            if(state == "SUCCESS"){
                //Reset Form
                var newContact = {'sobjectType': 'Contact','FirstName': '','LastName': '','Email': '',
                                  'Mobile': '', 'Store__C': '','Language__c' : ''};
                //resetting the Values in the form
              //alert('Record Created Successfully');
                    component.find("edit").get("e.recordSave").fireeSuccess : function(cmp, event) {
                     // Display the save status
                     var toastEvent = $A.get("e.force:showToast");
                     "title": "true!",
                     "message": "My Custom Record Saved Successfully"
                component.set('v.isHide', true);  
                else { 
                   alert('Record already exists'); 
            else if(state == "ERROR"){
            alert('Error in calling server side action');


Apex controller:

public class CreateContactrecordController {
     public static List<String> getPickListValuesIntoList()
       List<String> pickListValuesList= new List<String>();
        Schema.DescribeFieldResult fieldResult = Contact.Language__C.getDescribe();
        List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();
        for( Schema.PicklistEntry pickListVal : ple){
        return pickListValuesList;
    public static Boolean save(String FirstName, String LastName, String Email, String Mobile, String Store, String Language )
        List<Contact> Contact = [SELECT Id, Email From Contact WHERE Email=:Email];
         if(contact.size() > 0){
             return false;
            Contact con=new Contact(); 
            con.FirstName = FirstName;
            con.LastName = LastName;
            con.Email = Email;
            con.MobilePhone = Mobile;
            con.Store__c = Store;
            con.Language__c = Language;
            insert con;
            return true;
Hi Community!

So I made a flow for closing a feedback case that works as a standard lightning component. However, when I put the flow in as part of a guided action list. The flow runs but doesn't update anything.

I noticed that this iw why the standard version works is because of this check mark where I pass my feedbackcaseID variable as the recordID:

User-added image

What would be the best way to grab the current record ID in my flow so that I can run it through the guided action list?

More than happy to attach screenshots of my current flow if that helps.

Thank you all this would be amazing if I can get this solved!!

trigger Prefix_Dr on Lead (before insert,before update) {
    for(lead L:trigger.new){
public class Prefix_Dr_test {
    testmethod static void test(){
        Lead L=New Lead();
        insert L;
        Lead Le=[select Id,firstname,lastname from lead where company='sfdc'];

here test class is showing error
Has anyone got simple examples of where they were able to add a 3rd column to a section in Lightning? 
What is the difference between Salesforce Lightning and Classic.

Guys I have joined a startup coming which is asking me to learn Salesforce and start working on it. As I have learned Java and have also worked in a small firm for 1 year on Java. Now should I start learning Salesforce or look for other job in Java. Is learning Salesforce worth for long run or should I get expertise in java
Hi all,

I would like to implement component having a background color change feature.
I tried to get some information on how to change CSS using Lightning Component controller, I couldn't get much about it.
Please advise me if you have any idea to solve this.

Thanks for your help in advance.

Component :
        <lightning:input type="color" label="Color" name="color" value="" onchange="{!c.colorChanger}" aura:id="color"/>
Controller :
	colorChanger : function(component, event, helper) {
		var color = component.find("color").get("v.value");
        this.css({"background" : color})
*tried this.style.background = color;
We have a custom lightning component that takes advantage of an external stylesheet (stored in the static resources).

It is included with 
<ltng:require styles="{! $Resource.STYLESHEETNAMEHERE}"/>

My thinking is that the developer adds a sort of 'onExit' handler to unlink the file, but I can't find any documentation for unloading a static resource, or I could be completely wrong and it just be a caching issue

The issue is that some of the styles in that external resource are being carried over to other components that don't explicitly include the file
How can we tackle this?

A screen recording of the issue
  • Open a default modal (FINE)
  • Open a custom component that includes the CSS file named 'fullModalBypass.css'
  • Re-open the first modal, the modal contains the CSS file that was included in the component of the previous step
This page has an error. You might just need to refresh it. Action failed: c:csvSample$controller$loadContactList [component is not defined] Failing descriptor: {c:csvSample$controller$loadContactList}

can we call a lightning componet using flow Builder????

Pls let me know
Thanks in advance
I have a picklist for ethnicity sub category, and I am trying to create an Ethnicity formula field which automatically updates depending on the picklist value. 
An example of the formula:
IF (Ethnicity_Sub_Category__c>= Vietnamese, "Asian", 
IF (Ethnicity_Sub_Category__c>= Asian Other, "Asian"

Error message:
Error: Syntax error. Found 'Asian'

I tried a few other formulas but also received Error: Field Ethnicity_Sub_Category__c is a picklist field. Picklist fields are only supported in certain functions.

Is there a way to do this?

Thanks in advance
There is a requirement where we need to group the business field by rows and group status field by column, In this process, we get a matrix report with business as rows and different status as columns

shown below in the screenshot 
User-added image
this is the exported report from salesforce. 

Now we have a requirement to display pending column after Due column in the above-shown screenshot and the value of the pending column is calculated by the subtraction of Due and delivered columns. how to achieve this?

Appreciate your inputs on this. 

- Naveen K N

Requirement Description

Requirement 1
Add business logic to Prevent a user from adding any other Task Record Types to a case with the status of Closed.

Add an error message to trigger on save of the task, if the user has added a Task where the WhatId relates to a case with a status of 'Closed'. The message to read 'Tasks cannot be added to Closed cases.'

Requirement 2
Add business logic to stop a user from adding an Event to a case with the status of Closed.

Add an error message to trigger on save of the event, if the user has added an Event where the WhatId relates to the case with a status of 'Closed'. The message to read 'Events cannot be added to Closed cases.'

I can't add it as a validation rule because WhatId is polymorphic.

Can anyone suggest the best approach.

Lightning Component
<aura:component controller="membershipOpportunityViewCMP_controller" implements="flexipage:availableForAllPageTypes,force:hasRecordId" access="global" >
    <aura:attribute name="foundationName" type="Sobject"/>
    <aura:attribute name="fields" type="String[]" default="['Comment__c']" />
    <aura:attribute name="foundationId" type="String"/>
    <aura:handler event="c:foundationName" action="{!c.foundationId}"/>
    <lightning:notificationsLibrary aura:id="notifLib" />
	<lightning:card title="{!v.foundationName.Name +' Comment'}">
        <lightning:recordForm recordId="{!v.foundationId}" 
JS Controller
    handleSuccess: function (cmp, event, helper) {
            "title": "Record updated!",
            "message": "The record "+ event.getParam("id") + " has been updated successfully.",
            "variant": "success"

    handleError: function (cmp, event, helper) {
            "title": "Something has gone wrong!",
            "message": event.getParam("message"),
            "variant": "error"

Please help me I'm stuck there I'm new in lightning component
Hi All,

I am trying to create a twitter feed component for use in Salesforce communities and because I need to use the JS supplied by Twitter I am using a Lightning:container, however I cannon't seem to get the JS to load for me and I have been trying for days.

I have created an index.html file and zipped that up with the "widgets.js" file supplied by Twitter and saved it to the static resources in a file called spptest. I have also whitelisted twitter in the community CSP. Please see my code below and If you can spot any issues with it please let me know.

Thanks, James

<!DOCTYPE html>
    <a class="twitter-timeline" href="https://twitter.com/TwitterDev?ref_src=twsrc%5Etfw">Tweets by TwitterDev</a>

<aura:component implements="forceCommunity:availableForAllPageTypes, flexipage:availableForAllPageTypes" access="global">
        <lightning:container src="{!$Resource.spptest + 'index.html'}"/>
        <aura:attribute name="TwitterHandle" type="String" />


<design:component label="Twitter Feed 2.0">
        <design:attribute name="TwitterHandle" label="Twitter Handle" description="Please insert the Twitter handle you would like to display" />
            <design:supportedFormFactor type="Large"/>
            <design:supportedFormFactor type="Small"/>

This is the result I get when the component is in the community:
User-added image
how to send list<strings> from parent component  to child component  using aura attribute in lightning
 (note : I dont want aura methods or events ) 
I have created a custom report type to be able to add "Article Record Type" in my report. But when I do add the fields that I need; they are blank?

Any idea how I can get the Article record type field displaying the value?

User-added image

I would like to save an email as MD5 hash and have the following code which fails with BLOB is not a valid UTF-8 string
Blob targetBlob = Blob.valueOf(o.Email__c);
	    Blob hash = Crypto.generateDigest('MD5', targetBlob);
What do I need to do to remove this error message?

Hi All,

I am trying to generate an access token for uploading a file from salesforce to Dropbox.

I got the code by referring to 
these sites.

Currently, my apex code is

public class dropBoxApi{
    Public String code ;
    Public String accesstoken;
    public String fileBody{get;set;}
    public dropBoxApi()
        code = ApexPages.currentPage().getParameters().get('code') ;
        if(code != '' && code != null)
            AccessToken() ;

    public PageReference DropAuth()
        system.debug('UPLOAD'+accessToken );
        PageReference pg = new PageReference('https://www.dropbox.com/1/oauth2/authorize?response_type=code&client_id='{appKey}'&redirect_uri=https://c.na46.visual.force.com/apex/DropBoxPage&state=Mytesting') ;
        return null;

    public void AccessToken()
        //Getting access token from dropbox
        String appKey='***********';
        String appSecreatKey='***********';
        String tokenuri = 'https://api.dropbox.com/oauth2/token?grant_type=authorization_code&code='+code+'&redirect_uri=https://c.na46.visual.force.com/apex/DropBoxPage'; 
        HttpRequest req = new HttpRequest();

        Blob headerValue = Blob.valueOf('{appKey}' + ':' + '{appSecretKey}');
        String authorizationHeader = 'BASIC ' + EncodingUtil.base64Encode(headerValue);
        req.setHeader('Authorization', authorizationHeader);
        Http h = new Http();
        String resp;
        HttpResponse res = h.send(req);
        resp = res.getBody();
        JSONParser parser = JSON.createParser(resp);
        while (parser.nextToken() != null) {
            if ((parser.getCurrentToken() == JSONToken.FIELD_NAME)){
                String fieldName = parser.getText();
                if(fieldName == 'access_token') {
                    accesstoken = parser.getText();
        system.debug('accessToken:'+accessToken );
        System.debug(' You can parse the response to get the access token ::: ' + resp);

and my visual force page is

<apex:page controller="dropBoxApi"> <apex:form > <apex:pageblock > <apex:inputFile value="{!fileBody}" /> <apex:commandbutton action="{!DropAuth}" value="Upload Dropbox"> </apex:commandbutton></apex:pageblock> </apex:form> </apex:page>

My question is what is value of 'code' at line   
'code=ApexPages.currentPage().getParameters().get('code') '

I have tried both secret key and app key which I got from Dropbox app console.
But I get "code doesn't exist or has expired" error.
I'm using the Dropbox app from the AppExchange. It worked fine until recently, but now when I click on Dropbox Options menue, I get the following error:
Visualforce Error
Dropbox_for_SF.DropboxClient.UnknownException: Script-thrown exception 

An unexpected error has occurred. Your solution provider has been notified. (Dropbox_for_SF)

I don't think I made any changes recently, so not really sure why this is happening now.
Please help,
Thank you

  • October 07, 2016
  • Like
  • 0
I want to integrate Salesforce with Drop box.
Please any one help me to do that. or can anyone share any dropbox integration link Document link
Thank you
Je ne parviens pas à installer DropBox pour Salesforce

Is it possible to use external storage to store Attachments? 

As a company we have large files that sales need to upload and associate documents to opportunities. We also want to save on the Salesforce storage costs.

To the sales user it would appear that the attachment is being uploaded into SFDC but behind the scenes it would saved on something like Sharepoint, or Dropbox. SFDC Links to Edit/View/Del the attachment would be redirected to do the operation on the file in external storage.
Hi All,

VF Page:

<apex:page controller="DropboxController">
        <apex:commandbutton action="{!DropAuth}" value="Dropbox Authentication">


public class DropboxController
    //Fetched from URL
    String code ;
    public DropboxController()
        code = ApexPages.currentPage().getParameters().get('code') ;
        //Get the access token once we have code
        if(code != '' && code != null)
            AccessToken() ;
    public PageReference DropAuth()
        PageReference pg = new PageReference('https://www.dropbox.com/1/oauth2/authorize?response_type=code&client_id=vaabb5qz4jv28t5&redirect_uri=https://c.ap1.visual.force.com/apex/DropboxPage&state=Mytesting') ;
        return pg ;
    public void AccessToken()
        //Getting access token from dropbox
        String tokenuri = 'https://api.dropbox.com/1/oauth2/token?grant_type=authorization_code&code='+code+'&redirect_uri=https://c.ap1.visual.force.com/apex/DropboxPage'; 
        HttpRequest req = new HttpRequest();
        Blob headerValue = Blob.valueOf('vaabb5qz4jv28t5' + ':' + 'dpmmll522bep6pt');
        String authorizationHeader = 'BASIC ' + EncodingUtil.base64Encode(headerValue);
        req.setHeader('Authorization', authorizationHeader);
        Http h = new Http();
        String resp;
        HttpResponse res = h.send(req);
        resp = res.getBody();
        System.debug(' You can parse the response to get the access token ::: ' + resp);

I got the key,secrete and redirect url from dropbox , and set it in the above code
Now i got the response as a access token from debug log

{"access_token": "fdNB-pM_uYsAAAAAAAAANrefVrISVc9rcvRdrUmHqq46W26cDanUSzgzUwIQHr_", "token_type": "bearer", "uid": "282967343"}

but i did not get user profile infomation and app details from dropbox,

Please help me i am new for integration
as well as please explain about how to pass endpoint url with example.

Hi All,

Please help me regarding integration between dropbox and salesforce ,

This Below link very useful to me  :

but i am unable to get user profile information or app information from dropbox, please help me how to get those information , 

I did connection between salesforce to dropbox , i have access token ,api key, api secrete all things ,
but i don't know how pass request and how to get response as user details .

Please help me

Anyone help me. How i can upload file to dropbox with dropbox api?  Thanks

As we are moving CRM and other sales&marketing realted applications to SFDC, and i am currently comparing the content management capabilities of sharepoint with SFDC . 

I know that SFDC do have some limitations on content management.and what i am wondering are as follows

1.  is there any best practise of sfdc content management, 

2. how SFDC to integration with content management system, sharepoint etc

3. can sfdc integration with online file sync app, dropbox etc.






          Here i need to do integration with Dropbox from salesforce. How to proceed, can anyone tell me. If any relevent links are there, please share with me. it will be very helpful to me. Thanks for your support and help.



          Here i need to do integration with Dropbox from salesforce. How to proceed, can anyone tell me. If any relevent links are there, please share with me. it will be very helpful to me. Thanks for your support and help.


I wanted to connect Dropbox REST API through Apex class.I was finding difficulty to access oAuth access token.

Kindly let me know the process.



I had written code for 3 fileds (FirstName,LastName,PhysicalAttributes) for inserting record in Contact Object.It was successfully Saving Record.
But when i am trying to insert Record using FirstName and LastName i am getting error like

Error creating record
Upsert failed. First exception on row 0; first error: INVALID_TYPE_ON_FIELD_IN_RECORD, Physical Attributes: value not of required type: : [Physical_Attributes__c]

Because while Inserting Records we can skip some Fields(i.e;Non-Mandatory)Fields.Can any one Plz suggest me.

Here is my code:

    <lightning-card title="Insert Contact" icon-name="standard:contact">
            <div class="slds-p-around_x-small">
                <lightning-input label="FirstName" value={rec.FirstName} onchange={handleFirstNameChange}></lightning-input>
                <lightning-input label="LastName" value={rec.LastName} onchange={handleLastNameChange}></lightning-input>
                <lightning-input type="text" label="PhysicalAttributes" value={rec.Physical_Attributes__c} onchange={handlePhysicalAttributesChange}></lightning-input><br/>
                <lightning-button label="Save" onclick={handleClick}></lightning-button>

import { LightningElement,track } from 'lwc';
import createContact from '@salesforce/apex/insertContactApexWeb.saveContactRecord';
import {ShowToastEvent} from 'lightning/platformShowToastEvent';
import FIRSTNAME_FIELD from '@salesforce/schema/Contact.FirstName__c';
import LASTNAME_FIELD from '@salesforce/schema/Contact.LastName__c';
import PHYSICALATTRIBUTES_FIELD from '@salesforce/schema/Contact.Physical_Attributes__c';
export default class InsertContact extends LightningElement {
    @track firstname = FIRSTNAME_FIELD;
    @track lastname = LASTNAME_FIELD;
    @track physicalattributes = PHYSICALATTRIBUTES_FIELD;
   @track  rec = {
        FirstName : this.firstname,
        LastName : this.lastname,
        Physical_Attributes__c: this.physicalattributes
    handleFirstNameChange(event) {
        this.rec.FirstName = event.target.value;
    handleLastNameChange(event) {
        this.rec.LastName = event.target.value;
    handlePhysicalAttributesChange(event) {
        this.rec.Physical_Attributes__c= event.target.value;
    handleClick() {
        createContact({ con : this.rec })
       .then(result => {
            // Clear the user enter values
            this.rec = {};
            window.console.log('result ===> '+result);
            // Show success messsage
            this.dispatchEvent(new ShowToastEvent({
                title: 'Success!!',
                message: 'Contact Created Successfully!!',
                variant: 'success'
        .catch(error => {            
            this.error = error.message;
            window.console.log('error body--'+error.body.message);
                new ShowToastEvent({
                    title: 'Error creating record',
                    message: error.body.message,
                    variant: 'error',
            window.console.log("error", JSON.stringify(this.error));


Apex Class:
public with sharing class insertContactApexWeb {
    public static void saveContactRecord(Contact con){
            insert con;
        catch(Exception ex) {
            throw new AuraHandledException(ex.getMessage());
I have an active user that has a customer community license.  That user is able to own contact records, but I can't seem to change ownership of an account to that user.

In the documentation, I found this statement: "Community Users can't own community-enabled accounts".  Is that my issue?  What does it mean for an account to be "community-enabled"?  Is there a work-around?  My goal here is to have a community licensed user that can own accounts that are outdated/inactive.


- Randy Trigg
  • September 17, 2019
  • Like
  • 1

I have a custom Lightning Web Component that allows modification of multiple records inside of modal. Once a record is updated, I reload that same record-id, but the old data shows up instead of the new data. After thorough research, I have concluded that the Lightning Data Service is at fault here. It is caching the data in the built-in ViewState most likely. The only way to get a data refresh is by refreshing the entire web page. I found multiple articles that explain how to turn off Secure and Persistent Browser Caching, but this is an unacceptable solution, as the entire Organization will take a performance hit, to support my little Lightning Web Component. Also salesforce insists that you don't do it production:



How do I invalidate or send a ChangeNotify Event to the Lightning Data Service (in the context of Lightning Web Components), so my lightning-record-edit-form shows the updated data, instead of the old data (without refreshing the entire web page of course)?
Just wanted to share a problem we had that I haven't seen elsewhere.

We built a Flow Definition with the Process Builder and Added it to our Managed Package

Then we decided to Deactivate the Flow before uploading the Package as some orgs that we support may not use it.

When we tried to install our Managed Package, it failed, saying that the Flow had been Deleted.

It clearly had NOT been deleted, so we were stumped.  Salesforce Support couldn't help us and escalated the Case.

I began studying the Setup Audit Trail and noticed strange entries that happened at the same time I Activated and Deactivated the Flow:

When my Flow was "Activated",  the system was creating a 'Flow Trigger" and a "Workflow Rule" behind the scenes with the same name as my flow, though adding a long id number at the end.

The PROBLEM is that when I deactivated the Flow, the system didn't just deactivate the "backend" Workflow Rule, but THEN it DELETED both the 'Flow Trigger' and the "backend" Workflow Rule!  I don't understand why it was actually deleted? THIS deleted hidden Trigger and Workflow is what caused the package install to fail.

On a hunch I decided to Activate the Flow and build a new package again.  Sure enough, the package uploaded and installed perfectly.

Salesforce needs to put some documentation around this, or at least have a warning popup when you try to Deactivate a Flow that is already in a package.

How are we supposed to know that deactivation is deleting components that we didn't even know were there in the first place?

Hope this saves someone else some time.