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:handler event="force:showToast" action="{!c.handleToastEvent}"/> |
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
| var editRecordEvent = $A.get("e.force:editRecord"); | |
| editRecordEvent.setParams({ | |
| "recordId": <record_id_here> | |
| }); | |
| editRecordEvent.fire(); |
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
| SetupEntityAccess[] accessSettings = | |
| [SELECT Id | |
| FROM SetupEntityAccess | |
| WHERE SetupEntityId IN (SELECT Id | |
| FROM ApexPage | |
| WHERE NamespacePrefix = :your_namespace AND Name = :your_page) | |
| AND ParentId IN (SELECT PermissionSetId | |
| FROM PermissionSetAssignment | |
| WHERE AssigneeId = :UserInfo.getUserId())]; |
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
| mtl_sflog.LogEntry log = new mtl_sflog.LogEntry(); | |
| log.Message = 'Some custom log'; | |
| log.LogLevel = 'Fatal'; | |
| log.LogDate = Datetime.now(); | |
| mtl_sflog.Logger.addLog(log); | |
| mtl_sflog.Logger.saveLogs(); |
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
| try { | |
| // Some code here | |
| } | |
| catch (Exception ex) { | |
| mtl_sflog.Logger.addErrorLog(ex); | |
| mtl_sflog.Logger.saveLogs(); | |
| } |
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
| mtl_sflog.Logger.addErrorLog('Some error'); | |
| mtl_sflog.Logger.saveLogs(); |
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
| mtl_sflog.Logger.addInfoLog('Some information'); | |
| mtl_sflog.Logger.saveLogs(); |
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
| global with sharing class CustomDebugLogSaver extends mtl_sflog.LogSaverBase { | |
| private static Map<String, System.LoggingLevel> SFLogLevelMappings = new Map<String, System.LoggingLevel> { | |
| mtl_sflog.LogEntry.LOG_LEVEL_INFO => System.LoggingLevel.INFO, | |
| mtl_sflog.LogEntry.LOG_LEVEL_ERROR => System.LoggingLevel.ERROR, | |
| mtl_sflog.LogEntry.LOG_LEVEL_DEBUG => System.LoggingLevel.DEBUG | |
| }; | |
| global override void saveLogs(mtl_sflog.SaveLogsRequest request) { | |
| Integer logCount = request.LogsToSave.size(); |
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 class Field { | |
| public Field(Schema.FieldSetMember f) { | |
| this.DBRequired = f.DBRequired; | |
| this.APIName = f.fieldPath; | |
| this.Label = f.label; | |
| this.Required = f.required; | |
| this.Type = String.valueOf(f.getType()); | |
| } | |
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 FieldSetFormController { | |
| @AuraEnabled | |
| public static FieldSetForm getForm(Id recordId, String objectName, String fieldSetName) { | |
| FieldSetForm form = new FieldSetForm(); | |
| form.Fields = getFields(recordId, objectName, fieldSetName); | |
| form.Record = getRecord(recordId, objectName, form.Fields); | |
| return form; | |
| } |