Skip to content

Instantly share code, notes, and snippets.

View jenishshingala's full-sized avatar

Jenish Shingala jenishshingala

View GitHub Profile
@jenishshingala
jenishshingala / code
Created July 30, 2014 10:38
Account picklist ,by clicking on account it displays the related contacts
apex page:---
<apex:page controller="picacc_con_cls" >
<apex:form >
<apex:pageBlock title="Account Name">
Account Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<apex:selectList value="{!selectedAccId}" size="1">
<apex:selectOptions value="{!AccountNames}" />
<apex:actionSupport event="onchange" reRender="conlist"/>
/*
* Author: Jenish Shingala
* Description:Donut Chart Controller/
*
*/
public class donutChartController {
Public List<AggregateResult> lstOfOpprotunity{get;set;}
Public String Jsondata{get;set;}
@jenishshingala
jenishshingala / OpportunitiyStackAreaChartPage
Last active November 19, 2015 15:47
StackAreaChart_Opportunity_Close_Count
<!--
* Author: Jenish Shingala
* Description: Stack Area Chart Page.
This page Shows Last 30 days Record Count of Closed Won/Lost Opportunities.
-->
<apex:page controller="opportunityStackAreaChart" sidebar="false">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<!--D3 Libraries-->
<apex:includeScript value="{!$Resource.d3}"/>
<apex:page standardStylesheets="false" sidebar="false" applyBodyTag="false" docType="html-5.0">
<html xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<head>
<apex:stylesheet value="{!URLFOR($Resource.SLDS090, 'assets/styles/salesforce-lightning-design-system-vf.css')}" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
</head>
<body>
<!-- Remote Objects definition to set accessible sObjects and fields(take all fields which you want to query) -->
<apex:remoteObjects >
@jenishshingala
jenishshingala / Apex class
Created February 3, 2017 15:44
Visualforce Page
public class testpagecls {
public List<Test__c> lstOfTest{get;set;}
public string testjson{get;set;}
public testpagecls(){
lstOfTest = [select id,name from Test__c];
lstOfTest.sort();
testjson = json.serialize(lstOfTest);
}
}
@jenishshingala
jenishshingala / CloneOpportunityWithProducts.cls
Created May 30, 2018 15:02
Clone With Opportunity Product
public with sharing class CloneOpportunityWithProducts{
@AuraEnabled
public static string cloneOpportunity(Id opportunityId) {
string query='select ';
string queryOLI='select ';
List<Opportunitylineitem> lstOLI = new List<Opportunitylineitem>();
List<Opportunitylineitem> lstOLIToInsert = new List<Opportunitylineitem>();
Schema.DescribeSObjectResult r = Opportunity.sObjectType.getDescribe();
List<String> apiNamesOpportunity = new list<String>();
for(string apiName : r.fields.getMap().keySet()){
public class CreateQuote{
@AuraEnabled
public static Opportunity getOpportunity(Id taskid) {
system.debug('ID-->'+taskid);
//Get all fields which needs to be prepopulated on Quote .
Task objTask = [SELECT Id, whatid FROM task WHERE Id = :taskid];
Opportunity objOpportunity = [select id,account.name,account.billingcity,account.billingcountry,account.billingstate,
account.billingpostalcode,accountid,name,account.BillingStreet from opportunity where id=:objTask.whatid];
return objOpportunity;
}