Lightning Component for Hours of Operation
Often we have a business use case from sales users to be able to capture Hours of Operation from their customers. Here we are going to build a reusable Lightning Component that we can place on any Object (Standard or Custom) detail page . Below are Code blocks that assembles to form our Lightning Component! Controller Class: Note** Just make sure to create a custom field with Api "Hours__c" on any sObject that you want to place this Component and update Hours. public class HoursOfOperation { @AuraEnabled public static String getUpdtHrs(String sObjName, String sObjId, String hrs) { try { //query string to pull specific record to update hours String qry = 'Select Id, Name, Hours__c From ' + sObjName + ' Where Id=\'' + sObjId +'\'' + ' Limit 1'; List<sObject> lstRcds = Database.query(qry); //check if above query returns atleast one record if (lstRcd...