• Prasanth Reddy M
  • NEWBIE
  • 125 Points
  • Member since 2013

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 20
    Questions
  • 21
    Replies
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?
 
<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;
    }
}


 
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?
Hi Everyone,

In Batch Apex can anyone explain me what this <sObject> is needed for. what exactly it does...?

 
Hi,

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 ?
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?
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 ?
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.



 
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 ?
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 ...
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 ...
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”,””))))
Hi Everyone,
   Can anyone tell me what is the difference between account and parent account
Thanks in advance
Karthick
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 ?
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 .