Skip to content

Instantly share code, notes, and snippets.

View msrivastav13's full-sized avatar
🎯
Focusing

Mohith Shrivastava msrivastav13

🎯
Focusing
View GitHub Profile
@msrivastav13
msrivastav13 / searchApp
Last active January 15, 2018 21:13
Code to Show LockerService In action
<aura:application extends="force:slds">
<c:searchCmp />
</aura:application>
@msrivastav13
msrivastav13 / searchAppV2
Created January 15, 2018 21:32
searchAppV2
<aura:application extends="force:slds">
<c:searchCmp />
</aura:application>
@msrivastav13
msrivastav13 / CommunityBuilderPickListUtil
Created February 19, 2018 18:14
Gets the Field Picklist labels and values from the Object Metadata
global class CommunityBuilderPickListUtil extends VisualEditor.DynamicPickList{
global override VisualEditor.DataRow getDefaultValue(){
VisualEditor.DataRow defaultValue = new VisualEditor.DataRow('Product Family', 'Product Family');
return defaultValue;
}
global override VisualEditor.DynamicPickListRows getValues() {
VisualEditor.DynamicPickListRows myValues = new VisualEditor.DynamicPickListRows();
Schema.DescribeFieldResult fieldResult = Product2.Family.getDescribe();
@msrivastav13
msrivastav13 / generatepkgXML.sh
Created October 12, 2018 04:18
Generates package.xml from the Unmanaged container/Managed Package or Changesets
#!/bin/bash
if [ $# -lt 1 ]
then
echo Usage: generatepkgXML.sh orgalias packageName
exit
fi
## Retrieve the PackageXML from Unmanaged Container
if [ $# -lt 1 ]
then
echo Usage: deploypkg.sh orgalias
exit
fi
## Create a temp directory for mdapi
mkdir ./mdapipkg
sfdx force:source:convert -r ./force-app -d ./mdapi
@msrivastav13
msrivastav13 / retrieveDXSource.sh
Created November 4, 2018 00:33
Retrieves the source in DX format from the unmanaged package
#!/bin/bash
if [ $# -lt 1 ]
then
echo Usage: retrieveDXSource.sh orgalias packageName
exit
fi
## Retrieve the PackageXML from Unmanaged Container
@msrivastav13
msrivastav13 / wordcloud.html
Created June 14, 2019 23:24
wordcloud lwc demo
<template>
<lightning-card title="Word Cloud Demo">
<canvas class="my_canvas" lwc:dom="manual"></canvas>
</lightning-card>
</template>
@msrivastav13
msrivastav13 / Rollback_platform_event
Created April 27, 2020 13:41
Rollback platform events example with Savepoint
List<PlatformEvents__e > events = new List<PlatformEvents__e >();
// Created a PlatformEvents with a Message__c field of 30 characters only, so second event fails
events.add(new PlatformEvents__e(Message__c='Test'));
events.add(new PlatformEvents__e(Message__c='ldjgkfjgkfjkjhkgjhkgjhkghkghkgkhkghkghkghkghkghghkghkghkghkghghkghkghkghkghghkghkghkghkghghkghkghkghkghghkghkghkghkgh'));
Savepoint sp = Database.setSavepoint();
// Call method to publish events
List<Database.SaveResult> results = EventBus.publish(events);
@msrivastav13
msrivastav13 / Questionnaireflow.json
Created June 15, 2020 01:13
Questionnaireflow.json
{
"size" : 1,
"totalSize" : 1,
"done" : true,
"queryLocator" : null,
"entityTypeName" : "Flow",
"records" : [ {
"attributes" : {
"type" : "Flow",
"url" : "/services/data/v49.0/tooling/sobjects/Flow/301B00000006sh9IAA"
{
"Metadata": {
"actionCalls": [{
"actionName": "emailSimple",
"actionType": "emailSimple",
"connector": null,
"dataTypeMappings": [],
"description": null,
"faultConnector": null,
"inputParameters": [{