Skip to content

Instantly share code, notes, and snippets.

View avnishyadav25's full-sized avatar
🏠
Working from home

Avnsh Yadav avnishyadav25

🏠
Working from home
View GitHub Profile
<apex:page standardStylesheets="false" sidebar="false" showHeader="false">
<apex:stylesheet value="{!URLFOR($Resource.imgTopdf, 'imgTopdf/bootstrap.min.css')}"/>
<apex:includeScript value="{!URLFOR($Resource.imgTopdf, 'imgTopdf/jquery.min.js')}"/>
<apex:includeScript value="{!URLFOR($Resource.imgTopdf, 'imgTopdf/bootstrap.min.js')}"/>
<apex:includeScript value="{!URLFOR($Resource.imgTopdf, 'imgTopdf/bootbox.js')}"/>
<apex:includeScript value="{!URLFOR($Resource.imgTopdf, 'imgTopdf/newjspdf.js')}"/>
<apex:includeScript value="{!URLFOR($Resource.imgTopdf, 'imgTopdf/filesever.js')}"/>
<apex:includeScript value="{!URLFOR($Resource.imgTopdf, 'imgTopdf/jspdfplugin.js')}"/>
<apex:includeScript value="{!URLFOR($Resource.imgTopdf, 'imgTopdf/jQueryMini.js')}"/>
({
fetchData: function (cmp,event,helper) {
var action = cmp.get("c.getAllAccounts");
action.setCallback(this, function(response) {
var state = response.getState();
if (state === "SUCCESS") {
var data = response.getReturnValue();
cmp.set('v.data',data);
}
// error handling when state is "INCOMPLETE" or "ERROR"
({
init: function (cmp, event, helper) {
cmp.set('v.columns', [
{label: 'Id', fieldName: 'Id', type: 'text' , editable: true},
{label: 'Name', fieldName: 'Name', type: 'text' ,editable: true},
{label: 'Annual Revenue', fieldName: 'AnnualRevenue', type: 'currency' ,editable: true},
{label: 'Description', fieldName: 'Description', type: 'text' ,editable: true},
{label: 'Number Of Employees', fieldName: 'NumberOfEmployees', type: 'number' ,editable: true},
{label: 'Industry', fieldName: 'Industry', type: 'text' ,editable: true},
{label: 'Rating', fieldName: 'Rating', type: 'text' ,editable: true},
public class DataTableInlineController {
@AuraEnabled
public static List<Account> getAllAccounts(){
return [Select Id,Name ,AnnualRevenue,Description,NumberOfEmployees,Industry,Rating,Phone from Account] ;
}
@AuraEnabled
public static void updateAccount(List<Account> acc ){
update acc;
}
<aura:component controller="DataTableInlineController" implements="flexipage:availableForAllPageTypes,force:appHostable,flexipage:availableForRecordHome,force:hasRecordId,force:hasSObjectName">
<aura:attribute name="data" type="Object"/>
<aura:attribute name="columns" type="List"/>
<aura:attribute name="errors" type="Object" default="[]"/>
<aura:attribute name="draftValues" type="Object" default="[]"/>
<aura:handler name="init" value="{! this }" action="{! c.init }"/>
<div class="slds-p-around_medium">
<apex:page showHeader="false" sidebar="false">
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/tagmanager/3.0.2/tagmanager.min.css" />
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/tagmanager/3.0.2/tagmanager.min.js"></script>
</head>
<body>
<apex:page standardstylesheets="false" showheader="false" controller="LightningDesignExperienceController"> <!--Adding Lightning Design Resource-->
<apex:stylesheet value="/resource/SLDS/styles/salesforce-lightning-design-system.min.css"/>
<apex:form >
<div class="slds">
<div class="slds-notify slds-notify--alert slds-theme--success slds-theme--alert-texture" role="alert">
<span class="slds-assistive-text">Success</span>
<h2>
<span aria-hidden="true" class="slds-button__icon">
<img src="/resource/SLDS/icons/utility/connected_apps.svg" alt="Placeholder" style="max-width: 25px;"/>
</span>
global class EmailSent_to_Acc implements Database.Batchable<sobject> {
global Database.QueryLocator start (Database.BatchableContext bc)
{
return Database.getQueryLocator([select id, Name,Account.owner.email,Account.ownerid,Custom_Created_Date__c from Account where Custom_Created_Date__c =: System.today().addDays(-1)]);
}
global void execute(Database.BatchableContext Bc, List<sObject> scope)
{
System.debug('>>>>>>>'+scope);
List<Account> accountlist=[select id, Name,Account.owner.email,Account.ownerid,Custom_Created_Date__c from Account where Custom_Created_Date__c =: System.today().addDays(-1)];
<apex:page controller="AccountInsertionController" >
<apex:form >
<apex:pageBlock >
<apex:pageBlockSection >
<!-- Type the Name of the Account -->
<apex:inputField value="{!a.Name}"/><br/>
</apex:pageBlockSection>
<apex:pageBlockSection >
<!-- Select Type of the Account -->
public class AccountInsertionController {
Account a = new Account();
public Account geta() {
return a;
}
public PageReference save() {
insert a;
PageReference pageRef = new PageReference('/'+a.id);