This file contains 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
/** | |
* Created by kmachhewar on 5/26/18. | |
*/ | |
({ | |
closeMessage : function(component,event){ | |
component.set('v.showMessage',false); | |
} | |
}) |
This file contains 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
/** | |
* Created by kmachhewar on 5/26/18. | |
*/ | |
({ | |
handleShowToastEvent : function(component,event,helper){ | |
event.stopPropagation(); | |
if(event.getParam('message')){ | |
var messages = component.get('v.messages'); | |
let messageItem = { | |
type : event.getParam('type'), |
This file contains 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
<!-- | |
- Created by kmachhewar on 5/26/18. | |
--> | |
<aura:component description="CustomToast"> | |
<aura:attribute name="title" type="String" default="" /> | |
<aura:attribute name="type" type="String" default="" /> | |
<aura:attribute name="message" type="String" default="" /> | |
<aura:attribute name="showMessage" type="Boolean" default="false" /> | |
<aura:attribute name="messages" type="Object[]" default="[]"/> |
This file contains 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
//Add Permission Sets to Users | |
List<User> users = [SELECT Id FROM User WHERE username in ('<USERNAME_GOES_HERE>')]; | |
List<PermissionSet> permissionSets = [SELECT Id FROM PermissionSet WHERE Name = '<PERMISSION SET API NAMES GOES HERE>']; | |
List<PermissionSetAssignment> permissionSetAssignemts = new List<PermissionSetAssignment>(); | |
for(User theUser : users){ | |
for(PermissionSet ps : permissionSets){ | |
permissionSetAssignemts.add( | |
new PermissionSetAssignment(AssigneeId = theUser.Id,PermissionSetId = ps.Id ) | |
); | |
} |
This file contains 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
function cacheQuery(){ | |
//check if the result came or not | |
if(!document.getElementById('query_results') && document.getElementsByClassName('displayWarning').length == 0 ){//no results found | |
//check if system is not waiting for the result i.e query is processing | |
if(!document.getElementsByClassName('disableWhileAsyncLoading')[0].disabled){ //button is not disabled so try again | |
document.getElementsByClassName('disableWhileAsyncLoading')[0].click(); | |
} | |
} | |
} |
This file contains 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
****** BEGIN --> APEX CLASS wise distribution ***** | |
SELECT ApexClass.Name, COUNT(ID) FROM AsyncApexJob WHERE Status = 'Queued' GROUP BY ApexClass.Name ORDER BY COUNT(ID) DESC | |
****** END --> APEX CLASS wise distribution ***** | |
****** BEGIN --> Kill Async Jobs ***** | |
for ( AsyncApexJob aJob : [ Select id ,Status, ApexClass.Name | |
from AsyncApexJob where Status='Queued' AND ApexClass.Name ='<ApexClassName>' LIMIT 150] ){ |
This file contains 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
/** | |
* @dateString : format should be like this 2018-06-10T12:34:15.29 | |
*/ | |
public DateTime parseDate(String dateString){ | |
String dateStringJSON = ('{ "thedate": "'+dateString+'"}'); | |
Map<String, DateTime> mockMap; | |
mockMap = (Map<String, DateTime>)JSON.deserialize(dateStringJSON, Map<String, DateTime>.class); | |
return mockMap.get('thedate'); | |
} |
This file contains 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 without sharing class LightningUtilController { | |
/** | |
* Method to update sobject record | |
* @param theSObject | |
* @return returns the created/updated sobject record | |
*/ | |
@AuraEnabled | |
public static SObject upsertSObjectCtrl(SObject theSObject){ | |
try{ |
This file contains 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
/** | |
* @ApexClass : JSONObject | |
* @Author : Kiran Machhewar | |
* @Description : This class can be used to parse and work with json data in apex easy. | |
*/ | |
public class JSONObject { | |
public String jsonString; //to hold the json string | |
private Object jsonObject; //to hold the deserialized json data |
This file contains 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
/** | |
* @author Kiran Machhewar | |
* @date 26th June 2018 | |
* @description Controller class for so and so page | |
*/ | |
public class ApexClass{ | |
} |
NewerOlder