Skip to content

Instantly share code, notes, and snippets.

View Naveendhanaraj's full-sized avatar

Naveen Dhanaraj Naveendhanaraj

View GitHub Profile
printPdf(event) {
getMetadataValue ({
       strDeveloperName: 'Pass_Query'
     }).then((result) => {
this.passquerymdt =  result;
if(result){
this[NavigationMixin.Navigate]({
type: "standard__webPage",
attributes: {
url:
@Naveendhanaraj
Naveendhanaraj / LightningRecordEditForm
Created September 21, 2020 10:18
Lightning Record Edit Form js file
import { LightningElement } from 'lwc';
import { NavigationMixin } from 'lightning/navigation';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
export default class LightningRecordEditForm extends NavigationMixin (LightningElement) {
redirect = true;
resetpage = false;
handleSuccess(event) {
const even = new ShowToastEvent({
title: 'Success!',
import { LightningElement } from 'lwc';
import { NavigationMixin } from 'lightning/navigation';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
export default class AccountOverride extends NavigationMixin (LightningElement) {
redirect = true;
resetpage = false;
handleSuccess(event) {
const even = new ShowToastEvent({
title: 'Success!',
@Naveendhanaraj
Naveendhanaraj / Lightning Record Edit Form
Created September 21, 2020 08:25
Lightning Record Edit Form in Lightning web component
<template>
<lightning-card>
<lightning-record-edit-form object-api-name='Account' onsuccess={handleSuccess}
onerror={handleError} >
<header class="slds-modal__header">
<div class="slds-text-heading_medium slds-modal__title slds-hyphenate">New Account Details</div>
</header>
<div class="slds-page-header">
<div class="slds-page-header__row">
Account Detail
Note:
Add this component to New Button or Record Page to Test
<!----Component--->
<aura:component implements="force:appHostable,flexipage:availableForRecordHome,flexipage:availableForAllPageTypes">
<aura:dependency resource="markup://force:navigateToURL" type="EVENT"/>
<lightning:button label="Andy Young" title="Andy Young" onclick="{!c.navigate}" variant="success"/>
</aura:component>
public class RefreshTokenClass {
private auth_response rt;
public string str {get; set;}
public string clientid {get; set;}
public string clientsecret {get; set;}
public pagereference auth_Step_1(){
String auth_url = 'https://login.salesforce.com/services/oauth2/authorize';
String params =
'?response_type=code' +
@Naveendhanaraj
Naveendhanaraj / RefreshTokenVFSLDS.html
Last active August 7, 2018 04:27
Get Refresh Token by giving Consumer Secret and Consumer Key
<apex:page controller="RefreshTokenClass" >
<apex:slds />
<apex:form >
<div class="slds-form slds-form_stacked">
<div class="slds-form-element slds-size_2-of-4">
<label class="slds-form-element__label" for="input-id-01"><b>Client Id</b></label>
<div class="slds-form-element__control">
<apex:inputText id="clienti" styleClass="slds-input" value="{!clientid}"/>
</div>
</div>
<lightning:layoutItem flexibility="auto" padding="around-small">
<div class="custom-box">
<lightning:select value="{!v.Opportunity.StageName}">
<option value="">Choose one...</option>
<aura:iteration items="{!v.picklistValues}" var="item">
<option value="{!item.value}">
{!item}
</option>
</aura:iteration>
</lightning:select>
<aura:component controller="PickListController" access="global" >
<aura:attribute name="sObjectName" type="String" />
<aura:attribute name="fieldName" type="String" />
<aura:attribute name="picklistValues" type="Object" />
<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
</aura:component>
({
doInit : function(component) {
var action = component.get("c.getPickListValuesIntoList");
action.setParams({
objectType: component.get("v.sObjectName"),
selectedField: component.get("v.fieldName")
});
action.setCallback(this, function(response) {
var list = response.getReturnValue();
component.set("v.picklistValues", list);