• Consultant Vinay Bothra
  • NEWBIE
  • 60 Points
  • Member since 2018
  • Consultant
  • Appirio

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 0
    Questions
  • 6
    Replies
I am unable to edit checkboxes in my lightning:recordForm component. The fields are editable and accessible by all profiles.

In the screenshot, you can see the pen icon while in View mode but the checkboxes are greyed out. Sure enough, when entering Edit mode, I am unable to change them.

This component is a sub-section of fields that live inside a tab on the record page. On the main record Details tab, those fields are editable. I have looked and not found this listed as a Known Issue.

Form in view modeForm in edit mode
Hello,
from today I'm experiencing a problem with the action: e.force:closeQuickAction that seems not working. Indeed the action doesn't close a pop-up window that remains opened.

That is a known issue of the Winter 20 release? I did not have the issue until last friday.

Thanks,
Salvatore
On the object level - does it do a full replace?

On identical fields - does it do a full replace or does not deploy or create a duplicate field?
 
Can I do a soql on existing custom metadata and update the record in apex class?  When I try that it says list cannot be updated.
I am unable to edit checkboxes in my lightning:recordForm component. The fields are editable and accessible by all profiles.

In the screenshot, you can see the pen icon while in View mode but the checkboxes are greyed out. Sure enough, when entering Edit mode, I am unable to change them.

This component is a sub-section of fields that live inside a tab on the record page. On the main record Details tab, those fields are editable. I have looked and not found this listed as a Known Issue.

Form in view modeForm in edit mode
Component:

<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction"
                access="global"
                controller="fileViewerCtrl">
    <!--aura doInit handler--> 
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
 
    
    <!--aura attributes-->  
    <aura:attribute name="selectedDocumentId" type="string"/>
    <aura:attribute name="lstContentDoc" type="List"/>
    <aura:attribute name="hasModalOpen" type="boolean" default="false"/>
    <header>
            <h2>Global Post Incident Reports</h2>
        </header>
    <!-- Custom DataTable to Display List Of Available ContentDocuments Start-->  
        <table class="slds-table slds-table_cell-buffer slds-table_bordered">
        <thead>
            <tr class="slds-line-height_reset">
                <th class="slds-text-title_caps" scope="col">
                    <div class="slds-truncate" title="Title" onclick="{!c.sortbyTitle}">Title</div>
                </th>
                <th class="slds-text-title_caps" scope="col">
                    <div class="slds-truncate" title="File Type" onclick="{!c.sortbyFileType}">File Type</div>
                </th>
                <th class="slds-text-title_caps" scope="col">
                    <div class="slds-truncate" title="size" onclick="{!c.sortbySize}">size(bytes)</div>
                </th>
                 <th class="slds-text-title_caps" scope="col">
                    <div class="slds-truncate" title="Last Modified Date" onclick="{!c.sortbyLastModifiedDate}">Last Modified Date</div>
                </th>
            </tr>
        </thead>
        <tbody>
            <aura:iteration items="{!v.lstContentDoc}" var="CD">
                <tr>
                    <th scope="row">
                        <div class="slds-truncate" title="{!CD.ContentDocument.Title}">
                            <!--store contentDocument Id in data-Id attribute-->
                            <a onclick="{!c.getSelected}" data-Id="{!CD.ContentDocument.Id}">{!CD.ContentDocument.Title}</a>
                        </div>
                    </th>
                    <th scope="row">
                        <div class="slds-truncate" title="{!CD.ContentDocument.FileType}">{!CD.ContentDocument.FileType}</div>
                    </th>
                    
                    <th scope="row">
                        <div class="slds-truncate" title="{!CD.ContentDocument.ContentSize}">{!CD.ContentDocument.ContentSize}</div>
                    </th>
                    <th scope="row">
                        <div class="slds-truncate" title="{!CD.ContentDocument.LastModifiedDate}">{!CD.ContentDocument.LastModifiedDate}</div>
                    </th>
                </tr>  
            </aura:iteration>
        </tbody>
    </table>
    <!-- Custom DataTable to Display List Of Available ContentDocuments End-->  
    <!--###### FILE PREVIEW MODAL BOX START ######--> 
    <aura:if isTrue="{!v.hasModalOpen}">
 <section onclick="{!c.closeModel}"
                 role="dialog"
                 aria-modal="true"
                 class="slds-modal slds-fade-in-open">
            <div class="slds-modal__container">
                <div class="slds-modal__content slds-p-around_medium slds-text-align_center"
                     style="background: transparent;">
                    <div style="width: 50%; margin: 0 auto; text-align: left">
                        <!--<lightning:fileCard> to preview file using content document Id -->
                        <lightning:fileCard fileId="{!v.selectedDocumentId}"/>
                    </div>
                </div>
            </div>
        </section>
        <div class="slds-backdrop slds-backdrop_open"></div>
    </aura:if>
    <!--###### FILE PREVIEW MODAL BOX END ######-->
    
</aura:component>

Controller:

