-
ChatterFeed
-
1Best Answers
-
0Likes Received
-
0Likes Given
-
20Questions
-
21Replies
Account and Parent Account
Hi Everyone,
Can anyone tell me what is the difference between account and parent account
Thanks in advance
Karthick
Can anyone tell me what is the difference between account and parent account
Thanks in advance
Karthick
- SS Karthick
- July 25, 2014
- Like
- 0
- Continue reading or reply
Saving a custom object record as pdf attachment for the record
Hi,
I have a custom object named "Sales Order", would like to save object record as pdf on save under Files related list of the Sales Order.
Provision to format the pdf record with HTML/CSS and restricting the fields to get saved is highly desirable.
Can some one help with available options for me.
Thanks,
Prasanth
I have a custom object named "Sales Order", would like to save object record as pdf on save under Files related list of the Sales Order.
Provision to format the pdf record with HTML/CSS and restricting the fields to get saved is highly desirable.
Can some one help with available options for me.
Thanks,
Prasanth
- Prasanth Reddy M
- December 14, 2019
- Like
- 0
- Continue reading or reply
Account Redirect page for EDIT is working for VF pages but for standard layouts its returning home page.
Hi,
The bellow Account Redirect page for EDIT is working fine for VF pages but for standard layouts after editing the record it is not returning home page instead of account detail page.
Am i missing something here?
Pls suggest.
The bellow Account Redirect page for EDIT is working fine for VF pages but for standard layouts after editing the record it is not returning home page instead of account detail page.
Am i missing something here?
Pls suggest.
public with sharing class DispatcherAccounteditController { public DispatcherAccounteditController(ApexPages.StandardController controller) { this.controller = controller; } public PageReference getRedir() { Account acc = [Select id, recordtypeid From Account Where Id = :ApexPages.currentPage().getParameters().get('id')]; PageReference newPage; if (acc.recordtypeid == '0123B000000Hs88') { newPage = Page.AccountEdt; } else { newPage = new PageReference('/' + acc.id +'/e'); newPage.getParameters().put('nooverride', '1'); } newPage.getParameters().put('id', acc.id); return newPage.setRedirect(true); } private final ApexPages.StandardController controller; }
- Prasanth Reddy M
- April 22, 2019
- Like
- 0
- Continue reading or reply
Test class for VF Controller
Hi,
For the below controller the test coverage is not exceeding 50%.
highlighted 2 lines are showing as not covered in test class.
Can someone please correct me on this?
Public with sharing class DispatcherAccountNewController {
public DispatcherAccountNewController(ApexPages.StandardController controller) {
this.controller = controller;
}
public PageReference getRedir() {
PageReference newPage;
if (ApexPages.currentPage().getParameters().get('RecordType') == '0123B000000Hs88') {
newPage = Page.newaccount;
return newPage.setRedirect(true);
}
else if (ApexPages.currentPage().getParameters().get('RecordType') == '01232000000DxHz') {
newPage = Page.abc_new_account;
return newPage.setRedirect(true);
}
else if (ApexPages.currentPage().getParameters().get('RecordType') == '0120d0000009grC') {
newPage = Page.health_integrated_new_account;
return newPage.setRedirect(true);
}
else if (ApexPages.currentPage().getParameters().get('RecordType') == '01232000000DxI0') {
newPage = Page.olsi_new_account;
return newPage.setRedirect(true);
}
else {
return null;
}
}
private final ApexPages.StandardController controller;
}
testclass -
@isTest
private class DispatcherAccountNewController_Test{
@testSetup
static void setupTestData(){
test.startTest();
Account account_Obj = new Account(Name = 'Name897', RecordTypeId = '0123B000000Hs88');
Insert account_Obj;
test.stopTest();
}
static testMethod void test_getRedir_UseCase1(){
List<Account> account_Obj = [SELECT Name,RecordTypeId from Account];
System.assertEquals(true,account_Obj.size()>0);
PageReference newpage = Page.newaccount;
newpage.getParameters().put('RecordTypeid','0123B000000Hs88');
Test.setCurrentPage(newpage);
DispatcherAccountNewController obj01 = new DispatcherAccountNewController(new ApexPages.StandardController(account_Obj[0]));
obj01.getRedir();
}
}
For the below controller the test coverage is not exceeding 50%.
highlighted 2 lines are showing as not covered in test class.
Can someone please correct me on this?
Public with sharing class DispatcherAccountNewController {
public DispatcherAccountNewController(ApexPages.StandardController controller) {
this.controller = controller;
}
public PageReference getRedir() {
PageReference newPage;
if (ApexPages.currentPage().getParameters().get('RecordType') == '0123B000000Hs88') {
newPage = Page.newaccount;
return newPage.setRedirect(true);
}
else if (ApexPages.currentPage().getParameters().get('RecordType') == '01232000000DxHz') {
newPage = Page.abc_new_account;
return newPage.setRedirect(true);
}
else if (ApexPages.currentPage().getParameters().get('RecordType') == '0120d0000009grC') {
newPage = Page.health_integrated_new_account;
return newPage.setRedirect(true);
}
else if (ApexPages.currentPage().getParameters().get('RecordType') == '01232000000DxI0') {
newPage = Page.olsi_new_account;
return newPage.setRedirect(true);
}
else {
return null;
}
}
private final ApexPages.StandardController controller;
}
testclass -
@isTest
private class DispatcherAccountNewController_Test{
@testSetup
static void setupTestData(){
test.startTest();
Account account_Obj = new Account(Name = 'Name897', RecordTypeId = '0123B000000Hs88');
Insert account_Obj;
test.stopTest();
}
static testMethod void test_getRedir_UseCase1(){
List<Account> account_Obj = [SELECT Name,RecordTypeId from Account];
System.assertEquals(true,account_Obj.size()>0);
PageReference newpage = Page.newaccount;
newpage.getParameters().put('RecordTypeid','0123B000000Hs88');
Test.setCurrentPage(newpage);
DispatcherAccountNewController obj01 = new DispatcherAccountNewController(new ApexPages.StandardController(account_Obj[0]));
obj01.getRedir();
}
}
- Prasanth Reddy M
- April 16, 2019
- Like
- 0
- Continue reading or reply
Visualforce page is not redirecting to specific VF pages with associated record types.
Hi,
For Account, we have few record types. we want to have the related vf page displayed when a specific record type is selected.
However, upon selecting a record type, the below vf page is not directing the VF new record page specific to record type.
We also have a domain for our instance.
Am i missing something here?
For Account, we have few record types. we want to have the related vf page displayed when a specific record type is selected.
However, upon selecting a record type, the below vf page is not directing the VF new record page specific to record type.
We also have a domain for our instance.
Am i missing something here?
<apex:page standardController="Account" extensions="NewAccountExtension" action="{!redirectToNewVFPage}"> </apex:page>
public with sharing class NewAccountExtension { public String recordTypeId; public NewAccountExtension(ApexPages.StandardController std) { } public Pagereference redirectToNewVFPage(){ Pagereference pg = null; if(ApexPages.CurrentPage().getParameters().get('RecordType') != null){ recordTypeId = ApexPages.CurrentPage().getParameters().get('RecordType'); if(recordTypeId == Schema.SObjectType.Account.getRecordTypeInfosByName().get('Finance_Account').getRecordTypeId()){ pg = new Pagereference('https://avantegrande.cs50.my.salesforce.comapex/fin_new_account'); }else if(recordTypeId == Schema.SObjectType.Account.getRecordTypeInfosByName().get('Logistics_Account').getRecordTypeId()){ pg = new Pagereference('https://avantegrande.cs50.my.salesforce.com/apex/logi_account'); } pg.setRedirect(true); return pg; } return null; } }
- Prasanth Reddy M
- November 05, 2018
- Like
- 0
- Continue reading or reply
How to make fields from lookup objects which are mapped to a custom object will not get updated when there is an update for the lookup object?
Hi Guys,
Have exposed account object's 3 fields to a custom object with the help of lookup relationship of account with the custom object. I just want to ensure any changes for these 3 fields in the Account object should not overwrite the values initial values in custom object when the record created for the first time.
How can we achieve this?
Have exposed account object's 3 fields to a custom object with the help of lookup relationship of account with the custom object. I just want to ensure any changes for these 3 fields in the Account object should not overwrite the values initial values in custom object when the record created for the first time.
How can we achieve this?
- Prasanth Reddy M
- January 18, 2017
- Like
- 0
- Continue reading or reply
Apex Trigger Code Coverage
Hi,
Below is my Apex Trigger and Test Class i have writte, the trigger is only showing 67% code coverage. Am i missing something here ?
Test Class -
Below is my Apex Trigger and Test Class i have writte, the trigger is only showing 67% code coverage. Am i missing something here ?
trigger LeadandContactfieldsinTask on Task (after insert) { Set<Id> leadids = new Set<Id>(); Set<Id> contactids = new Set<Id>(); List<Task> taskstoupdate = new list<Task>(); String FName = 'Sathiya'; //Fetch only Leads which follow criteria for(Lead ld : [ SELECT Id, company, Leadsource, Rating, Title, sales_offering__c FROM lead WHERE Owner.FirstName!= :FName]) { leadids.add(ld.Id); } //Fetch only Leads which follow criteria for(Contact cts : [SELECT Id, Account.Name, LeadSource, Rating__c, Title, Sales_Offering__C from Contact]) { contactids.add(cts.Id); } //Iterate over all Leads and modify Tasks for them + Add to a list variable for(Lead ld : [SELECT Id, company, Leadsource, Rating, Title, sales_offering__c, (SELECT Id, Company_Account__c, Lead_Source__c, Qualification__c, Solution_of_Interest__c, Title__c FROM Tasks) from Lead Where Id IN : leadids]) { for(Task t : ld.Tasks) { t.Company_Account__c = ld.company; t.Lead_Source__c = ld.Leadsource; t.Qualification__c=ld.Rating; t.Title__c= ld.Title; t.Solution_Of_Interest__c = ld.Sales_Offering__C; taskstoupdate.add(t); } } for(Contact cts : [SELECT Id, Account.Name, LeadSource, Rating__c, Title, Sales_Offering__C, (SELECT Id, Company_Account__c, Lead_Source__c, Qualification__c, Solution_of_Interest__c, Title__c FROM Tasks) from contact Where Id IN : contactids]) { for(Task t : cts.Tasks) { t.Company_Account__c = cts.Account.Name; t.Lead_Source__c = cts.Leadsource; t.Qualification__c=cts.Rating__c; t.Title__c= cts.Title; t.Solution_Of_Interest__c = cts.Sales_Offering__C; taskstoupdate.add(t); } } //Update Tasks if(taskstoupdate.size()>0) { update taskstoupdate; } }
Test Class -
@isTest private class LeadandContactfieldsinTask { static testMethod void myUnitTest() { Lead l1 = new Lead( LastName = 'Last', Title='CEO', Company='ABC Corp', Leadsource = 'webinar', Rating='Hot', Sales_offering__c = 'Quality', ownerid = '005700000012VFZ'); insert (l1); string l1Id = l1.id; Account ACC = new Account( name = 'ABC Corp', Ownerid='005700000012VFZ', Type = 'Prospect'); Insert (Acc); string accId = acc.Id; string AccName = acc.Name; Contact c1 = new Contact( LastName = 'last', AccountID = ACC.ID, Title = 'CEO', LeadSource = 'Webinar', Rating__C = 'Hot', Sales_Offering__C='HEOR'); insert (c1); string c1Id = c1.Id; test.startTest(); Task tsk1 = new Task( Subject = 'Test task for Lead', Status = 'Not Started', Priority = 'High', Type_of_Correspondence__c ='call', Whoid= l1.id); insert (tsk1); Task tsk2 = new Task( Subject = 'Test for Contact Task', Status = 'Not Started', Priority = 'High', Type_of_Correspondence__c = 'call', whoid = c1.Id); insert (tsk2); } }
- Prasanth Reddy M
- April 25, 2016
- Like
- 0
- Continue reading or reply
system.limitexception: too many query rows: 50001 in Production Instance
Hi,
For below trigger, when i have deployed in production, i am getting the "limit exception : too many query rows : 50001"
how can i fix this ?
For below trigger, when i have deployed in production, i am getting the "limit exception : too many query rows : 50001"
trigger TaskUpdatewithLeadComments on Task (after insert) { Set<Id> leadids = new Set<Id>(); List<Task> taskstoupdate = new list<Task>(); //Fetch only Leads which follow criteria for(Lead ld : [ SELECT Id, company FROM lead ]) { leadids.add(ld.Id); } //Iterate over all Leads and modify Tasks for them + Add to a list variable for(Lead ld : [SELECT Id, Prospect_notes__c,(SELECT Id, Whatid, Description FROM Tasks) from Lead Where Id IN : leadids]) { for(Task t : ld.Tasks) { if(t.Description==null) t.Description = ld.prospect_notes__c; taskstoupdate.add(t); } } //Update Tasks if(taskstoupdate.size()>0) { update taskstoupdate; } }
how can i fix this ?
- Prasanth Reddy M
- February 11, 2016
- Like
- 0
- Continue reading or reply
test class compilation error
Hi, I am getting nullpointer exception while running below test class.
After inserting both contact and campaign objects only, i am referring them in campaign member object, wondering what i am missing here.
Below is the error
Class CampaignMemberTaskcreation
Method Name testtask
Pass/Fail Fail
Error Message System.NullPointerException: Attempt to de-reference a null object
Stack Trace Class.CampaignMemberTaskcreation.testtask: line 22, column 1
After inserting both contact and campaign objects only, i am referring them in campaign member object, wondering what i am missing here.
@isTest public class CampaignMemberTaskcreation { Static testmethod void testtask(){ Contact co1 = new Contact( LastName = 'Last', Title='CEO'); insert co1; string co1Id = co1.id; Campaign ca1 = new Campaign( Name = 'Testcampaign', Date_Sent__c=Date.today(), IsActive = TRUE); insert ( ca1 ); string ca1Id = ca1.id; CampaignMember m1 = new CampaignMember(); m1.Contact.Id = co1.Id; m1.Campaign.Id = ca1.Id; m1.status='Responded'; insert m1; } }
Below is the error
Class CampaignMemberTaskcreation
Method Name testtask
Pass/Fail Fail
Error Message System.NullPointerException: Attempt to de-reference a null object
Stack Trace Class.CampaignMemberTaskcreation.testtask: line 22, column 1
- Prasanth Reddy M
- January 28, 2016
- Like
- 0
- Continue reading or reply
Error while testing trigger in sandbox
I have received below error, when testing below trigger.
Trigger:
trigger CampaignMemberTaskCreation on CampaignMember (after update) {
list<Task> AddTask=new List<Task>();
for(CampaignMember CM : Trigger.new) {
if(cm.Status == 'Responded'){
AddTask.add(new Task(
WhoId = CM.ContactId,
Status = 'Completed',
Description='CM.Description',
Subject = 'Call - ' + CM,
Whatid= CM.CampaignId));
}
}
insert AddTask;
}
Error Message, when tried to update the campaign member status:
Sandbox
Apex script unhandled trigger exception by user/organization: 00570000003003D/00D190000000OrW Source organization: 00D700000008ieh (null)
CampaignMemberTaskCreation: execution of AfterUpdate
caused by: System.DmlException: Insert failed. First exception on row 0; first error: STRING_TOO_LONG, Subject: data value too large: Call - CampaignMember:{Id=00v19000000TEZkAAO, IsDeleted=false, CampaignId=70119000000A3qoAAC, LeadId=00Q19000001eGJWEA2, ContactId=null, Status=Responded, HasResponded=true, CreatedDate=2015-10-15 16:55:39, CreatedById=00570000003003DAAQ, LastModifiedDate=2016-01-25 09:59:56, LastModifiedById=00570000003003DAAQ, SystemModstamp=2016-01-25 09:59:56, FirstRespondedDate=2016-01-25 00:00:00, Name=null, Email__c=false} (max length=255): [Subject]
Trigger.CampaignMemberTaskCreation: line 14, column 1
How i can resolve the exception here?
Trigger:
trigger CampaignMemberTaskCreation on CampaignMember (after update) {
list<Task> AddTask=new List<Task>();
for(CampaignMember CM : Trigger.new) {
if(cm.Status == 'Responded'){
AddTask.add(new Task(
WhoId = CM.ContactId,
Status = 'Completed',
Description='CM.Description',
Subject = 'Call - ' + CM,
Whatid= CM.CampaignId));
}
}
insert AddTask;
}
Error Message, when tried to update the campaign member status:
Sandbox
Apex script unhandled trigger exception by user/organization: 00570000003003D/00D190000000OrW Source organization: 00D700000008ieh (null)
CampaignMemberTaskCreation: execution of AfterUpdate
caused by: System.DmlException: Insert failed. First exception on row 0; first error: STRING_TOO_LONG, Subject: data value too large: Call - CampaignMember:{Id=00v19000000TEZkAAO, IsDeleted=false, CampaignId=70119000000A3qoAAC, LeadId=00Q19000001eGJWEA2, ContactId=null, Status=Responded, HasResponded=true, CreatedDate=2015-10-15 16:55:39, CreatedById=00570000003003DAAQ, LastModifiedDate=2016-01-25 09:59:56, LastModifiedById=00570000003003DAAQ, SystemModstamp=2016-01-25 09:59:56, FirstRespondedDate=2016-01-25 00:00:00, Name=null, Email__c=false} (max length=255): [Subject]
Trigger.CampaignMemberTaskCreation: line 14, column 1
How i can resolve the exception here?
- Prasanth Reddy M
- January 25, 2016
- Like
- 0
- Continue reading or reply
Custom button is not Working ?
Hi,
Got "Account Hierarchy" custom button in "App Shark Account Hierarchy" Package.
The button is working fine in standard page Account layouts, but when tried to use in VF with below code, it is showing 'URL No longer exists'
<apex:commandButton onclick="window.open('/apex/AppShark_AH__Account_Hierarchy?id={!Account.id}','Account Hiererchy', '_blank');" styleClass="buttonStyle" style="background:White;width:90px;" value="Account Hierarchy" immediate="true"/>
How can i fix this ?
Got "Account Hierarchy" custom button in "App Shark Account Hierarchy" Package.
The button is working fine in standard page Account layouts, but when tried to use in VF with below code, it is showing 'URL No longer exists'
<apex:commandButton onclick="window.open('/apex/AppShark_AH__Account_Hierarchy?id={!Account.id}','Account Hiererchy', '_blank');" styleClass="buttonStyle" style="background:White;width:90px;" value="Account Hierarchy" immediate="true"/>
How can i fix this ?
- Prasanth Reddy M
- December 28, 2016
- Like
- 0
- Continue reading or reply
Calling a visual force page using a command button
Hi Friends,
I have installed a package, it has a custom button for Account object , which is directing to a visualforce page.
I am using visual force page for Accoutn detail and below is the call i am using for the custom button.
<apex:commandButton onclick="('/apex/texcellency__DefinitiveHospitalManager?id={!Account.id}', 'Import DMC Data', '_blank');" />
on clicking above custom button, it is not redirecting to the VF Page "DefinitiveHospotal Manager"
Could some one please help with a solution here.
I have installed a package, it has a custom button for Account object , which is directing to a visualforce page.
I am using visual force page for Accoutn detail and below is the call i am using for the custom button.
<apex:commandButton onclick="('/apex/texcellency__DefinitiveHospitalManager?id={!Account.id}', 'Import DMC Data', '_blank');" />
on clicking above custom button, it is not redirecting to the VF Page "DefinitiveHospotal Manager"
Could some one please help with a solution here.
- Prasanth Reddy M
- September 23, 2015
- Like
- 0
- Continue reading or reply
How to make one picklist field required based on value in another picklist field?
Hi,
I have a picklist field called Customer Type in Opportunity page with options, NEW, EXISTING and INACTIVE. I wan to make it required, if Opportunity stage is CLOSED WON.
How can this be achieved ?
I have a picklist field called Customer Type in Opportunity page with options, NEW, EXISTING and INACTIVE. I wan to make it required, if Opportunity stage is CLOSED WON.
How can this be achieved ?
- Prasanth Reddy M
- February 27, 2015
- Like
- 0
- Continue reading or reply
Issues when upgrading latest salesforce for outlook plug-in
Hi,
I have installed version salesforce for outlook version 2.6.1 on top of version 2.5.2
I could able to see side panel, but i couldn't able to see any details of any lead/contact after i entered email id in To address field?
Will un-installing previous version is the reason for this ?
Please clarrify ...
I have installed version salesforce for outlook version 2.6.1 on top of version 2.5.2
I could able to see side panel, but i couldn't able to see any details of any lead/contact after i entered email id in To address field?
Will un-installing previous version is the reason for this ?
Please clarrify ...
- Prasanth Reddy M
- October 28, 2014
- Like
- 0
- Continue reading or reply
Managed package components in leads page
Hi,
Managed package we have installed is having sections, which we can add to leads and accounts page . But as we are using tabbed leads/account detail pages, Wondering, on how to add the sections for the page ?
Any solution here ...
Managed package we have installed is having sections, which we can add to leads and accounts page . But as we are using tabbed leads/account detail pages, Wondering, on how to add the sections for the page ?
Any solution here ...
- Prasanth Reddy M
- August 01, 2014
- Like
- 0
- Continue reading or reply
Is there a way to map lead/contact custom picklist field in activities ?
I have a common custom picklist field in leads & contacts, i want to map it to the activitity records of leads and contacts.
It has to be in such way that, if the activity record is of a lead, then the activity record has to get the relevent lead records custom picklist value.Same as well for contat.
Is there a way to achieve it ?
It has to be in such way that, if the activity record is of a lead, then the activity record has to get the relevent lead records custom picklist value.Same as well for contat.
Is there a way to achieve it ?
- Prasanth Reddy M
- July 29, 2014
- Like
- 0
- Continue reading or reply
object field in activities
when i am trying below custom formula field for creating object in activities, it is continuously showing syntax error...can anyone one help with correct formula here...
IF(
BEGINS(WhatId, “006″), “Opportunity”,
IF(
BEGINS(WhatId, “001″), “Account”,
IF(
BEGINS(WhoId, “00Q”), “Lead”,
IF(
BEGINS(WhoId, “003″), “Contact”,””))))
IF(
BEGINS(WhatId, “006″), “Opportunity”,
IF(
BEGINS(WhatId, “001″), “Account”,
IF(
BEGINS(WhoId, “00Q”), “Lead”,
IF(
BEGINS(WhoId, “003″), “Contact”,””))))
- Prasanth Reddy M
- July 28, 2014
- Like
- 0
- Continue reading or reply
enabling activities for leads in accounts detail page
We have created a lookup field for in leads for linking leads with accounts.due to this, we are able to see the leads and contacts both for an account in the account detail page.When it comes to activities we are able to see only the activities associated with contacts but not leads activities.
Is there a way to see leads activities as well in accounts detail page ?
Is there a way to see leads activities as well in accounts detail page ?
- Prasanth Reddy M
- July 23, 2014
- Like
- 0
- Continue reading or reply
Can we have a formula field , which will be updated based on two other fields ?
In Leads Page, I want to have a Sales Score Text field (formula field ), which needs to be updated by first checking the campaign field is empty or not and has to update the Sales Score field based on other Campaign Score field (Number field).
Is this is possible with Formula fields, if so how ...
Please clarrify..
Is this is possible with Formula fields, if so how ...
Please clarrify..
- Prasanth Reddy M
- January 22, 2014
- Like
- 0
- Continue reading or reply
Can we have a field updated in Contact page in salesforce based on the perticular contacts activity/tasks in Outlook mail .If it is possible how can we achieve this
I want to have a number field in contact page in salesforce, i have integrated outlook with salesforce. Based on the activity/tasks happining for that perticular contact in Outlook mail, i want the number field to be updated by assigning some score depending on the number of activities/tasks .
Please help will this is possible, if so, how .
Please help will this is possible, if so, how .
- Prasanth Reddy M
- January 16, 2014
- Like
- 0
- Continue reading or reply
Visualforce page is not redirecting to specific VF pages with associated record types.
Hi,
For Account, we have few record types. we want to have the related vf page displayed when a specific record type is selected.
However, upon selecting a record type, the below vf page is not directing the VF new record page specific to record type.
We also have a domain for our instance.
Am i missing something here?
For Account, we have few record types. we want to have the related vf page displayed when a specific record type is selected.
However, upon selecting a record type, the below vf page is not directing the VF new record page specific to record type.
We also have a domain for our instance.
Am i missing something here?
<apex:page standardController="Account" extensions="NewAccountExtension" action="{!redirectToNewVFPage}"> </apex:page>
public with sharing class NewAccountExtension { public String recordTypeId; public NewAccountExtension(ApexPages.StandardController std) { } public Pagereference redirectToNewVFPage(){ Pagereference pg = null; if(ApexPages.CurrentPage().getParameters().get('RecordType') != null){ recordTypeId = ApexPages.CurrentPage().getParameters().get('RecordType'); if(recordTypeId == Schema.SObjectType.Account.getRecordTypeInfosByName().get('Finance_Account').getRecordTypeId()){ pg = new Pagereference('https://avantegrande.cs50.my.salesforce.comapex/fin_new_account'); }else if(recordTypeId == Schema.SObjectType.Account.getRecordTypeInfosByName().get('Logistics_Account').getRecordTypeId()){ pg = new Pagereference('https://avantegrande.cs50.my.salesforce.com/apex/logi_account'); } pg.setRedirect(true); return pg; } return null; } }
- Prasanth Reddy M
- November 05, 2018
- Like
- 0
- Continue reading or reply
How to make fields from lookup objects which are mapped to a custom object will not get updated when there is an update for the lookup object?
Hi Guys,
Have exposed account object's 3 fields to a custom object with the help of lookup relationship of account with the custom object. I just want to ensure any changes for these 3 fields in the Account object should not overwrite the values initial values in custom object when the record created for the first time.
How can we achieve this?
Have exposed account object's 3 fields to a custom object with the help of lookup relationship of account with the custom object. I just want to ensure any changes for these 3 fields in the Account object should not overwrite the values initial values in custom object when the record created for the first time.
How can we achieve this?
- Prasanth Reddy M
- January 18, 2017
- Like
- 0
- Continue reading or reply
Use of the term <sObject> in batch apex...
Hi Everyone,
In Batch Apex can anyone explain me what this <sObject> is needed for. what exactly it does...?
In Batch Apex can anyone explain me what this <sObject> is needed for. what exactly it does...?
- Vempally
- February 21, 2016
- Like
- 0
- Continue reading or reply
system.limitexception: too many query rows: 50001 in Production Instance
Hi,
For below trigger, when i have deployed in production, i am getting the "limit exception : too many query rows : 50001"
how can i fix this ?
For below trigger, when i have deployed in production, i am getting the "limit exception : too many query rows : 50001"
trigger TaskUpdatewithLeadComments on Task (after insert) { Set<Id> leadids = new Set<Id>(); List<Task> taskstoupdate = new list<Task>(); //Fetch only Leads which follow criteria for(Lead ld : [ SELECT Id, company FROM lead ]) { leadids.add(ld.Id); } //Iterate over all Leads and modify Tasks for them + Add to a list variable for(Lead ld : [SELECT Id, Prospect_notes__c,(SELECT Id, Whatid, Description FROM Tasks) from Lead Where Id IN : leadids]) { for(Task t : ld.Tasks) { if(t.Description==null) t.Description = ld.prospect_notes__c; taskstoupdate.add(t); } } //Update Tasks if(taskstoupdate.size()>0) { update taskstoupdate; } }
how can i fix this ?
- Prasanth Reddy M
- February 11, 2016
- Like
- 0
- Continue reading or reply
Error while testing trigger in sandbox
I have received below error, when testing below trigger.
Trigger:
trigger CampaignMemberTaskCreation on CampaignMember (after update) {
list<Task> AddTask=new List<Task>();
for(CampaignMember CM : Trigger.new) {
if(cm.Status == 'Responded'){
AddTask.add(new Task(
WhoId = CM.ContactId,
Status = 'Completed',
Description='CM.Description',
Subject = 'Call - ' + CM,
Whatid= CM.CampaignId));
}
}
insert AddTask;
}
Error Message, when tried to update the campaign member status:
Sandbox
Apex script unhandled trigger exception by user/organization: 00570000003003D/00D190000000OrW Source organization: 00D700000008ieh (null)
CampaignMemberTaskCreation: execution of AfterUpdate
caused by: System.DmlException: Insert failed. First exception on row 0; first error: STRING_TOO_LONG, Subject: data value too large: Call - CampaignMember:{Id=00v19000000TEZkAAO, IsDeleted=false, CampaignId=70119000000A3qoAAC, LeadId=00Q19000001eGJWEA2, ContactId=null, Status=Responded, HasResponded=true, CreatedDate=2015-10-15 16:55:39, CreatedById=00570000003003DAAQ, LastModifiedDate=2016-01-25 09:59:56, LastModifiedById=00570000003003DAAQ, SystemModstamp=2016-01-25 09:59:56, FirstRespondedDate=2016-01-25 00:00:00, Name=null, Email__c=false} (max length=255): [Subject]
Trigger.CampaignMemberTaskCreation: line 14, column 1
How i can resolve the exception here?
Trigger:
trigger CampaignMemberTaskCreation on CampaignMember (after update) {
list<Task> AddTask=new List<Task>();
for(CampaignMember CM : Trigger.new) {
if(cm.Status == 'Responded'){
AddTask.add(new Task(
WhoId = CM.ContactId,
Status = 'Completed',
Description='CM.Description',
Subject = 'Call - ' + CM,
Whatid= CM.CampaignId));
}
}
insert AddTask;
}
Error Message, when tried to update the campaign member status:
Sandbox
Apex script unhandled trigger exception by user/organization: 00570000003003D/00D190000000OrW Source organization: 00D700000008ieh (null)
CampaignMemberTaskCreation: execution of AfterUpdate
caused by: System.DmlException: Insert failed. First exception on row 0; first error: STRING_TOO_LONG, Subject: data value too large: Call - CampaignMember:{Id=00v19000000TEZkAAO, IsDeleted=false, CampaignId=70119000000A3qoAAC, LeadId=00Q19000001eGJWEA2, ContactId=null, Status=Responded, HasResponded=true, CreatedDate=2015-10-15 16:55:39, CreatedById=00570000003003DAAQ, LastModifiedDate=2016-01-25 09:59:56, LastModifiedById=00570000003003DAAQ, SystemModstamp=2016-01-25 09:59:56, FirstRespondedDate=2016-01-25 00:00:00, Name=null, Email__c=false} (max length=255): [Subject]
Trigger.CampaignMemberTaskCreation: line 14, column 1
How i can resolve the exception here?
- Prasanth Reddy M
- January 25, 2016
- Like
- 0
- Continue reading or reply
Custom button is not Working ?
Hi,
Got "Account Hierarchy" custom button in "App Shark Account Hierarchy" Package.
The button is working fine in standard page Account layouts, but when tried to use in VF with below code, it is showing 'URL No longer exists'
<apex:commandButton onclick="window.open('/apex/AppShark_AH__Account_Hierarchy?id={!Account.id}','Account Hiererchy', '_blank');" styleClass="buttonStyle" style="background:White;width:90px;" value="Account Hierarchy" immediate="true"/>
How can i fix this ?
Got "Account Hierarchy" custom button in "App Shark Account Hierarchy" Package.
The button is working fine in standard page Account layouts, but when tried to use in VF with below code, it is showing 'URL No longer exists'
<apex:commandButton onclick="window.open('/apex/AppShark_AH__Account_Hierarchy?id={!Account.id}','Account Hiererchy', '_blank');" styleClass="buttonStyle" style="background:White;width:90px;" value="Account Hierarchy" immediate="true"/>
How can i fix this ?
- Prasanth Reddy M
- December 28, 2016
- Like
- 0
- Continue reading or reply
Calling a visual force page using a command button
Hi Friends,
I have installed a package, it has a custom button for Account object , which is directing to a visualforce page.
I am using visual force page for Accoutn detail and below is the call i am using for the custom button.
<apex:commandButton onclick="('/apex/texcellency__DefinitiveHospitalManager?id={!Account.id}', 'Import DMC Data', '_blank');" />
on clicking above custom button, it is not redirecting to the VF Page "DefinitiveHospotal Manager"
Could some one please help with a solution here.
I have installed a package, it has a custom button for Account object , which is directing to a visualforce page.
I am using visual force page for Accoutn detail and below is the call i am using for the custom button.
<apex:commandButton onclick="('/apex/texcellency__DefinitiveHospitalManager?id={!Account.id}', 'Import DMC Data', '_blank');" />
on clicking above custom button, it is not redirecting to the VF Page "DefinitiveHospotal Manager"
Could some one please help with a solution here.
- Prasanth Reddy M
- September 23, 2015
- Like
- 0
- Continue reading or reply
How to make one picklist field required based on value in another picklist field?
Hi,
I have a picklist field called Customer Type in Opportunity page with options, NEW, EXISTING and INACTIVE. I wan to make it required, if Opportunity stage is CLOSED WON.
How can this be achieved ?
I have a picklist field called Customer Type in Opportunity page with options, NEW, EXISTING and INACTIVE. I wan to make it required, if Opportunity stage is CLOSED WON.
How can this be achieved ?
- Prasanth Reddy M
- February 27, 2015
- Like
- 0
- Continue reading or reply
Issues when upgrading latest salesforce for outlook plug-in
Hi,
I have installed version salesforce for outlook version 2.6.1 on top of version 2.5.2
I could able to see side panel, but i couldn't able to see any details of any lead/contact after i entered email id in To address field?
Will un-installing previous version is the reason for this ?
Please clarrify ...
I have installed version salesforce for outlook version 2.6.1 on top of version 2.5.2
I could able to see side panel, but i couldn't able to see any details of any lead/contact after i entered email id in To address field?
Will un-installing previous version is the reason for this ?
Please clarrify ...
- Prasanth Reddy M
- October 28, 2014
- Like
- 0
- Continue reading or reply
Managed package components in leads page
Hi,
Managed package we have installed is having sections, which we can add to leads and accounts page . But as we are using tabbed leads/account detail pages, Wondering, on how to add the sections for the page ?
Any solution here ...
Managed package we have installed is having sections, which we can add to leads and accounts page . But as we are using tabbed leads/account detail pages, Wondering, on how to add the sections for the page ?
Any solution here ...
- Prasanth Reddy M
- August 01, 2014
- Like
- 0
- Continue reading or reply
object field in activities
when i am trying below custom formula field for creating object in activities, it is continuously showing syntax error...can anyone one help with correct formula here...
IF(
BEGINS(WhatId, “006″), “Opportunity”,
IF(
BEGINS(WhatId, “001″), “Account”,
IF(
BEGINS(WhoId, “00Q”), “Lead”,
IF(
BEGINS(WhoId, “003″), “Contact”,””))))
IF(
BEGINS(WhatId, “006″), “Opportunity”,
IF(
BEGINS(WhatId, “001″), “Account”,
IF(
BEGINS(WhoId, “00Q”), “Lead”,
IF(
BEGINS(WhoId, “003″), “Contact”,””))))
- Prasanth Reddy M
- July 28, 2014
- Like
- 0
- Continue reading or reply
Account and Parent Account
Hi Everyone,
Can anyone tell me what is the difference between account and parent account
Thanks in advance
Karthick
Can anyone tell me what is the difference between account and parent account
Thanks in advance
Karthick
- SS Karthick
- July 25, 2014
- Like
- 0
- Continue reading or reply
enabling activities for leads in accounts detail page
We have created a lookup field for in leads for linking leads with accounts.due to this, we are able to see the leads and contacts both for an account in the account detail page.When it comes to activities we are able to see only the activities associated with contacts but not leads activities.
Is there a way to see leads activities as well in accounts detail page ?
Is there a way to see leads activities as well in accounts detail page ?
- Prasanth Reddy M
- July 23, 2014
- Like
- 0
- Continue reading or reply
Can we have a field updated in Contact page in salesforce based on the perticular contacts activity/tasks in Outlook mail .If it is possible how can we achieve this
I want to have a number field in contact page in salesforce, i have integrated outlook with salesforce. Based on the activity/tasks happining for that perticular contact in Outlook mail, i want the number field to be updated by assigning some score depending on the number of activities/tasks .
Please help will this is possible, if so, how .
Please help will this is possible, if so, how .
- Prasanth Reddy M
- January 16, 2014
- Like
- 0
- Continue reading or reply