- Shantanu Punekar 5
- NEWBIE
- 10 Points
- Member since 2015
- Senior Software Engineer
- Atos
-
ChatterFeed
-
0Best Answers
-
0Likes Received
-
0Likes Given
-
8Questions
-
5Replies
Trigger to send Auto Response Email on Case
Hi,
I need to send an auto response email whenever a case is subbmited by EmailToCase. We (due to some reasons) cannot use Case Auto Response Rules. So I need to write a trigger which will send auto response email with template and importantly tagg the email under that perticular Case.
As a work around I created workflow to send such email but the email log is not seen under Case related list.
Can someone please help me starting up with the trigger?
I need to send an auto response email whenever a case is subbmited by EmailToCase. We (due to some reasons) cannot use Case Auto Response Rules. So I need to write a trigger which will send auto response email with template and importantly tagg the email under that perticular Case.
As a work around I created workflow to send such email but the email log is not seen under Case related list.
Can someone please help me starting up with the trigger?
- Shantanu Punekar 5
- September 18, 2017
- Like
- 0
- Continue reading or reply
Can I use Heroku for data archival and retrieval ? Details in description:
Req. 1 - I have to analyse if I can archive 80% of my data in Heroku and 20% of data in salesforce. The data in Heroku should be accessible in salesforce whenever searched for (Read only mode).
Req 2 - If archived data in Heroku can be displayed in salesforce, can that data be saved in salesforce if wanted?
Can this be achieved using Heroku with salesforce? If yes, what can be best possible ways to impliment it?
Thanks in advance.
Req 2 - If archived data in Heroku can be displayed in salesforce, can that data be saved in salesforce if wanted?
Can this be achieved using Heroku with salesforce? If yes, what can be best possible ways to impliment it?
Thanks in advance.
- Shantanu Punekar 5
- May 18, 2017
- Like
- 0
- Continue reading or reply
Single email messaging: Target object id help
I have written a class to send an email to parent record owner and creater whenever a child record is created.
In this class we are using an email template (Merge fields) and we need to set target object id, if we set target object Id as a User we cannot set WhatId (throws error). As a work around we are creating a dummy contact with dummy email and using that Contact in target objectId. But in this situation we receive additional email stating email delivery failed to the dummy contact email.
Is there any solution to use User as a target object Id and WhatId so the email will be sent with template and merged fields ?
Thanks in advance.
In this class we are using an email template (Merge fields) and we need to set target object id, if we set target object Id as a User we cannot set WhatId (throws error). As a work around we are creating a dummy contact with dummy email and using that Contact in target objectId. But in this situation we receive additional email stating email delivery failed to the dummy contact email.
Is there any solution to use User as a target object Id and WhatId so the email will be sent with template and merged fields ?
Thanks in advance.
- Shantanu Punekar 5
- May 24, 2016
- Like
- 0
- Continue reading or reply
Formula to exclude weekends.
Hello,
I found below formula to add 3 business days to current date, this excludes the weends.
CASE(MOD(TODAY()- DATE(1900, 1, 7), 7), 0, TODAY()+3, 1, TODAY()+3, 2, TODAY()+3,3, TODAY()+5, 4, TODAY()+5, 5, TODAY()+5, 6, TODAY()+4,null)
I need to modify this formula to add 10 / 15 + todays date, i'm unable to identify where exactly to change in the formula which will display TODAY() + 10 business days.
Please help,
Thanks in advance.
I found below formula to add 3 business days to current date, this excludes the weends.
CASE(MOD(TODAY()- DATE(1900, 1, 7), 7), 0, TODAY()+3, 1, TODAY()+3, 2, TODAY()+3,3, TODAY()+5, 4, TODAY()+5, 5, TODAY()+5, 6, TODAY()+4,null)
I need to modify this formula to add 10 / 15 + todays date, i'm unable to identify where exactly to change in the formula which will display TODAY() + 10 business days.
Please help,
Thanks in advance.
- Shantanu Punekar 5
- May 04, 2016
- Like
- 0
- Continue reading or reply
Trailhead error
Getting this error tough everything is created as its stated.
Completed:
Unable to proceed further.
Completed:
Unable to proceed further.
- Shantanu Punekar 5
- July 15, 2015
- Like
- 0
- Continue reading or reply
Integration with office 365
Hello,
Below is the clients requirement, can someone help how to achieve this:
"We are looking for help in setting up Salesforce's Files Connect with Office 365. We are using a combination of Office 365, OneDrive for Business, and SharePoint Sites to store files and would like to interface this with our Salesforce setup."
Thanks in advance.
Below is the clients requirement, can someone help how to achieve this:
"We are looking for help in setting up Salesforce's Files Connect with Office 365. We are using a combination of Office 365, OneDrive for Business, and SharePoint Sites to store files and would like to interface this with our Salesforce setup."
Thanks in advance.
- Shantanu Punekar 5
- June 08, 2015
- Like
- 0
- Continue reading or reply
Test class on Trigger to create Task on Opportunity update.
Hello all,
I have created below trigger and a test class for it, still its not covering the trigger. What needs to be changed in this test class?
Please help
Trigger:
trigger OppTask on Opportunity (after update) {
List <Contact> conList = [SELECT ID,AccountID FROM Contact WHERE AccountId IN (SELECT AccountId FROM Opportunity WHERE Id IN :Trigger.new)];
map<ID,Contact> accountIDWithContactMap = new map<ID,Contact>();
for(Contact con : conList){
accountIDWithContactMap.put(con.AccountID, con);
}
for(Opportunity Opp : Trigger.new){
if(Trigger.newMap.get(opp.Id).StageName != Trigger.oldMap.get(opp.Id).StageName && opp.StageName == 'Closed Won' && accountIDWithContactMap.containsKey(Opp.AccountId)){
Task T = new Task();
T.WhatId = opp.Id;
T.OwnerId = opp.OwnerId;
T.Subject = 'Call';
T.Status = 'In Progress';
T.IsReminderSet = TRUE;
T.WhoId = accountIDWithContactMap.get(Opp.AccountId).ID;
T.ReminderDateTime = DateTime.now().addHours(24);
insert T;
}
}
Test Class:
@isTest
public class testOppTaskTrigger{
static testMethod void ValidateOppTaskTrigger(){
Test.startTest();
Account testAcc = new Account (Name = 'Test Account');
insert testAcc;
User U = [SELECT ID, Name FROM User WHERE Profile.Name = 'System Administrator'];
Opportunity testOpp = new Opportunity (Name = 'Test Name',
OwnerId =U.Id,
AccountId = testAcc.Id,
StageName = 'Open',
Amount = 50000.00,
CloseDate = System.today()
);
insert testOpp;
Opportunity testOpp2 = [SELECT Name, Id, StageName FROM Opportunity WHERE Id =: testOpp.Id];
if(testOpp2.StageName == 'Closed Won') {
update testOpp;
Task testTask = new Task ( WhatId = testOpp2.Id,
OwnerId = testOpp2.OwnerId,
Subject = 'Call',
Status = 'In Progress',
IsReminderSet = TRUE,
ReminderDateTime = DateTime.now().addHours(24));
insert testTask;
Test.stopTest();
}
}
}
I have created below trigger and a test class for it, still its not covering the trigger. What needs to be changed in this test class?
Please help
Trigger:
trigger OppTask on Opportunity (after update) {
List <Contact> conList = [SELECT ID,AccountID FROM Contact WHERE AccountId IN (SELECT AccountId FROM Opportunity WHERE Id IN :Trigger.new)];
map<ID,Contact> accountIDWithContactMap = new map<ID,Contact>();
for(Contact con : conList){
accountIDWithContactMap.put(con.AccountID, con);
}
for(Opportunity Opp : Trigger.new){
if(Trigger.newMap.get(opp.Id).StageName != Trigger.oldMap.get(opp.Id).StageName && opp.StageName == 'Closed Won' && accountIDWithContactMap.containsKey(Opp.AccountId)){
Task T = new Task();
T.WhatId = opp.Id;
T.OwnerId = opp.OwnerId;
T.Subject = 'Call';
T.Status = 'In Progress';
T.IsReminderSet = TRUE;
T.WhoId = accountIDWithContactMap.get(Opp.AccountId).ID;
T.ReminderDateTime = DateTime.now().addHours(24);
insert T;
}
}
Test Class:
@isTest
public class testOppTaskTrigger{
static testMethod void ValidateOppTaskTrigger(){
Test.startTest();
Account testAcc = new Account (Name = 'Test Account');
insert testAcc;
User U = [SELECT ID, Name FROM User WHERE Profile.Name = 'System Administrator'];
Opportunity testOpp = new Opportunity (Name = 'Test Name',
OwnerId =U.Id,
AccountId = testAcc.Id,
StageName = 'Open',
Amount = 50000.00,
CloseDate = System.today()
);
insert testOpp;
Opportunity testOpp2 = [SELECT Name, Id, StageName FROM Opportunity WHERE Id =: testOpp.Id];
if(testOpp2.StageName == 'Closed Won') {
update testOpp;
Task testTask = new Task ( WhatId = testOpp2.Id,
OwnerId = testOpp2.OwnerId,
Subject = 'Call',
Status = 'In Progress',
IsReminderSet = TRUE,
ReminderDateTime = DateTime.now().addHours(24));
insert testTask;
Test.stopTest();
}
}
}
- Shantanu Punekar 5
- June 05, 2015
- Like
- 0
- Continue reading or reply
Trigger for creating junction object automatically.
Hello,
I have a requirement, where a junction object record needs to be created based on the matching field values of both the parent objects.
For e.g Master1 object (Flat) has a picklist field 'Flat type' (1BHK, 2BHK) and same field is there on Master2 object (Enquiry). If 'Flat type' picklist value matches in both Master object a new junction object record needs to be created with same both records as parent.
i.e If a Enquiry record is created with 1BHK as Flat Type then it should match with some existing record in Flat object with 1BHK as flat type and then a new junction object record should be created.
I am new in development and have no idea where to start with.
Please help.
Thanks in advance.
I have a requirement, where a junction object record needs to be created based on the matching field values of both the parent objects.
For e.g Master1 object (Flat) has a picklist field 'Flat type' (1BHK, 2BHK) and same field is there on Master2 object (Enquiry). If 'Flat type' picklist value matches in both Master object a new junction object record needs to be created with same both records as parent.
i.e If a Enquiry record is created with 1BHK as Flat Type then it should match with some existing record in Flat object with 1BHK as flat type and then a new junction object record should be created.
I am new in development and have no idea where to start with.
Please help.
Thanks in advance.
- Shantanu Punekar 5
- May 28, 2015
- Like
- 0
- Continue reading or reply
Formula to exclude weekends.
Hello,
I found below formula to add 3 business days to current date, this excludes the weends.
CASE(MOD(TODAY()- DATE(1900, 1, 7), 7), 0, TODAY()+3, 1, TODAY()+3, 2, TODAY()+3,3, TODAY()+5, 4, TODAY()+5, 5, TODAY()+5, 6, TODAY()+4,null)
I need to modify this formula to add 10 / 15 + todays date, i'm unable to identify where exactly to change in the formula which will display TODAY() + 10 business days.
Please help,
Thanks in advance.
I found below formula to add 3 business days to current date, this excludes the weends.
CASE(MOD(TODAY()- DATE(1900, 1, 7), 7), 0, TODAY()+3, 1, TODAY()+3, 2, TODAY()+3,3, TODAY()+5, 4, TODAY()+5, 5, TODAY()+5, 6, TODAY()+4,null)
I need to modify this formula to add 10 / 15 + todays date, i'm unable to identify where exactly to change in the formula which will display TODAY() + 10 business days.
Please help,
Thanks in advance.
- Shantanu Punekar 5
- May 04, 2016
- Like
- 0
- Continue reading or reply
Trailhead error
Getting this error tough everything is created as its stated.
Completed:
Unable to proceed further.
Completed:
Unable to proceed further.
- Shantanu Punekar 5
- July 15, 2015
- Like
- 0
- Continue reading or reply
Test class on Trigger to create Task on Opportunity update.
Hello all,
I have created below trigger and a test class for it, still its not covering the trigger. What needs to be changed in this test class?
Please help
Trigger:
trigger OppTask on Opportunity (after update) {
List <Contact> conList = [SELECT ID,AccountID FROM Contact WHERE AccountId IN (SELECT AccountId FROM Opportunity WHERE Id IN :Trigger.new)];
map<ID,Contact> accountIDWithContactMap = new map<ID,Contact>();
for(Contact con : conList){
accountIDWithContactMap.put(con.AccountID, con);
}
for(Opportunity Opp : Trigger.new){
if(Trigger.newMap.get(opp.Id).StageName != Trigger.oldMap.get(opp.Id).StageName && opp.StageName == 'Closed Won' && accountIDWithContactMap.containsKey(Opp.AccountId)){
Task T = new Task();
T.WhatId = opp.Id;
T.OwnerId = opp.OwnerId;
T.Subject = 'Call';
T.Status = 'In Progress';
T.IsReminderSet = TRUE;
T.WhoId = accountIDWithContactMap.get(Opp.AccountId).ID;
T.ReminderDateTime = DateTime.now().addHours(24);
insert T;
}
}
Test Class:
@isTest
public class testOppTaskTrigger{
static testMethod void ValidateOppTaskTrigger(){
Test.startTest();
Account testAcc = new Account (Name = 'Test Account');
insert testAcc;
User U = [SELECT ID, Name FROM User WHERE Profile.Name = 'System Administrator'];
Opportunity testOpp = new Opportunity (Name = 'Test Name',
OwnerId =U.Id,
AccountId = testAcc.Id,
StageName = 'Open',
Amount = 50000.00,
CloseDate = System.today()
);
insert testOpp;
Opportunity testOpp2 = [SELECT Name, Id, StageName FROM Opportunity WHERE Id =: testOpp.Id];
if(testOpp2.StageName == 'Closed Won') {
update testOpp;
Task testTask = new Task ( WhatId = testOpp2.Id,
OwnerId = testOpp2.OwnerId,
Subject = 'Call',
Status = 'In Progress',
IsReminderSet = TRUE,
ReminderDateTime = DateTime.now().addHours(24));
insert testTask;
Test.stopTest();
}
}
}
I have created below trigger and a test class for it, still its not covering the trigger. What needs to be changed in this test class?
Please help
Trigger:
trigger OppTask on Opportunity (after update) {
List <Contact> conList = [SELECT ID,AccountID FROM Contact WHERE AccountId IN (SELECT AccountId FROM Opportunity WHERE Id IN :Trigger.new)];
map<ID,Contact> accountIDWithContactMap = new map<ID,Contact>();
for(Contact con : conList){
accountIDWithContactMap.put(con.AccountID, con);
}
for(Opportunity Opp : Trigger.new){
if(Trigger.newMap.get(opp.Id).StageName != Trigger.oldMap.get(opp.Id).StageName && opp.StageName == 'Closed Won' && accountIDWithContactMap.containsKey(Opp.AccountId)){
Task T = new Task();
T.WhatId = opp.Id;
T.OwnerId = opp.OwnerId;
T.Subject = 'Call';
T.Status = 'In Progress';
T.IsReminderSet = TRUE;
T.WhoId = accountIDWithContactMap.get(Opp.AccountId).ID;
T.ReminderDateTime = DateTime.now().addHours(24);
insert T;
}
}
Test Class:
@isTest
public class testOppTaskTrigger{
static testMethod void ValidateOppTaskTrigger(){
Test.startTest();
Account testAcc = new Account (Name = 'Test Account');
insert testAcc;
User U = [SELECT ID, Name FROM User WHERE Profile.Name = 'System Administrator'];
Opportunity testOpp = new Opportunity (Name = 'Test Name',
OwnerId =U.Id,
AccountId = testAcc.Id,
StageName = 'Open',
Amount = 50000.00,
CloseDate = System.today()
);
insert testOpp;
Opportunity testOpp2 = [SELECT Name, Id, StageName FROM Opportunity WHERE Id =: testOpp.Id];
if(testOpp2.StageName == 'Closed Won') {
update testOpp;
Task testTask = new Task ( WhatId = testOpp2.Id,
OwnerId = testOpp2.OwnerId,
Subject = 'Call',
Status = 'In Progress',
IsReminderSet = TRUE,
ReminderDateTime = DateTime.now().addHours(24));
insert testTask;
Test.stopTest();
}
}
}
- Shantanu Punekar 5
- June 05, 2015
- Like
- 0
- Continue reading or reply
Trailhead Challenge
I completed the challenge, earning the Force.com basics and Date Modeling badges, however I did so under a different login than my Salesforce employee login. I was having trouble accessing the developer zone and created a seperate account for it. Can I have the badges under my developer edition login transferred to my normal Salesforce employee login and am I still qualified for the t-shirt giveaway?
- Erick Betancourt 13
- February 02, 2015
- Like
- 0
- Continue reading or reply