({
    /*call apex controller method "fetchContentDocument" to get salesforce file records*/
    doInit : function(component, event, helper) {
        var action = component.get("c.fetchContentDocument");
         action.setParams({ clickedItem : 'PIR' });

        action.setCallback(this, function(response) {
            var state = response.getState();
            if (state === "SUCCESS") {
                component.set('v.lstContentDoc', response.getReturnValue());
            }
            else if (state === "INCOMPLETE") {
                // do something
            }
                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(action);  
    },
    getSelected : function(component,event,helper){
        // display model and set seletedDocumentId attribute with selected record Id   
        component.set("v.hasModalOpen" , true);
        component.set("v.selectedDocumentId" , event.currentTarget.getAttribute("data-Id")); 
        
    },
    closeModel: function(component, event, helper) {
        // for Close Model, set the "hasModalOpen" attribute to "FALSE"  
        component.set("v.hasModalOpen", false);
        component.set("v.selectedDocumentId" , null); 
    },
        sortByTitle: function(component, event, helper) {
        helper.sortBy(component, "Title");
    },
    sortByFileType: function(component, event, helper) {
        helper.sortBy(component, "FileType");
    },
        sortBySize: function(component, event, helper) {
        helper.sortBy(component, "Size");
    },
    sortByLastModifiedDate: function(component, event, helper) {
        helper.sortBy(component, "LastModifiedDate");
    }
    
})

Helper: 

({
    sortBy: function(component, field) {
        var sortAsc = component.get("v.sortAsc"),
            sortField = component.get("v.sortField"),
            records = component.get("v.lstContentDoc"),
            fieldPath = field.split(/\./),
            fieldValue = this.fieldValue;
        sortAsc = sortField != field || !sortAsc;
        records.sort(function(a,b){
            var aValue = fieldValue(a, fieldPath),
                bValue = fieldValue(b, fieldPath),
                t1 = aValue == bValue,
                t2 = (!aValue && bValue) || (aValue < bValue);
            return t1? 0: (sortAsc?-1:1)*(t2?1:-1);
        });
        component.set("v.sortAsc", sortAsc);
        component.set("v.sortField", field);
        component.set("v.lstContentDoc", records);
        this.renderPage(component);     
    },
    fieldValue: function(object, fieldPath) {
        var result = object;
        fieldPath.forEach(function(field) {
            if(result) {
                result = result[field];
            }
        });
        return result;
    },
    renderPage: function(component) {
        var records = component.get("v.lstContentDoc"),
            pageNumber = component.get("v.pageNumber"),
            pageRecords = records.slice((pageNumber-1)*10, pageNumber*10);
        component.set("v.currentList", pageRecords);
    }
})

fileViewerCtrl Apex Class:

public class fileViewerCtrl {
    @AuraEnabled 
    public static List<ContentWorkspaceDoc> fetchContentDocument(string clickedItem){
        if(clickedItem == 'PIR'){
            
            ContentWorkspace cw = [SELECT Id, RootContentFolderId FROM ContentWorkspace WHERE Name ='Global Post Incident Reports' LIMIT 1];
            
            return [SELECT Id , ContentDocumentId, ContentDocument.title,ContentDocument.FileType, ContentDocument.CreatedBy.Name, ContentDocument.ContentSize, ContentDocument.LastModifiedDate from ContentWorkspaceDoc where ContentWorkspaceId =: cw.Id LIMIT 1000];
            
        }
        else if(clickedItem == 'Release'){
            
             ContentWorkspace cw = [SELECT Id, RootContentFolderId FROM ContentWorkspace WHERE Name ='Release Deployment Plan' LIMIT 1];
            
            return [SELECT Id , ContentDocumentId, ContentDocument.title,ContentDocument.FileType, ContentDocument.CreatedBy.Name, ContentDocument.ContentSize, ContentDocument.LastModifiedDate from ContentWorkspaceDoc where ContentWorkspaceId =: cw.Id LIMIT 1000];              
        }
      else{
            
             ContentWorkspace cw = [SELECT Id, RootContentFolderId FROM ContentWorkspace WHERE Name ='PDR' LIMIT 1];
            
            return [SELECT Id , ContentDocumentId, ContentDocument.title,ContentDocument.FileType, ContentDocument.CreatedBy.Name, ContentDocument.ContentSize, ContentDocument.LastModifiedDate from ContentWorkspaceDoc where ContentWorkspaceId =: cw.Id LIMIT 1000];              
        }             
    }
}
Hello,
from today I'm experiencing a problem with the action: e.force:closeQuickAction that seems not working. Indeed the action doesn't close a pop-up window that remains opened.

That is a known issue of the Winter 20 release? I did not have the issue until last friday.

Thanks,
Salvatore
I am attempting to use an Email Alert to be sent to somebody, and would like their Reply to be sent through an Email Services. In order to make it as easy as possible, I would like for the outgoing email to the Email Services long email address to be the From. That way the user can just Reply to the email and it would automatically go through the Email Services. However, I can only use Organized-Wide verfied email addresses as the From when setting up an Email Alert.

Is there a way to use the Email Services as the From address ? This seems like something which should be very simple to do for the reasons I just gave. 
  • September 02, 2015
  • Like
  • 0
Hi Everyone,

does anyone know why the $A.get("e.force:closeQuickAction").fire(); event is not working on aura component after the Winter '20 sandbox update? Or anyone experienced this issue?