-
ChatterFeed
-
0Best Answers
-
0Likes Received
-
0Likes Given
-
32Questions
-
9Replies
Trigger to create opportunity, if existing opportunity has 90% probability for that account.
Hi Everyone
I have wrote code to create opportunity, if existing opp has 90% probability. So I have used parent-child query to queru opportunities related accounts.
I have used FOR - IN - FOR loops. The records are creating in huge number. Please provide proper code with single for loop and use handler class. I came to know that should not use tripple for loops. Then how to achieve without multiple loops.
public static void createOpp(List<Account> accList) {
List<Opportunity> oppList = new List<Opportunity>();
Map<Id, Account> acctMap = new Map<Id, Account>([Select Id, (Select Id, probability from Opportunities) from Account WHERE ID IN :accList]);
List<Account> acList = [Select Id, (Select Id, probability from Opportunities) from Account WHERE ID IN :accList];
for(Account a : accList) {
for(Account ao: acList) {
for(Opportunity opp : ao.opportunities) {
if( opp.probability == 90){
Opportunity opptny = new Opportunity();
opptny.AccountId = a.Id;
opptny.Name = a.Name + 'Opportunity with 90% prob new';
opptny.StageName = 'Prospecting';
opptny.probability = 90;
opptny.CloseDate = System.today().addMonths(3);
oppList.add(opptny);
}
}
}
}
try{
if(oppList.size() > 0){
insert oppList;
}
} catch (DmlException e) {
system.debug('Exception caused-->'+e.getMessage());
}
}
I have wrote code to create opportunity, if existing opp has 90% probability. So I have used parent-child query to queru opportunities related accounts.
I have used FOR - IN - FOR loops. The records are creating in huge number. Please provide proper code with single for loop and use handler class. I came to know that should not use tripple for loops. Then how to achieve without multiple loops.
public static void createOpp(List<Account> accList) {
List<Opportunity> oppList = new List<Opportunity>();
Map<Id, Account> acctMap = new Map<Id, Account>([Select Id, (Select Id, probability from Opportunities) from Account WHERE ID IN :accList]);
List<Account> acList = [Select Id, (Select Id, probability from Opportunities) from Account WHERE ID IN :accList];
for(Account a : accList) {
for(Account ao: acList) {
for(Opportunity opp : ao.opportunities) {
if( opp.probability == 90){
Opportunity opptny = new Opportunity();
opptny.AccountId = a.Id;
opptny.Name = a.Name + 'Opportunity with 90% prob new';
opptny.StageName = 'Prospecting';
opptny.probability = 90;
opptny.CloseDate = System.today().addMonths(3);
oppList.add(opptny);
}
}
}
}
try{
if(oppList.size() > 0){
insert oppList;
}
} catch (DmlException e) {
system.debug('Exception caused-->'+e.getMessage());
}
}
-
- Abilash.S
- October 28, 2022
- Like
- 0
- Continue reading or reply
How to write Trigger to create opportunity, if existing opportunity has 90% probability for that account.
Hi Everyone
I have wrote code to create opportunity, if existing opp has 90% probability. So I have used parent-child query to queru opportunities related accounts.
I have used FOR - IN - FOR loops. The records are creating in huge number. Please provide proper code with single for loop and use handler class. I came to know that should not use tripple for loops. Then how to achieve without multiple loops.
public static void createOpp(List<Account> accList) {
List<Opportunity> oppList = new List<Opportunity>();
Map<Id, Account> acctMap = new Map<Id, Account>([Select Id, (Select Id, probability from Opportunities) from Account WHERE ID IN :accList]);
for(Account a : accList) {
for(Account ao: acList) {
for(Opportunity opp : ao.opportunities) {
if( opp.probability == 90){
Opportunity opptny = new Opportunity();
opptny.AccountId = a.Id;
opptny.Name = a.Name + 'Opportunity with 90% prob new';
opptny.StageName = 'Prospecting';
opptny.probability = 90;
opptny.CloseDate = System.today().addMonths(3);
oppList.add(opptny);
}
}
}
}
try{
if(oppList.size() > 0){
insert oppList;
}
} catch (DmlException e) {
system.debug('Exception caused-->'+e.getMessage());
}
}
I have wrote code to create opportunity, if existing opp has 90% probability. So I have used parent-child query to queru opportunities related accounts.
I have used FOR - IN - FOR loops. The records are creating in huge number. Please provide proper code with single for loop and use handler class. I came to know that should not use tripple for loops. Then how to achieve without multiple loops.
public static void createOpp(List<Account> accList) {
List<Opportunity> oppList = new List<Opportunity>();
Map<Id, Account> acctMap = new Map<Id, Account>([Select Id, (Select Id, probability from Opportunities) from Account WHERE ID IN :accList]);
for(Account a : accList) {
for(Account ao: acList) {
for(Opportunity opp : ao.opportunities) {
if( opp.probability == 90){
Opportunity opptny = new Opportunity();
opptny.AccountId = a.Id;
opptny.Name = a.Name + 'Opportunity with 90% prob new';
opptny.StageName = 'Prospecting';
opptny.probability = 90;
opptny.CloseDate = System.today().addMonths(3);
oppList.add(opptny);
}
}
}
}
try{
if(oppList.size() > 0){
insert oppList;
}
} catch (DmlException e) {
system.debug('Exception caused-->'+e.getMessage());
}
}
-
- Abilash.S
- October 28, 2022
- Like
- 0
- Continue reading or reply
Lightning combobox field value changes when lwc page changed
Hi Everyone.
I have used lwc lightning combobox to fetch picklist values. Here user enters combo box field values in second page. When user navigated to third page and again visited second page the field value displays as None (which is a placeholder in html). Again user enters value. This makes dual work to user and not user friendly.
How to store picklist value in combo box field when user navigated from 3 page to 2 page or 2 page to 1 page and 1 page to 2 page. The value should not chnage which is given bu user.
How to over come this.
-----------html---------
<lightning-combobox data-id={skill.Skill__c} data-name="Rating__c" label="Self Evaluation"
value={selectedValue} placeholder="--None--" options={skillOptions}
onchange={handleSkillsChange} >
</lightning-combobox>
----------js--------------
@wire(getObjectInfo, { objectApiName: SKILL_MATRIX_OBJECT })
skillMatrixObjectInfo;
@wire(getPicklistValuesByRecordType, { objectApiName: SKILL_MATRIX_OBJECT, recordTypeId: '$skillMatrixObjectInfo.data.defaultRecordTypeId'})
skillMatrixPicklistValues({data,error})
{
if(data) {
this.skillOptions = [{selected: true },...data.picklistFieldValues.Rating__c.values]
}
console.log('this.skillOptions ',this.skillOptions);
}
-----------------------------------------------------
Note: The component is a communication between parent to child.
Am I doing any mistake while passing any attributes in child.
---child----
<template>
<c-employee-skillset record-id={recordId}>
</c-employee-skillset>
</template>
-------js-------
import skills from './employeeSkills.html';
@api
save(){
switch(this.templateName){
case "skills" :
this.template.querySelector("c-employee-skillset").saveSkills();
break;
}
}
I have used lwc lightning combobox to fetch picklist values. Here user enters combo box field values in second page. When user navigated to third page and again visited second page the field value displays as None (which is a placeholder in html). Again user enters value. This makes dual work to user and not user friendly.
How to store picklist value in combo box field when user navigated from 3 page to 2 page or 2 page to 1 page and 1 page to 2 page. The value should not chnage which is given bu user.
How to over come this.
-----------html---------
<lightning-combobox data-id={skill.Skill__c} data-name="Rating__c" label="Self Evaluation"
value={selectedValue} placeholder="--None--" options={skillOptions}
onchange={handleSkillsChange} >
</lightning-combobox>
----------js--------------
@wire(getObjectInfo, { objectApiName: SKILL_MATRIX_OBJECT })
skillMatrixObjectInfo;
@wire(getPicklistValuesByRecordType, { objectApiName: SKILL_MATRIX_OBJECT, recordTypeId: '$skillMatrixObjectInfo.data.defaultRecordTypeId'})
skillMatrixPicklistValues({data,error})
{
if(data) {
this.skillOptions = [{selected: true },...data.picklistFieldValues.Rating__c.values]
}
console.log('this.skillOptions ',this.skillOptions);
}
-----------------------------------------------------
Note: The component is a communication between parent to child.
Am I doing any mistake while passing any attributes in child.
---child----
<template>
<c-employee-skillset record-id={recordId}>
</c-employee-skillset>
</template>
-------js-------
import skills from './employeeSkills.html';
@api
save(){
switch(this.templateName){
case "skills" :
this.template.querySelector("c-employee-skillset").saveSkills();
break;
}
}
-
- Abilash.S
- October 25, 2022
- Like
- 0
- Continue reading or reply
How to add multiple wrapper list into single list
Hi Everyone,
I have created apex class to pull multiple object records into single list. Where objects does not have any relationship (lets say account, contact, lead. Consider account and contact dont have any relationship). I used for loop seperately for each object and saved into wrapperlist. For threee objects I have three wrapper list. Now big challenge is I need to add three wrappers(wrapAccount, wrapContact, wrapLead) into single list. So in that list I need all three objects records.
-------------------------------------------------------------------------
@Auraenabled(cacheable=true)
public static List<sObject> wrapData() {
List<WrapperContact> wrapContact = new List<WrapperContact>();
List<WrapperAccount> wrapAccount = new List<WrapperAccount>();
List<WrapperLead> wrapLead = new List<WrapperLead>();
for(Contact ct : [select id, name from Contact LIMIT 10]){
wrapContact.add(new WrapperContact(ct));
}
for(Account acct : [select id, name from Account LIMIT 10]){
wrapAccount.add(new WrapperAccount(acct));
}
for(Lead ld : [select id, name from Lead LIMIT 10]){
wrapLead.add(new WrapperLead(ld));
}
system.debug('wrapContact'+wrapContact);
system.debug('wrapAccount'+wrapAccount);
system.debug('wrapLead'+wrapLead);
List<SObject> s = new List<SObject>{
new Contact(),
new Account(),
new Lead()
};
// s.add(wrapContact);
// s.addAll(wrapAccount);
// system.debug(s);
List<sObject> objects = new List<sObject>();
// objects.addAll((List<sObject>)(wrapContact));
// objects.addAll((List<sObject>)(wrapAccount));
// objects.addAll(wrapLead);
return objects;
}
public class WrapperAccount{
@Auraenabled
public Account ac{get;set;}
public WrapperAccount(Account acct){
ac=acct;
}
}
public class WrapperContact{
@Auraenabled
public Contact cont{get;set;}
public WrapperContact(Contact ct){
cont=ct;
}
}
public class WrapperLead{
@Auraenabled
public Lead ldd{get;set;}
public WrapperLead(Lead ld){
ldd=ld;
}
}
----------------------------------------------------------------------
I have used List<SObject> s = new List<SObject>{
new Contact(),
new Account(),
new Lead()
};
// s.add(wrapContact);
// s.addAll(wrapAccount);
s.addAll(wrapLead);
// system.debug(s);
But its not working. Please help me out of this.
Thanks in Advance
I have created apex class to pull multiple object records into single list. Where objects does not have any relationship (lets say account, contact, lead. Consider account and contact dont have any relationship). I used for loop seperately for each object and saved into wrapperlist. For threee objects I have three wrapper list. Now big challenge is I need to add three wrappers(wrapAccount, wrapContact, wrapLead) into single list. So in that list I need all three objects records.
-------------------------------------------------------------------------
@Auraenabled(cacheable=true)
public static List<sObject> wrapData() {
List<WrapperContact> wrapContact = new List<WrapperContact>();
List<WrapperAccount> wrapAccount = new List<WrapperAccount>();
List<WrapperLead> wrapLead = new List<WrapperLead>();
for(Contact ct : [select id, name from Contact LIMIT 10]){
wrapContact.add(new WrapperContact(ct));
}
for(Account acct : [select id, name from Account LIMIT 10]){
wrapAccount.add(new WrapperAccount(acct));
}
for(Lead ld : [select id, name from Lead LIMIT 10]){
wrapLead.add(new WrapperLead(ld));
}
system.debug('wrapContact'+wrapContact);
system.debug('wrapAccount'+wrapAccount);
system.debug('wrapLead'+wrapLead);
List<SObject> s = new List<SObject>{
new Contact(),
new Account(),
new Lead()
};
// s.add(wrapContact);
// s.addAll(wrapAccount);
// system.debug(s);
List<sObject> objects = new List<sObject>();
// objects.addAll((List<sObject>)(wrapContact));
// objects.addAll((List<sObject>)(wrapAccount));
// objects.addAll(wrapLead);
return objects;
}
public class WrapperAccount{
@Auraenabled
public Account ac{get;set;}
public WrapperAccount(Account acct){
ac=acct;
}
}
public class WrapperContact{
@Auraenabled
public Contact cont{get;set;}
public WrapperContact(Contact ct){
cont=ct;
}
}
public class WrapperLead{
@Auraenabled
public Lead ldd{get;set;}
public WrapperLead(Lead ld){
ldd=ld;
}
}
----------------------------------------------------------------------
I have used List<SObject> s = new List<SObject>{
new Contact(),
new Account(),
new Lead()
};
// s.add(wrapContact);
// s.addAll(wrapAccount);
s.addAll(wrapLead);
// system.debug(s);
But its not working. Please help me out of this.
Thanks in Advance
-
- Abilash.S
- October 18, 2022
- Like
- 0
- Continue reading or reply
How to add multiple wrapperslist into single list
Hi,
I have written three seperate wrapper classes for three different Sobjects. I need to add three wrappers into single list. Please help me how to do
---------------------------------------------
@Auraenabled(cacheable=true)
public static List<sObject> wrapData() {
List<WrapperContact> wrapContact = new List<WrapperContact>();
List<WrapperAccount> wrapAccount = new List<WrapperAccount>();
List<WrapperLead> wrapLead = new List<WrapperLead>();
for(Contact ct : [select id, name from Contact LIMIT 10]){
wrapContact.add(new WrapperContact(ct));
}
for(Account acct : [select id, name from Account LIMIT 10]){
wrapAccount.add(new WrapperAccount(acct));
}
for(Lead ld : [select id, name from Lead LIMIT 10]){
wrapLead.add(new WrapperLead(ld));
}
system.debug('wrapContact'+wrapContact);
system.debug('wrapAccount'+wrapAccount);
system.debug('wrapLead'+wrapLead);
// s.add(wrapContact);
// s.add(wrapAccount);
// s.add(wrapLead);
List<SObject> s = new List<SObject>{
new Contact(),
new Account(),
new Lead()
};
// system.debug(s);
List<sObject> objects = new List<sObject>();
objects.addAll((List<sObject>)(wrapContact));
objects.addAll((List<sObject>)(wrapAccount));
objects.addAll(wrapLead);
return objects;
}
public class WrapperAccount{
@Auraenabled
public Account ac{get;set;}
public WrapperAccount(Account acct){
ac=acct;
}
}
public class WrapperContact{
@Auraenabled
public Contact cont{get;set;}
public WrapperContact(Contact ct){
cont=ct;
}
}
public class WrapperLead{
@Auraenabled
public Lead ldd{get;set;}
public WrapperLead(Lead ld){
ldd=ld;
}
}
-------------------------------------------
I am approaching in this way, but addAll method is not working
List<sObject> objects = new List<sObject>();
objects.addAll((List<sObject>)(wrapContact));
objects.addAll((List<sObject>)(wrapAccount));
objects.addAll((List<sObject>)(wrapLead));
------------------------------------------------------
I need to add below three lists into single list.
I have written three seperate wrapper classes for three different Sobjects. I need to add three wrappers into single list. Please help me how to do
---------------------------------------------
@Auraenabled(cacheable=true)
public static List<sObject> wrapData() {
List<WrapperContact> wrapContact = new List<WrapperContact>();
List<WrapperAccount> wrapAccount = new List<WrapperAccount>();
List<WrapperLead> wrapLead = new List<WrapperLead>();
for(Contact ct : [select id, name from Contact LIMIT 10]){
wrapContact.add(new WrapperContact(ct));
}
for(Account acct : [select id, name from Account LIMIT 10]){
wrapAccount.add(new WrapperAccount(acct));
}
for(Lead ld : [select id, name from Lead LIMIT 10]){
wrapLead.add(new WrapperLead(ld));
}
system.debug('wrapContact'+wrapContact);
system.debug('wrapAccount'+wrapAccount);
system.debug('wrapLead'+wrapLead);
// s.add(wrapContact);
// s.add(wrapAccount);
// s.add(wrapLead);
List<SObject> s = new List<SObject>{
new Contact(),
new Account(),
new Lead()
};
// system.debug(s);
List<sObject> objects = new List<sObject>();
objects.addAll((List<sObject>)(wrapContact));
objects.addAll((List<sObject>)(wrapAccount));
objects.addAll(wrapLead);
return objects;
}
public class WrapperAccount{
@Auraenabled
public Account ac{get;set;}
public WrapperAccount(Account acct){
ac=acct;
}
}
public class WrapperContact{
@Auraenabled
public Contact cont{get;set;}
public WrapperContact(Contact ct){
cont=ct;
}
}
public class WrapperLead{
@Auraenabled
public Lead ldd{get;set;}
public WrapperLead(Lead ld){
ldd=ld;
}
}
-------------------------------------------
I am approaching in this way, but addAll method is not working
List<sObject> objects = new List<sObject>();
objects.addAll((List<sObject>)(wrapContact));
objects.addAll((List<sObject>)(wrapAccount));
objects.addAll((List<sObject>)(wrapLead));
------------------------------------------------------
-
- Abilash.S
- October 16, 2022
- Like
- 0
- Continue reading or reply
How to add multiple wrapperlists into single list
Hi,
I have written three seperate wrapper classes for three different Sobjects. I need to add three wrappers into single list. Please help me how to do
---------------------------------------------
@Auraenabled(cacheable=true)
public static List<sObject> wrapData() {
List<WrapperContact> wrapContact = new List<WrapperContact>();
List<WrapperAccount> wrapAccount = new List<WrapperAccount>();
List<WrapperLead> wrapLead = new List<WrapperLead>();
for(Contact ct : [select id, name from Contact LIMIT 10]){
wrapContact.add(new WrapperContact(ct));
}
for(Account acct : [select id, name from Account LIMIT 10]){
wrapAccount.add(new WrapperAccount(acct));
}
for(Lead ld : [select id, name from Lead LIMIT 10]){
wrapLead.add(new WrapperLead(ld));
}
system.debug('wrapContact'+wrapContact);
system.debug('wrapAccount'+wrapAccount);
system.debug('wrapLead'+wrapLead);
// s.add(wrapContact);
// s.add(wrapAccount);
// s.add(wrapLead);
List<SObject> s = new List<SObject>{
new Contact(),
new Account(),
new Lead()
};
// system.debug(s);
List<sObject> objects = new List<sObject>();
objects.addAll((List<sObject>)(wrapContact));
objects.addAll((List<sObject>)(wrapAccount));
objects.addAll(wrapLead);
return objects;
}
public class WrapperAccount{
@Auraenabled
public Account ac{get;set;}
public WrapperAccount(Account acct){
ac=acct;
}
}
public class WrapperContact{
@Auraenabled
public Contact cont{get;set;}
public WrapperContact(Contact ct){
cont=ct;
}
}
public class WrapperLead{
@Auraenabled
public Lead ldd{get;set;}
public WrapperLead(Lead ld){
ldd=ld;
}
}
------------------------------------------------------------
I have written three seperate wrapper classes for three different Sobjects. I need to add three wrappers into single list. Please help me how to do
---------------------------------------------
@Auraenabled(cacheable=true)
public static List<sObject> wrapData() {
List<WrapperContact> wrapContact = new List<WrapperContact>();
List<WrapperAccount> wrapAccount = new List<WrapperAccount>();
List<WrapperLead> wrapLead = new List<WrapperLead>();
for(Contact ct : [select id, name from Contact LIMIT 10]){
wrapContact.add(new WrapperContact(ct));
}
for(Account acct : [select id, name from Account LIMIT 10]){
wrapAccount.add(new WrapperAccount(acct));
}
for(Lead ld : [select id, name from Lead LIMIT 10]){
wrapLead.add(new WrapperLead(ld));
}
system.debug('wrapContact'+wrapContact);
system.debug('wrapAccount'+wrapAccount);
system.debug('wrapLead'+wrapLead);
// s.add(wrapContact);
// s.add(wrapAccount);
// s.add(wrapLead);
List<SObject> s = new List<SObject>{
new Contact(),
new Account(),
new Lead()
};
// system.debug(s);
List<sObject> objects = new List<sObject>();
objects.addAll((List<sObject>)(wrapContact));
objects.addAll((List<sObject>)(wrapAccount));
objects.addAll(wrapLead);
return objects;
}
public class WrapperAccount{
@Auraenabled
public Account ac{get;set;}
public WrapperAccount(Account acct){
ac=acct;
}
}
public class WrapperContact{
@Auraenabled
public Contact cont{get;set;}
public WrapperContact(Contact ct){
cont=ct;
}
}
public class WrapperLead{
@Auraenabled
public Lead ldd{get;set;}
public WrapperLead(Lead ld){
ldd=ld;
}
}
------------------------------------------------------------
-
- Abilash.S
- October 16, 2022
- Like
- 0
- Continue reading or reply
Integration between SAP, SF
Hi, I am new to integration,
There are two systems SF and SAP. If SAP is sending data to SF. What are the questions you ask to SAP. What you do in SF. What are prerequisites.
Please let me know.
Thanks
There are two systems SF and SAP. If SAP is sending data to SF. What are the questions you ask to SAP. What you do in SF. What are prerequisites.
Please let me know.
Thanks
-
- Abilash.S
- October 06, 2022
- Like
- 0
- Continue reading or reply
Trigger to log a call when date changed on Account obj. When date is changed a task(log a call) should create.
Trigger on whenever account is updated the date field is changed then log a call with that date.
I am strucked on
1. How to check date field is changed or not. I need to trigger when existing date changed.
2. Unable to create activity (log a call) on record page. In debug logs getting data to insert. But on record page Call is not logging from apex.
Please help me in code.
// log a call when date field changed in account
public static void logCall(List<Account> newMapps) {
List<Task> tkList = new List<Task>();
Set<Id> regIds = new Set<Id>();
for(Account ac: newMapps){
regIds.add(ac.Id);
}
Map<Id, Account> mapAcc = new Map<Id, Account>([select id, name, support_plan_start_date__c FROM Account WHERE ID IN :regIds]);
system.debug('mapAcc'+mapAcc);
for(Account a : newMapps){
system.debug('77'+a.support_plan_start_date__c);
system.debug('78'+mapAcc.get(a.Id).support_plan_start_date__c);
if(a.support_plan_start_date__c == mapAcc.get(a.Id).support_plan_start_date__c || a.support_plan_start_date__c >mapAcc.get(a.Id).support_plan_start_date__c || a.support_plan_start_date__c <mapAcc.get(a.Id).support_plan_start_date__c){
Task newtask = new Task();
newtask.Description = 'Log a call when datefield changes';
newtask.Priority = 'Normal';
newtask.Status = 'Completed';
newtask.CallDisposition = 'CallBack';
newtask.Subject = 'Call';
newtask.CallType = 'OutBound';
newtask.IsReminderSet = true;
newtask.ReminderDateTime = System.now()+1;
// newtask.WhoId = Trigger.new[0].Id;
tkList.add(newtask);
}
}
system.debug('tkList'+tkList);
try{
if(tkList.size() > 0){
insert tkList;
}
} catch (DmlException e) {
system.debug('Exception caused'+e.getMessage());
}
}
Thanks in advance
I am strucked on
1. How to check date field is changed or not. I need to trigger when existing date changed.
2. Unable to create activity (log a call) on record page. In debug logs getting data to insert. But on record page Call is not logging from apex.
Please help me in code.
// log a call when date field changed in account
public static void logCall(List<Account> newMapps) {
List<Task> tkList = new List<Task>();
Set<Id> regIds = new Set<Id>();
for(Account ac: newMapps){
regIds.add(ac.Id);
}
Map<Id, Account> mapAcc = new Map<Id, Account>([select id, name, support_plan_start_date__c FROM Account WHERE ID IN :regIds]);
system.debug('mapAcc'+mapAcc);
for(Account a : newMapps){
system.debug('77'+a.support_plan_start_date__c);
system.debug('78'+mapAcc.get(a.Id).support_plan_start_date__c);
if(a.support_plan_start_date__c == mapAcc.get(a.Id).support_plan_start_date__c || a.support_plan_start_date__c >mapAcc.get(a.Id).support_plan_start_date__c || a.support_plan_start_date__c <mapAcc.get(a.Id).support_plan_start_date__c){
Task newtask = new Task();
newtask.Description = 'Log a call when datefield changes';
newtask.Priority = 'Normal';
newtask.Status = 'Completed';
newtask.CallDisposition = 'CallBack';
newtask.Subject = 'Call';
newtask.CallType = 'OutBound';
newtask.IsReminderSet = true;
newtask.ReminderDateTime = System.now()+1;
// newtask.WhoId = Trigger.new[0].Id;
tkList.add(newtask);
}
}
system.debug('tkList'+tkList);
try{
if(tkList.size() > 0){
insert tkList;
}
} catch (DmlException e) {
system.debug('Exception caused'+e.getMessage());
}
}
Thanks in advance
-
- Abilash.S
- September 14, 2022
- Like
- 0
- Continue reading or reply
Trigger on whenever account is updated the date field is changed then log a call with that date
Hi Everyone,
Need help on Trigger.
Trigger on whenever account is updated the date field is changed then log a call with that date. The trigger should trigger when date field is changed. If date changed then log a call on account.
Need help on Trigger.
Trigger on whenever account is updated the date field is changed then log a call with that date. The trigger should trigger when date field is changed. If date changed then log a call on account.
-
- Abilash.S
- September 14, 2022
- Like
- 0
- Continue reading or reply
JSON Serialize and display List in descending order
Hi Everyone,
How to display JSON data by serializing in apex and display in descending order. Please have a look below json data.
let jsonData = [
{‘HouseName’:‘anna’,
‘Kilometers’:75
},
{‘HouseName’:‘nancy’,
‘Kilometers’: 55
},
{‘HouseName’:‘sana’,
‘Kilometers’:95
},
]
By getting this data from FE, parse it in apex, and provide list of housenames based on kilometers in descending order.
O/P-should be- [Sana,Anna,Nancy]
Please help me in Apex code.
How to display JSON data by serializing in apex and display in descending order. Please have a look below json data.
let jsonData = [
{‘HouseName’:‘anna’,
‘Kilometers’:75
},
{‘HouseName’:‘nancy’,
‘Kilometers’: 55
},
{‘HouseName’:‘sana’,
‘Kilometers’:95
},
]
By getting this data from FE, parse it in apex, and provide list of housenames based on kilometers in descending order.
O/P-should be- [Sana,Anna,Nancy]
Please help me in Apex code.
-
- Abilash.S
- August 27, 2022
- Like
- 0
- Continue reading or reply
JSON Serialize and display in descending order.
Hi Everyone,
How to display JSON data by serializing in apex and display in descending order. Please have a look below json data.
let jsonData = [
{‘HouseName’:‘anna’,
‘Kilometers’:75
},
{‘HouseName’:‘nancy’,
‘Kilometers’: 55
},
{‘HouseName’:‘sana’,
‘Kilometers’:95
},
]
By getting this data from FE, parse it in apex, and provide list of housenames based on kilometers in descending order.
O/P-should be- [Sana,Anna,Nancy]
Please help me in Apex code.
How to display JSON data by serializing in apex and display in descending order. Please have a look below json data.
let jsonData = [
{‘HouseName’:‘anna’,
‘Kilometers’:75
},
{‘HouseName’:‘nancy’,
‘Kilometers’: 55
},
{‘HouseName’:‘sana’,
‘Kilometers’:95
},
]
By getting this data from FE, parse it in apex, and provide list of housenames based on kilometers in descending order.
O/P-should be- [Sana,Anna,Nancy]
Please help me in Apex code.
-
- Abilash.S
- August 27, 2022
- Like
- 0
- Continue reading or reply
Bad Request 400 for standard Lightning upload file
I am using lighning upload file tag to upload files for customer from community portal.
<lightning-file-upload class="fileUploader"
accept={acceptedFile}
onuploadfinished={handleUploade}
></lightning-file-upload>
Till yesterday it was worked , today onwards not working saying bad request in console logs.
It worked multiple times, not sure today its not working. Didnt done any code changes.
Help me out of this.
JS-
handleUploade(event){
this.updatingloader = true;
const uploadedFile = event.detail.files;
uploadedFile.forEach(element => {
this.uploadedFileName = element.name;
});
if(this.selectedRT == 'MM'){
}
else if(this.selectedRT == 'ULT'){
readUploadedFile({DocumentId:uploadedFile[0].documentId})
.then(result => {
//console.log('result raw data from csv file ===>',result);
let res = JSON.parse(result);
console.log(res);
this.rawInsertedCLi = result;
let dataToShow = [];
res.forEach(rowElement => {
let rowObj ={};
if(this.selectedRT == 'ULT'){
rowObj.SerialNo = rowElement.SerialNo;
rowObj.ReturnQuantity = rowElement.ReturnQuantity;
rowObj.VISID = rowElement.VISID;
rowObj.PO_Number = rowElement.PO_Number;
rowObj.CR_DBT = rowElement.CR_DBT;
rowObj.Org_PO = rowElement.Org_PO;
rowObj.Product_condition = rowElement.Product_condition;
rowObj.product_verify = rowElement.product_verify;
rowObj.CLIRInsertedID = rowElement.RecordId;
}
dataToShow.push(rowObj);
});
this.PoData = dataToShow;
console.log('raw csv data to object maping :'+this.PoData);
if(this.PoData != '' && this.PoData != undefined){
//this.dataToValidate(this.PoData);
//this.callExternalSource(this.PoData); //uncomment for previous func
this.showInsertedRows = true;
this.updatingloader = false;
this.recordstosend = this.PoData;
this.hideToValidateStep = false;
}
<lightning-file-upload class="fileUploader"
accept={acceptedFile}
onuploadfinished={handleUploade}
></lightning-file-upload>
Till yesterday it was worked , today onwards not working saying bad request in console logs.
It worked multiple times, not sure today its not working. Didnt done any code changes.
Help me out of this.
handleUploade(event){
this.updatingloader = true;
const uploadedFile = event.detail.files;
uploadedFile.forEach(element => {
this.uploadedFileName = element.name;
});
if(this.selectedRT == 'MM'){
}
else if(this.selectedRT == 'ULT'){
readUploadedFile({DocumentId:uploadedFile[0].documentId})
.then(result => {
//console.log('result raw data from csv file ===>',result);
let res = JSON.parse(result);
console.log(res);
this.rawInsertedCLi = result;
let dataToShow = [];
res.forEach(rowElement => {
let rowObj ={};
if(this.selectedRT == 'ULT'){
rowObj.SerialNo = rowElement.SerialNo;
rowObj.ReturnQuantity = rowElement.ReturnQuantity;
rowObj.VISID = rowElement.VISID;
rowObj.PO_Number = rowElement.PO_Number;
rowObj.CR_DBT = rowElement.CR_DBT;
rowObj.Org_PO = rowElement.Org_PO;
rowObj.Product_condition = rowElement.Product_condition;
rowObj.product_verify = rowElement.product_verify;
rowObj.CLIRInsertedID = rowElement.RecordId;
}
dataToShow.push(rowObj);
});
this.PoData = dataToShow;
console.log('raw csv data to object maping :'+this.PoData);
if(this.PoData != '' && this.PoData != undefined){
//this.dataToValidate(this.PoData);
//this.callExternalSource(this.PoData); //uncomment for previous func
this.showInsertedRows = true;
this.updatingloader = false;
this.recordstosend = this.PoData;
this.hideToValidateStep = false;
}
-
- Abilash.S
- July 25, 2022
- Like
- 0
- Continue reading or reply
How to catch exception in continuation call
Hi Everyone,
I am doing continuation call for long running calls and bulk loads processing. In continuation call, there will be three parallel calls at a time. I need to catch exceptions happened in three calls if response is failure.
For example, One call has exception, second call has success, third call has exception. So first call and third call has exception. I need to consolidate two exceptions at a place and handle those exceptions and store in object with DML operation.
What I knew that once exception raised I can do DML after that the call shouold continue it should not effect remaining calls. How Cani approach.
Continuation con = new Continuation(100); // 1 call---exp , 2 call sucess, 3 -exp. dml
con.ContinuationMethod = 'processResponse';
string endpointurl = EndPoint;
endpointurl= endpointurl+portalids;
//Object strResponse;
Http httpHandler = new Http();
HttpRequest req = new HttpRequest();
req.setMethod('GET');
req.setEndpoint(endpointurl);
req.setTimeout(120000);
req.setHeader('content-type', 'application/json');
req.setHeader('Accept', 'application/json');
req.setHeader('Authorization','OAuth '+accessToken);
req.setHeader('Authorization','Bearer '+accessToken);
con.addHttpRequest(req);
HttpResponse response = httpHandler.send(req);
if(response?.getStatusCode() == 200) //If Reponse successful..
{ hanlde success call
} else { //if reponse fails
store exceptions
}
Can I use if else condition for to check response success or failure. I am using continuation call. In this call 3 calls will happen at a time. If I get two failures in two calls can I catch in else loop??
Am I going to right approach Please help.
I am doing continuation call for long running calls and bulk loads processing. In continuation call, there will be three parallel calls at a time. I need to catch exceptions happened in three calls if response is failure.
For example, One call has exception, second call has success, third call has exception. So first call and third call has exception. I need to consolidate two exceptions at a place and handle those exceptions and store in object with DML operation.
What I knew that once exception raised I can do DML after that the call shouold continue it should not effect remaining calls. How Cani approach.
Continuation con = new Continuation(100); // 1 call---exp , 2 call sucess, 3 -exp. dml
con.ContinuationMethod = 'processResponse';
string endpointurl = EndPoint;
endpointurl= endpointurl+portalids;
//Object strResponse;
Http httpHandler = new Http();
HttpRequest req = new HttpRequest();
req.setMethod('GET');
req.setEndpoint(endpointurl);
req.setTimeout(120000);
req.setHeader('content-type', 'application/json');
req.setHeader('Accept', 'application/json');
req.setHeader('Authorization','OAuth '+accessToken);
req.setHeader('Authorization','Bearer '+accessToken);
con.addHttpRequest(req);
HttpResponse response = httpHandler.send(req);
if(response?.getStatusCode() == 200) //If Reponse successful..
{ hanlde success call
} else { //if reponse fails
store exceptions
}
Can I use if else condition for to check response success or failure. I am using continuation call. In this call 3 calls will happen at a time. If I get two failures in two calls can I catch in else loop??
Am I going to right approach Please help.
-
- Abilash.S
- July 13, 2022
- Like
- 0
- Continue reading or reply
Session Id invalid when try to Insert using SOAP
Hello Everyone,
Session Id invalid when tried to insert listviews using SOAP
I need to create list view through custom LWC comp. For this I am using below code in apex class. ---------
HTTP h = new HTTP();
HTTPRequest req = new HTTPRequest();
req.setMethod('POST'); req.setHeader('Content-Type', 'text/xml');
req.setHeader('SOAPAction', 'create');
String b = '<?xml version="1.0" encoding="UTF-8"?>';
b += '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">';
b += '<soapenv:Header>';
b += '<ns1:SessionHeader soapenv:mustUnderstand="0" xmlns:ns1="http://soap.sforce.com/2006/04/metadata">';
b += '<ns1:sessionId>' + UserInfo.getSessionId() + '</ns1:sessionId>';
b += '</ns1:SessionHeader>'; b += '</soapenv:Header>';
b += '<soapenv:Body>';
b += '<create xmlns="http://soap.sforce.com/2006/04/metadata">';
b += '<metadata xsi:type="ns2:ListView" xmlns:ns2="http://soap.sforce.com/2006/04/metadata">';
//This is the API name of the list view
b += '<fullName>Case.Test345_ListView</fullName>';
b += '<booleanFilter>1</booleanFilter>';
//Columns you want to display
b += '<columns>NAME</columns>';
b += '<columns>CREATED_DATE</columns>';
//Filterscope should be set to Everything for every one to be able to access this List view
b += '<filterScope>Everything</filterScope>';
// Enter the filter that you want to set
b += '<filters>';
b += '<field>NAME</field>';
b += '<operation>equals</operation>';
b += '<value>Test123 </value>';
b += '</filters>';
b += '<label>Test345 View</label>';
b += '</metadata>';
b += '</create>';
b += '</soapenv:Body>';
b += '</soapenv:Envelope>';
req.setBody(b);
req.setCompressed(false);
// Set this to org's endpoint and add it to the remote site settings. req.setEndpoint('https://ap1.salesforce.com/services/Soap/m/25.0');
HTTPResponse resp = h.send(req);
System.debug(resp.getBody());
--------------------------------------
I tried to get response through anonymous window, getting an error like. USER_DEBUG This error usually occurs after a session expires or a user logs out. Decoder: DataInDbSessionKeyDecoder</faultstring></soapenv:Fault></soapenv:Body></soapenv:Envelope>....
1. I did logout and login.
2.Changed session settings.
Eventhough its not working. I tried system.debug(userinfo.getsessionId()); in anonymous, the result is SESSION_ID_REMOVED.
How to figure it out. Does this not work in sandbox. NOTE: The code perfectly working in our personal DEV ORG. I can successfully insert list views when executed in anonymous window. But cannot in this sandbox. Please help.
Thanks
Session Id invalid when tried to insert listviews using SOAP
I need to create list view through custom LWC comp. For this I am using below code in apex class. ---------
HTTP h = new HTTP();
HTTPRequest req = new HTTPRequest();
req.setMethod('POST'); req.setHeader('Content-Type', 'text/xml');
req.setHeader('SOAPAction', 'create');
String b = '<?xml version="1.0" encoding="UTF-8"?>';
b += '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">';
b += '<soapenv:Header>';
b += '<ns1:SessionHeader soapenv:mustUnderstand="0" xmlns:ns1="http://soap.sforce.com/2006/04/metadata">';
b += '<ns1:sessionId>' + UserInfo.getSessionId() + '</ns1:sessionId>';
b += '</ns1:SessionHeader>'; b += '</soapenv:Header>';
b += '<soapenv:Body>';
b += '<create xmlns="http://soap.sforce.com/2006/04/metadata">';
b += '<metadata xsi:type="ns2:ListView" xmlns:ns2="http://soap.sforce.com/2006/04/metadata">';
//This is the API name of the list view
b += '<fullName>Case.Test345_ListView</fullName>';
b += '<booleanFilter>1</booleanFilter>';
//Columns you want to display
b += '<columns>NAME</columns>';
b += '<columns>CREATED_DATE</columns>';
//Filterscope should be set to Everything for every one to be able to access this List view
b += '<filterScope>Everything</filterScope>';
// Enter the filter that you want to set
b += '<filters>';
b += '<field>NAME</field>';
b += '<operation>equals</operation>';
b += '<value>Test123 </value>';
b += '</filters>';
b += '<label>Test345 View</label>';
b += '</metadata>';
b += '</create>';
b += '</soapenv:Body>';
b += '</soapenv:Envelope>';
req.setBody(b);
req.setCompressed(false);
// Set this to org's endpoint and add it to the remote site settings. req.setEndpoint('https://ap1.salesforce.com/services/Soap/m/25.0');
HTTPResponse resp = h.send(req);
System.debug(resp.getBody());
--------------------------------------
I tried to get response through anonymous window, getting an error like. USER_DEBUG This error usually occurs after a session expires or a user logs out. Decoder: DataInDbSessionKeyDecoder</faultstring></soapenv:Fault></soapenv:Body></soapenv:Envelope>....
1. I did logout and login.
2.Changed session settings.
Eventhough its not working. I tried system.debug(userinfo.getsessionId()); in anonymous, the result is SESSION_ID_REMOVED.
How to figure it out. Does this not work in sandbox. NOTE: The code perfectly working in our personal DEV ORG. I can successfully insert list views when executed in anonymous window. But cannot in this sandbox. Please help.
Thanks
-
- Abilash.S
- May 06, 2022
- Like
- 0
- Continue reading or reply
change record type using flows
Hi everyone.
How can I change recordtype using flows based on condition.
1. Initially I get Records in sobject.
2. Updated records and setting field values in variable.
Am I missing any thing.
pic1.
pic2.

How can I change recordtype using flows based on condition.
1. Initially I get Records in sobject.
2. Updated records and setting field values in variable.
Am I missing any thing.
-
- Abilash.S
- September 20, 2021
- Like
- 0
- Continue reading or reply
-
- Abilash.S
- July 07, 2021
- Like
- 0
- Continue reading or reply
prepare application for release
Hi all,
What is PREPARE APPLICATION FOR RELEASE and disable debugs??
Could anyone suggest me better links?
Thanks in advance
What is PREPARE APPLICATION FOR RELEASE and disable debugs??
Could anyone suggest me better links?
Thanks in advance
-
- Abilash.S
- July 07, 2021
- Like
- 0
- Continue reading or reply
client side authorization
Hi Folks, In salesforce the authorization should not depend on client side - authorization. Any alternatives??
-
- Abilash.S
- July 06, 2021
- Like
- 0
- Continue reading or reply
To get count of users related to contact in Account object
I have account and contact which have lookup relationship. In contact there are three fields like f1, f2, f3. Each field has some users count. I need to get all count of users in account object. How to do this.
-
- Abilash.S
- April 23, 2021
- Like
- 0
- Continue reading or reply
If user create opportunity in SF org, then same opp should create in another org
I have two systems Salesforce system and Third party system. It’s a migration process. Component wants a two way synchronization. Any user creates/ edit opportunity in Salesforce system then the same opportunity should create in third party system also. And viceversa. Two way approach require here. How could i accomplish this.
-
- Abilash.S
- April 22, 2021
- Like
- 0
- Continue reading or reply
How to write Trigger to create opportunity, if existing opportunity has 90% probability for that account.
Hi Everyone
I have wrote code to create opportunity, if existing opp has 90% probability. So I have used parent-child query to queru opportunities related accounts.
I have used FOR - IN - FOR loops. The records are creating in huge number. Please provide proper code with single for loop and use handler class. I came to know that should not use tripple for loops. Then how to achieve without multiple loops.
public static void createOpp(List<Account> accList) {
List<Opportunity> oppList = new List<Opportunity>();
Map<Id, Account> acctMap = new Map<Id, Account>([Select Id, (Select Id, probability from Opportunities) from Account WHERE ID IN :accList]);
for(Account a : accList) {
for(Account ao: acList) {
for(Opportunity opp : ao.opportunities) {
if( opp.probability == 90){
Opportunity opptny = new Opportunity();
opptny.AccountId = a.Id;
opptny.Name = a.Name + 'Opportunity with 90% prob new';
opptny.StageName = 'Prospecting';
opptny.probability = 90;
opptny.CloseDate = System.today().addMonths(3);
oppList.add(opptny);
}
}
}
}
try{
if(oppList.size() > 0){
insert oppList;
}
} catch (DmlException e) {
system.debug('Exception caused-->'+e.getMessage());
}
}
I have wrote code to create opportunity, if existing opp has 90% probability. So I have used parent-child query to queru opportunities related accounts.
I have used FOR - IN - FOR loops. The records are creating in huge number. Please provide proper code with single for loop and use handler class. I came to know that should not use tripple for loops. Then how to achieve without multiple loops.
public static void createOpp(List<Account> accList) {
List<Opportunity> oppList = new List<Opportunity>();
Map<Id, Account> acctMap = new Map<Id, Account>([Select Id, (Select Id, probability from Opportunities) from Account WHERE ID IN :accList]);
for(Account a : accList) {
for(Account ao: acList) {
for(Opportunity opp : ao.opportunities) {
if( opp.probability == 90){
Opportunity opptny = new Opportunity();
opptny.AccountId = a.Id;
opptny.Name = a.Name + 'Opportunity with 90% prob new';
opptny.StageName = 'Prospecting';
opptny.probability = 90;
opptny.CloseDate = System.today().addMonths(3);
oppList.add(opptny);
}
}
}
}
try{
if(oppList.size() > 0){
insert oppList;
}
} catch (DmlException e) {
system.debug('Exception caused-->'+e.getMessage());
}
}
- Abilash.S
- October 28, 2022
- Like
- 0
- Continue reading or reply
How to add multiple wrapper list into single list
Hi Everyone,
I have created apex class to pull multiple object records into single list. Where objects does not have any relationship (lets say account, contact, lead. Consider account and contact dont have any relationship). I used for loop seperately for each object and saved into wrapperlist. For threee objects I have three wrapper list. Now big challenge is I need to add three wrappers(wrapAccount, wrapContact, wrapLead) into single list. So in that list I need all three objects records.
-------------------------------------------------------------------------
@Auraenabled(cacheable=true)
public static List<sObject> wrapData() {
List<WrapperContact> wrapContact = new List<WrapperContact>();
List<WrapperAccount> wrapAccount = new List<WrapperAccount>();
List<WrapperLead> wrapLead = new List<WrapperLead>();
for(Contact ct : [select id, name from Contact LIMIT 10]){
wrapContact.add(new WrapperContact(ct));
}
for(Account acct : [select id, name from Account LIMIT 10]){
wrapAccount.add(new WrapperAccount(acct));
}
for(Lead ld : [select id, name from Lead LIMIT 10]){
wrapLead.add(new WrapperLead(ld));
}
system.debug('wrapContact'+wrapContact);
system.debug('wrapAccount'+wrapAccount);
system.debug('wrapLead'+wrapLead);
List<SObject> s = new List<SObject>{
new Contact(),
new Account(),
new Lead()
};
// s.add(wrapContact);
// s.addAll(wrapAccount);
// system.debug(s);
List<sObject> objects = new List<sObject>();
// objects.addAll((List<sObject>)(wrapContact));
// objects.addAll((List<sObject>)(wrapAccount));
// objects.addAll(wrapLead);
return objects;
}
public class WrapperAccount{
@Auraenabled
public Account ac{get;set;}
public WrapperAccount(Account acct){
ac=acct;
}
}
public class WrapperContact{
@Auraenabled
public Contact cont{get;set;}
public WrapperContact(Contact ct){
cont=ct;
}
}
public class WrapperLead{
@Auraenabled
public Lead ldd{get;set;}
public WrapperLead(Lead ld){
ldd=ld;
}
}
----------------------------------------------------------------------
I have used List<SObject> s = new List<SObject>{
new Contact(),
new Account(),
new Lead()
};
// s.add(wrapContact);
// s.addAll(wrapAccount);
s.addAll(wrapLead);
// system.debug(s);
But its not working. Please help me out of this.
Thanks in Advance
I have created apex class to pull multiple object records into single list. Where objects does not have any relationship (lets say account, contact, lead. Consider account and contact dont have any relationship). I used for loop seperately for each object and saved into wrapperlist. For threee objects I have three wrapper list. Now big challenge is I need to add three wrappers(wrapAccount, wrapContact, wrapLead) into single list. So in that list I need all three objects records.
-------------------------------------------------------------------------
@Auraenabled(cacheable=true)
public static List<sObject> wrapData() {
List<WrapperContact> wrapContact = new List<WrapperContact>();
List<WrapperAccount> wrapAccount = new List<WrapperAccount>();
List<WrapperLead> wrapLead = new List<WrapperLead>();
for(Contact ct : [select id, name from Contact LIMIT 10]){
wrapContact.add(new WrapperContact(ct));
}
for(Account acct : [select id, name from Account LIMIT 10]){
wrapAccount.add(new WrapperAccount(acct));
}
for(Lead ld : [select id, name from Lead LIMIT 10]){
wrapLead.add(new WrapperLead(ld));
}
system.debug('wrapContact'+wrapContact);
system.debug('wrapAccount'+wrapAccount);
system.debug('wrapLead'+wrapLead);
List<SObject> s = new List<SObject>{
new Contact(),
new Account(),
new Lead()
};
// s.add(wrapContact);
// s.addAll(wrapAccount);
// system.debug(s);
List<sObject> objects = new List<sObject>();
// objects.addAll((List<sObject>)(wrapContact));
// objects.addAll((List<sObject>)(wrapAccount));
// objects.addAll(wrapLead);
return objects;
}
public class WrapperAccount{
@Auraenabled
public Account ac{get;set;}
public WrapperAccount(Account acct){
ac=acct;
}
}
public class WrapperContact{
@Auraenabled
public Contact cont{get;set;}
public WrapperContact(Contact ct){
cont=ct;
}
}
public class WrapperLead{
@Auraenabled
public Lead ldd{get;set;}
public WrapperLead(Lead ld){
ldd=ld;
}
}
----------------------------------------------------------------------
I have used List<SObject> s = new List<SObject>{
new Contact(),
new Account(),
new Lead()
};
// s.add(wrapContact);
// s.addAll(wrapAccount);
s.addAll(wrapLead);
// system.debug(s);
But its not working. Please help me out of this.
Thanks in Advance
- Abilash.S
- October 18, 2022
- Like
- 0
- Continue reading or reply
Cannot receive email to customer when case closed
Hi Everyone,
We used apex class to send email to customer once case gets closed. It works fine when we use workflows to send email. But we used apex class to send email to customer. The customer has COMMUNITY license with customer profile. I dont see email related permissions for community license profiles. Is is any permission issue why customer cannot receive email. I am sure about apex class. How could I achieve this.
Thanks in advance.
We used apex class to send email to customer once case gets closed. It works fine when we use workflows to send email. But we used apex class to send email to customer. The customer has COMMUNITY license with customer profile. I dont see email related permissions for community license profiles. Is is any permission issue why customer cannot receive email. I am sure about apex class. How could I achieve this.
Thanks in advance.
- Pavushetti Abhilash 3
- January 27, 2022
- Like
- 0
- Continue reading or reply
Restrict user to create record when user selects particular value in picklist.
There is an account and contact which have the relationship. In contact there is a picklist which is mandatory. Say for eg picklist contains states of India. If user selects Maharashtra state, then that user should not allow to create a record in contact. How could I accomplish this. Please provide required coding part.
- Abilash.S
- April 22, 2021
- Like
- 0
- Continue reading or reply
Based on picklist value, stars should represent
I have customer feedback object. When I select picklist values of 1,2,3,4,5. Automatically stars should represent. If I select 3 from picklist, 3 stars need to display. Based on picklist values stars should display. How could I accomplish this.
- Abilash.S
- April 20, 2021
- Like
- 0
- Continue reading or reply
trigger to prevent duplicate email id
Write a trigger to prevent duplicate email id in contact.
Please dont share any related links on Duplicate preventions. Help me on writing code what exactly need to apply.
Please dont share any related links on Duplicate preventions. Help me on writing code what exactly need to apply.
- Abilash.S
- April 06, 2021
- Like
- 0
- Continue reading or reply
Create list view from Apex
Hi,
I have a requriment to create list view from VF page.
Is there any way to create listview from apex
I have a requriment to create list view from VF page.
Is there any way to create listview from apex
- K Srikanth
- June 10, 2020
- Like
- 0
- Continue reading or reply