This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ({ | |
| init: function(cmp, event, helper) { | |
| var recordId = cmp.get('v.recordId'); | |
| var videoField = cmp.get('v.videoField'); | |
| if (!recordId || !videoField) { | |
| console.log('The record id or video field is missing.'); | |
| return; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <design:component > | |
| <design:attribute name="videoField" label="Video Field" description="The api name of the field from the given object that has the video's source URL." /> | |
| <design:attribute name="videoHeight" label="Video Height" description="The height for the video. Any CSS value is acceptable." default="400px" /> | |
| <design:attribute name="videoWidth" label="Video Width" description="The width for the video. Any CSS value is acceptable." default="100%" /> | |
| </design:component> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <aura:component implements="flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes" access="global" controller="RecordVideoViewerController"> | |
| <aura:attribute name="videoField" type="String" description="The api name of the field from the given object that has the video's source URL." /> | |
| <aura:attribute name="videoHeight" type="String" description="Height for the video player." /> | |
| <aura:attribute name="videoWidth" type="String" description="Width for the video player." /> | |
| <aura:attribute name="videoSrcUrl" type="String" access="private" /> | |
| <aura:handler name="init" value="{!this}" action="{!c.init}" /> | |
| <div class="slds-box slds-theme_default"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Boolean hasCustomPermission = FeatureManagement.checkPermission('<custom_permission_api_name>'); | |
| if (hasCustomPermission) { | |
| // Allow custom feature | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public with sharing class FieldSetFormControllerV2 { | |
| @AuraEnabled | |
| public static FieldSetForm getForm(Id recordId, String objectName, String fieldSetName) { | |
| FieldSetForm form = new FieldSetForm(); | |
| form.Fields = getFields(recordId, objectName, fieldSetName); | |
| return form; | |
| } | |
| private static List<Field> getFields(Id recordId, String objectName, String fieldSetName) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <design:component > | |
| <design:attribute name="fieldSetName" label="Field Set Name" description="API Name of the field set to use." /> | |
| <design:attribute name="sObjectName" label="Object Name" description="API Name of the Object to use. This only needs to be populated when not on a record detail page." /> | |
| <design:attribute name="recordTypeId" label="Record Type Id" description="Id of the record type to use for the given Object." /> | |
| </design:component> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .THIS { | |
| background-color: white; | |
| padding: 1rem; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ({ | |
| init: function(cmp, event, helper) { | |
| console.log('FieldSetFormController.init'); | |
| var fieldSetName = cmp.get('v.fieldSetName'); | |
| var sobjectName = cmp.get('v.sObjectName'); | |
| var recordId = cmp.get('v.recordId'); | |
| if (!fieldSetName) { | |
| console.log('The field set is required.'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <aura:component controller="FieldSetFormControllerV2" implements="flexipage:availableForRecordHome,force:hasRecordId,force:hasSObjectName,flexipage:availableForAllPageTypes"> | |
| <aura:attribute name="fieldSetName" type="String" description="The api name of the field set to use from the given object." /> | |
| <aura:attribute name="recordTypeId" type="String" /> | |
| <aura:attribute name="fields" type="Object[]" access="private" /> | |
| <aura:handler name="init" value="{!this}" action="{!c.init}" /> | |
| <aura:handler event="force:refreshView" action="{!c.init}" /> | |
| <lightning:recordEditForm aura:id="test" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| handleToastEvent : function(component, event, helper) { | |
| var toastMessageParams = event.getParams(); | |
| var message = toastMessageParams.message; | |
| if (message.includes('<object_name>') && message.includes('was saved')) { | |
| // do something here such as reload your component. | |
| } | |
| } |