Skip to content

Instantly share code, notes, and snippets.

View dhaniksahni's full-sized avatar

Dhanik Lal Sahni dhaniksahni

View GitHub Profile
@RestResource(urlMapping='/v1/account/*')
global class AccountPatchAPI {
@HttpPatch
global static Account patch() {
RestRequest req = RestContext.request;
// Deserialize the JSON string into name-value pairs
// Iterate through each parameter field and value
List<APIMapper__c> mappers=[select id,FieldName__c,MappedFieldAPI__c from APIMapper__c where name='AccountPatch'];
Map<string,string> mapFields=new Map<string,string>();
global class FieldExplorerController
{
@Auraenabled(cacheable=true)
public static List<string> getObjects()
{
List<string> sObjectList = new List<string>();
for(Schema.SObjectType objTyp : Schema.getGlobalDescribe().Values()){
String name = objTyp.getDescribe().getName();
if((!name.containsignorecase('history') && !name.containsignorecase('tag')&&
<template>
<lightning-card>
<div class="divcenter">SalesforceCodex Field's Access Explorer</div>
<lightning-layout multiple-rows>
<lightning-layout-item size="2" padding="around-small">
<lightning-combobox name="objectName"
label="Object"
value=""
placeholder="Select Object"
global class FieldExplorerController {
//Retrieve All Custom Object in Org
@Auraenabled(cacheable=true)
global static List<String> getAllCustomSObjects()
{
List<String> sObjectList = new List<String>();
for(Schema.SObjectType objTyp : Schema.getGlobalDescribe().Values())
{
Schema.DescribeSObjectResult describeSObjectResultObj = objTyp.getDescribe();
/* parent.css */
divcenter {
text-align: center;
}
.divSize
{
height: 400px;
}
//Service Request Interface
public interface IServiceRequest {
string createServiceRequest(ServiceRequestDTO request);
}
/******************************************************************************
* Author: Dhanik Lal Sahni
* Date: Oct 8, 2019
* Descpription: Implementation class for IServiceRequest to creating Case.
*/
public class CaseServiceRequest implements IServiceRequest{
//validate information
private string validateServiceRequest(ServiceRequestData data){
/******************************************************************************
* Author: Dhanik Lal Sahni
* Date: Oct 8, 2019
* Descpription: Implementation class for IServiceRequest to change account's address.
*/
public class AddressChangeServiceRequest implements IServiceRequest{
//validate information
private string validateServiceRequest(ServiceRequestData data){
/******************************************************************************
* Author: Dhanik Lal Sahni
* Date: Oct 8, 2019
* Descpription: Service Request Paramter information.
*/
public class ServiceRequestData {
public String accountId;
public String dateSent;
public String origin;
@dhaniksahni
dhaniksahni / ViewAWSFile.cmp
Created January 23, 2020 16:30
Download S3 File In Lighting
<aura:component
controller="S3Controller"
implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction"
access="global">
<aura:attribute name="data" type="String" />
<aura:attribute name="recordId" type="String" />
<aura:attribute name="showFileLink" type="boolean" />
<lightning:button variant="brand" label="View Files" onclick="{!c.getData}" />
<aura:if isTrue="{!v.showFileLink}">
<a href="{!v.data}">Download File</a>