Skip to content

Instantly share code, notes, and snippets.

View hicglobalsolutions's full-sized avatar
🎯
Focusing

HIC Global Solutions hicglobalsolutions

🎯
Focusing
View GitHub Profile
@AuraEnabled(cacheable=true)
public static AccountWrapper getAccount(Integer pageNumber ,Integer
recordToDisplay) {
// create an instance of wrapper class.
AccountWrapper AccountWrapperObject = new AccountWrapper();
// set the pageSize,Page(Number), total records and accounts List(using OFFSET)
AccountWrapperObject.recordToDisplay = recordToDisplay;
AccountWrapperObject.pageNumber = pageNumber;
AggregateResult[] groupedResults = [SELECT count(Id)cnt FROM Account];
AccountWrapperObject.totalAccount = Integer.valueof(groupedResults[0].get('cnt'));
public with sharing class googleAddressAutofill {
/**
* @description : Auto suggestion Web Service
* @param : input: SearchAddress , types: Results Types , langug : language for getting the results
* @return : string
**/
@AuraEnabled
public static string getSuggestions(String input) {
<aura:component controller="googleAddressAutofill" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickActionWithoutHeader" access="global">
<aura:attribute name="location" type="string" default="" />
<aura:attribute name="predictions" type="List" default="[]" />
<aura:attribute name="city" type="string" default="" />
<aura:attribute name="country" type="string" default="" />
<aura:attribute name="state" type="string" default="" />
<aura:attribute name="street" type="string" default="" />
<aura:attribute name="zip" type="string" default="" />
<aura:attribute name="boolean" type="boolean" default="false" />
({
doInit: function(component, event, helper) {
var action = component.get("c.getOppStage");
action.setParams({
"oppId": component.get("v.recordId"),
});
action.setCallback(this, function(response) {
var state = response.getState();
console.log('return value');
({
callServer: function(component, method, callback, params) {
var action = component.get(method);
if (params) {
action.setParams(params);
}
action.setCallback(this, function(response) {
var state = response.getState();
.THIS .button{
border: 1px solid rgb(221, 219, 218);
transition: border .15s linear;
border-color: rgb(221, 219, 218);
}
trigger StageUpdate on Opportunity (before insert) { //Starting of trigger
for(Opportunity o : trigger.new ){ //for-each loop on records in trigger.new
if(o.LeadSource == 'Web') //if opportunity field Leadsource is Web
o.StageName = 'Closed Won'; //Changing Opportunity stage name to Closed Won
}
}
trigger CreateCaseAcc on Account (after insert) {
List<Case> acclist=new List<Case>(); //New list of case
for(Account a:trigger.new){
if(a.Active__c=='Yes'){ //if custom field active on account is Yes
Case c=new case() ; //instance for creating new case
c.accountid=a.id; //attaching case to account
c.status='New';
c.origin='Phone';
acclist.add(c); //adding case to a list to for insert
}
trigger nameOfTheTrigger on objectname(trigger_events)
{
Your Code goes here
}
/*
Trigger context variables:
nameOfTheTrigger: Name of your trigger.
objectname: Object on which trigger is running.
Trigger_events: On which operation tour trigger is running.
*/
@hicglobalsolutions
hicglobalsolutions / Apex Trigger2
Last active August 27, 2019 06:44
Apex Trigger2
/**************************************************************************************
Name : AccountTrigger
Description :
Revision History : -
Created/Modified by Created/Modified Date Requested by Related Task/Issue
----------------------------------------------------------------------------------------
1. Nevo 26/01/2016 Roee Alon [SW-17499]
****************************************************************************************/
trigger AccountTrigger on Account(Before insert, Before update,After insert)