Skip to content

Instantly share code, notes, and snippets.

View karkranikhil's full-sized avatar
🎯
Focusing

nikhil karkra karkranikhil

🎯
Focusing
View GitHub Profile
c-physician-form lightning-input lightning-primitive-input-simple>div{
display: flex;
}
c-physician-form lightning-input lightning-primitive-input-simple>div>label{
color: #27215e !important;
font-size: 15px !important;
font-weight: bold !important;
flex: 0 1 auto !important;
}
c-physician-form lightning-input lightning-primitive-input-simple>div>label>abbr{
@karkranikhil
karkranikhil / picklist.soql
Created March 19, 2024 08:59
SOQL to see picklist
SELECT EntityParticle.DeveloperName, Label, Value, IsActive
FROM PicklistValueInfo
WHERE EntityParticle.EntityDefinition.QualifiedApiName = 'Opportunity'
ORDER BY EntityParticleId, Label
//If you need to see all picklist controlling fields ( dependencies ), check this SOQL out:
SELECT EntityParticle.DeveloperName, Label, Value, IsActive, EntityParticle.IsDependentPicklist, EntityParticle.FieldDefinition.ControllingFieldDefinition.DeveloperName
FROM PicklistValueInfo
WHERE EntityParticle.EntityDefinition.QualifiedApiName = 'Account'

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database

@karkranikhil
karkranikhil / componentEvent.evt
Created June 27, 2021 06:52 — forked from pozil/componentEvent.evt
Lightning - Passing data up the component hierarchy via a component event
<aura:event type="COMPONENT">
<aura:attribute name="param" type="String"/>
</aura:event>
@karkranikhil
karkranikhil / filePreviewAndDownloadController.cls
Created October 28, 2020 03:30
file preview and upload in lwc
public with sharing class filePreviewAndDownloadController {
@AuraEnabled(cacheable=true)
public static Map<ID, String> getRelatedFilesByRecordId(String recordId) {
// Get record file IDs
List<ContentDocumentLink> files = [SELECT ContentDocumentId FROM ContentDocumentLink WHERE LinkedEntityId = :recordId];
List<ID> fileIDs = new List<ID>();
for (ContentDocumentLink docLink : files) {
fileIDs.add(docLink.ContentDocumentId);
}
@karkranikhil
karkranikhil / carColorPickerCss
Created October 14, 2020 00:36
Car Color Picker in lwc
span{
height:25px;
width:25px;
border-radius:50%;
margin:10px;
display:inline-block;
background-color:#bbb;
}
span:hover{
cursor:pointer;
button {
border: none; /* Remove borders */
color: white; /* Add a text color */
padding: 14px 28px; /* Add some padding */
cursor: pointer; /* Add a pointer cursor on mouse-over */
background-color: #e7e7e7;
color: black;
border:1px solid black;
}
.green{
/*
* @class FileUploaderClass
* @desc Lets you uplaod a file in Salesforce by giving a base64 string of the
* file, a name for the file, and the Id of the record that you want to attach
* the file to.
*
* @example:
* FileUploaderClass.uploadFile(myBase64String, 'Invoice.pdf', '906F0000000kG2UIAU')
*/
public class FileUploaderClass {
@karkranikhil
karkranikhil / API
Created July 18, 2020 00:11
Salesforce JS 1 certification session 3
<!DOCTYPE html>
<html>
<head>
<title>Browser and Events</title>
</head>
<body>
<button onclick="showAlert();">Show</button>
<button onclick="cancelAlert();">Cancel</button>
/***Dates */
//JavaScript counts months from 0 to 11. January is 0. December is 11.
new Date()
// new Date(year, month, day, hours, minutes, seconds, milliseconds)
new Date(2018, 11, 24, 10, 33, 30, 0); // month is 0 -11
// new Date(milliseconds)
var d = new Date(86400000);
// JavaScript stores dates as number of milliseconds since January 01, 1970, 00:00:00 UTC (Universal Time Coordinated).