• Spunky
  • NEWBIE
  • 25 Points
  • Member since 2009

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 47
    Questions
  • 53
    Replies

I deployed a change over the weekend and discovered that I could not "Login as user" to verify the change.

 

The changes had deployed succesfully. The changes were visible to me when I logged in as myself (system adminstrator). But when I used the "login as user" function to see the view from another user's perspective, I didn't see the change.

 

After hours of trying to troubleshoot it, i finally contacted the user and asked them to login and send me a screenshot of their view and sure enough, it was all working as it should have.

 

Has anyone ever come across this? Is this a bug? I thought all changes could be viwed with the login as user function.

  • August 13, 2012
  • Like
  • 0

Basically what I'm trying to do is ensure a few custom object records are created whenever an opportunity is created for a certain group of user.

 

I have with great effort created a trigger which I absolutely have to deploy urgently but I need test coverage on it. I would greatly appreciate any help on it because I don't know where to start. 

 

Can someone please help me get even part of the way there?

 

Thanks so much

 

trigger JobAidsForRDGAD on Opportunity (after insert) {
  
  List<AD_Job_Aid_NeedsAssess__c> needs = new List<AD_Job_Aid_NeedsAssess__c>();
    List<Job_Aid_Retail_AD__c> interviewers = new List<Job_Aid_Retail_AD__c>();
  
    for (Opportunity newopp: Trigger.New) {
        if (newopp.Id!= null) {
            interviewers.add(new Job_Aid_Retail_AD__c(
                        opportunity_name__c = newopp.Id,
                        recordtypeid = '01280000000G7PFAA0',
                        Name = 'Opportunity Assessment'));                            
                        
              interviewers.add           (new Job_Aid_Retail_AD__c(
                        opportunity_name__c = newopp.Id,
                        recordtypeid = '01280000000UFvqAAG',
                        Name = 'Risk Assessment'));
                        
              interviewers.add(new Job_Aid_Retail_AD__c(
                        opportunity_name__c = newopp.Id,
                        recordtypeid = '01280000000UFeoAAG',
                        Name = 'Compelling Event'));
                        
              needs.add(new AD_Job_Aid_NeedsAssess__c(
                        opportunity__c = newopp.Id,
                        Name = 'Solution Needs'));
        }
    }
    insert interviewers;
    insert needs;
}

 

  • August 10, 2012
  • Like
  • 0

I have approximately 20 fields in an output panel and I only want to display fields that have a value and hide the ones that do not.

 

I'm using a render tag for each field-rendered="{!IF(NOT(ISNULL(Contract__c.Status)),true,false)}"

 

Instead of using a render tag for each field, is there a way of inserting a tag in the output panel to do this? If so, how?

 

 

  • March 28, 2012
  • Like
  • 0

I have a custom controller that queries 3 objects for fields.

 

For my custom object called Job_Aids__c, is there a way of retrieving all the field names instead of having to list them all out as I have below ?

 

I hope the answer is yes because I have over 300 fields. Please help

public Job_Aid__c getJob_Aid() {
         return [select id, createddate,U_opportunityname__c,X3rd_party_pressuring_improved_bus_perf__c,text__c from Job_Aid__c  where U_opportunityname__c = :ApexPages.currentPage().getParameters().get('id')]; 
    } 

 

  • March 27, 2012
  • Like
  • 0

For the record-this is a question from "a have to be but am not  developer ".

 

I hacked the opportunity wizard code to create a wizard that would allow me to

  • retrieve an opportunity record
  • Create an Event
  • Retrieve fields from a Custom Object related to the opportunity called "Job_Aids__c" 

It sort of works and I lack the exoertise to make this fully functional so any help would be greatly appreciated.

 

The Event does save but I need the event what id realted to the opportunity.id .

My attempt to do this is shown in line 39 but it throws back an error. 

 

The other piece of it is the custom object. I'd like to be able to update the field values and save it. What would the save method be?

 

Thank you soo much in advance.

 

Controller Code

public class newOpportunityControllerrevA {
  
   Opportunity opportunity;
   Event event;
   Job_Aid__c jac;
   
public Event getEvent() { 
if(event == null) event = new Event();     
return event;   
} 
      
       
    
   public Opportunity getOpportunity() {
         return [select id, name,amount,closedate,stagename,sales_stage__c from Opportunity 
                 where id = :ApexPages.currentPage().getParameters().get('id')];  
         return opportunity;                      
    } 
  public Job_Aid__c getJob_Aid() {
         return [select id, createddate,U_opportunityname__c,X3rd_party_pressuring_improved_bus_perf__c,text__c from Job_Aid__c  where U_opportunityname__c = :ApexPages.currentPage().getParameters().get('id')]; 
    } 

    
   public PageReference step1() {
      return Page.OpptyStep1;
   }

   public PageReference step2() {
      return Page.OpptyStep2;
   }

   public PageReference step3() {
      return Page.OpptyStep3;
   }


   public PageReference save() { 
  //event.whatid = opportunity.id;
      insert event;

      

    
      PageReference opptyPage = new PageReference('/' +
                                                  event.id);
      opptyPage.setRedirect(true);

      return opptyPage;
   }

}

 

<apex:page controller="newOpportunityControllerrevA" tabStyle="opportunity">
  <apex:form > 

<apex:pageBlock >
 <apex:pageblockbuttons >
 <!-- <apex:commandButton action="{!step2}" value="step2button"styleClass="btn"/>-->
<!--<apex:commandButton action="{!step1}" value="Previous" styleClass="btn"/>-->
 <!--         <apex:commandButton action="{!step3}" value="Next" styleClass="btn"/>-->
          <apex:commandButton action="{!save}" value="Save"  styleClass="btn"/>
</apex:pageblockbuttons>

       <apex:pageBlockSection title="Event">
       <apex:panelGrid columns="2">
Related To:<apex:inputfield value="{!event.whatid}" />
    Subject:<apex:inputField value="{!Event.Type}" /><BR />
    Subject:<apex:inputField value="{!Event.Subject}" /><BR />
    Date:<apex:inputField value="{!Event.ActivityDateTime}" /><BR />
    Minutes:<apex:inputField value="{!Event.DurationInMinutes}" /><BR />
  </apex:panelGrid>
      </apex:pageBlockSection>
      
       <apex:pageBlockSection title="JOb Aid" >
       <apex:panelGrid columns="1">
           {!job_aid.id}
 JOb aid field<apex:inputField id="jafield"    value="{!job_aid.X3rd_party_pressuring_improved_bus_perf__c}"/> 
  JOb aid field<apex:inputField id="jafield2"    value="{!job_aid.Text__c}"/>         
     </apex:panelGrid>
      </apex:pageBlockSection>  
</apex:pageBlock>
  </apex:form>
</apex:page>

 

 

  • March 09, 2012
  • Like
  • 0

Is it possible to use custom links to create a parent and child record simultaneously?

 

I have a custom link that creates a new opportunity and I was wondering if I could at the same time, add a product line item to this opportunity as well and if so how?

 

 

 

  • February 14, 2012
  • Like
  • 0

Wondering if someone can help me with this issue or suggest a better way of doing this.

 

I have a Visualforce "Event" page layout that is comprised of standard event fields and a bunch of custom activity fields.

 

I need an event Id in order to get the VF page to work.

 

I can't use apex class right now to drive page behavior because our test classes are beneath the governer limit and I don't have any development resources to fix that ..huge bummer.

 

So the solution I came up with is

1) I have a custom link on the opportunity that calls an scontrol(code below)

2)I want to utilize URL parameters[save & ret] to associate that saved event id to the VF page in edit mode so users can fill out the additional fields and then save it. 

 

Can I do this and how? So far the code I pasted below, creates the event and saves it but i'm not sure how to redirect it to my '/apex/eventdetails' page.

 

I would really appreciate some help

<script type="text/javascript">
window.parent.location.href="{!URLFOR($Action.Activity.NewEvent,null,
[evt3_lkid=Opportunity.Id,evt3=Opportunity.Name,evt5="Schedule CP",save=1,retURL=URLFOR($Action.Opportunity.View, Opportunity.Id)],true
)} &RecordType=01280000000G7PPAA0&type=Event&setupid=EventRecords";
</script>

 

 

 

 

 

 

  • February 01, 2012
  • Like
  • 0

I have an html scontrol (code below) that automatically creates and saves an event from an opportunity.  I need to then get the event id and associate it with a visualforce page so that the user fills out some custom fields to complete the event.

 

Can someone please help me on modifying the scontrol so that I can get the Event Id and redirect the user to the visualforce page ('/apex/eventdetails?id= '). I've been reading the discussion threads but I'm really lost and would appreciate any help.

 

Thanks so much 

<script>

parent.frames.location.replace(
"/00U/e?evt3_lkid={!Opportunity.Id}&RecordType=012300000000qm6" +
"&evt3={!Opportunity.Name}" +
"&evt10=Seminar" +
"&evt6=schedule"+
"&evt5={!Event.RecordTypeId}"+
"&00N80000004SCGU=Note populated by scontrol"+
"&cancelURL=%2F{!Opportunity.Id}" +
"&saveURL=%2F{!Opportunity.Id}" +
"&retURL=%2F{!Event.Id}&nooverride=0"


);

</script>

 


 

  • January 25, 2012
  • Like
  • 0

Hi- Can someone help me script my hyperlink please?

 

Use case:

Create a custom link on campaign.

When invoked, the link will display a contact View of all contacts in that campaign.

 

Current Link

This is my link. It creates the view perfectly but I don't know how to add a save and return view.(save =1 doesnt work)


<apex:outputlink value="https://cs1.salesforce.com/ui/list/FilterEditPage?ftype=c&fname=Task&devname=id&fentityvalue2=test">link</apex:outputlink>


Current Output from Link

Current View

 

This is what I'm trying to get to:

Goal

  • November 10, 2011
  • Like
  • 0

I have a custom object with 4 record types.Each RT has a custom VF page and I want to replace the standard "View" so that each record type displays it's respective VF page.

 

I was using a formula based, page include methid (pasted below) which was working but I changed something and can't seem to fix it. It now renders the same VF page for both RT's.

 

<apex:page standardController="Sales_Tool__c">
<apex:outputPanel rendered="{!IF(Sales_Tool__c.RecordTypeId!='012S00000004SX5',true,false)}">
<apex:include pageName="Assessment_Form" />
</apex:outputPanel>
<apex:outputPanel rendered="{!IF(Job_Aid__c.RecordTypeId!='012S00000004SX0',true,false)}">
<apex:include pageName="CompellingEvent_Form" /> 
</apex:outputPanel>
</apex:page>

Can someone please help me figure what's wrong this?I have a deadline to deploy this so any help would be appreciated. 

 

If you're wondering why I'm not using all apex class/page sample from the cookbook, the reason is I've inherited an sfdc environment where there poor test coverage for existing code and until that's fixed,I cant do anything new.

 

Apex page action may be the answer, I did toy around with that but I'm not too familiar with VF and couldn't quite get that to work. 

 

Thanks

  • October 03, 2011
  • Like
  • 0

With borrowed code from the discussions board (thank god for this discussion forum),after few days of trial and error, I was able to replicate an scontrol which acts as a list button on the campaign related list :campaign members

 

Presently, this scontrol allows me to mass create tasks for campaign member owners(i.e contact owners)

I've only tried it on a campaign with 15 contacts so far.

 

Issues

  1. I also need to assign tasks to Account Team members where the Team Member Role is "Inside Sales"Is it possible to query the account team member within this scontrol and if so, how would i go about doing this?
  2. The current method displays a pop-up alert which confirms the task creation for each task . How would I go about changing this to a single popup with a count of tasks created?

Posting my code - no laughing from the experts please!

I'm not a programmer and wish I didn't have to do this:(

 

Any help would be greatly appreciated

 



{!REQUIRESCRIPT("/soap/ajax/19.0/connection.js")}; 
var memberIDs = {!GETRECORDIDS( $ObjectType.CampaignMember)}; 
var tsks= []; 
var campId="{!Campaign.Id}"; 
var campName="{!Campaign.Name}"; 
var campowner="{!CampaignMember.ContactOwner__c}"; 

if (!memberIDs.length) { 
alert("Please select at least one contact to enroll."); 

} else { 
for (var i=0; i<memberIDs.length; i++) { 
var result = sforce.connection.retrieve("Account_Name__c,ID,contactowner__c,contactId", "CampaignMember", [memberIDs[i]]); 
if (result[0] == null) throw "retrive failed"; 
if(result[0].ContactId==null)throw "You have selected a lead."; 
var conId=result[0].ContactId; 
var result2 =sforce.connection.retrieve("ID,AccountID", "Contact", [conId]); 

var tsk = new sforce.SObject("Task"); 
tsk.Subject = campName + " Campaign: " + result[0].Account_Name__c; 
tsk.Description=result2[0].AccountId; 
tsk.WhatId=campId; 
tsk.Status="Not Started"; 
tsk.OwnerId=campowner;
tsk.priority="Normal"
tsk.WhoId=conId; 
tsks.push(tsk); 
} 

var result = sforce.connection.create(tsks); 

for (var i=0; i<result.length; i++) { 
if (result[i].getBoolean("success")) { 
alert("new Task created with id " + result[i].id); 
} else { 
alert("failed to create Task" + result[i]); 
}} 
}

 

  • August 26, 2011
  • Like
  • 0

I developed a couple of pages for our site and tested it all in the sandbox before I pushed it to production but the site pages are not rendering properly. I might just be going blind from looking at this too much but if someone could point out whats wrong, i could really use the help.

 

Pasted below is my site detail and the main pages I'm trying to access.

However when I access the public url I get an error page.

 

Help! I needed to deploy this site yesterday

 

 

SiteDetail

URL error

I used this code as is (borrowed from visualforce documentation)  on my sites page.

It's labeled "update" and everytime it clicks, the value increments

However when the sites page is refreshed, it resets to zero.

 

What I need is to save the value everytime it increments to a field called "#ofUpdates" because I'd like to display this value alongside the counter link on the sites page. 

 

How do I go about modifying the code to achieve this? Any help would be greatly appreciated.

 

<apex:page controller="exampleCon">
    <apex:form >
        <apex:outputText value="Update: {!count}" id="counter"/>
        <apex:actionStatus id="counterStatus">
            <apex:facet name="start">
                 <img src="{!$Resource.spin}"/> <!-- A previously defined image --> 
   
            </apex:facet>
        </apex:actionStatus>   
        <apex:actionPoller action="{!incrementCounter}" rerender="counter"
            status="counterStatus" interval="7"/>
    </apex:form>
</apex:page>

 

Controller

public class exampleCon {
    Integer count = 0;
                       
    public PageReference incrementCounter() {
            count++;
            return null;
    }
                       
    public Integer getCount() {
        return count;
    }
}

Hoping someone can help-i'v been at this for some time and it's 3am and i just cant think straight anymore and I'm not a developer.

 

This is really urgent as the stage field is incorrectly updating for a particular record type and I would truly appreciate any assistance with my trigger,

 

I have a trigger on opportunities to sync fields on insert and on update.

 

The use case is;

All StageNames have a corresponding  sales stage value

 

What I need is

if the sales stage is updated, then the sales stage should automatically be updated to the defined value 

alternatively, if the stage name is updated-then I need the sales stage to be dynamically updated

How do I keep both synchronized?

 

My code updates the stage name if sales stage is changed but it won't update the sales stage if stage name is changed

 

 

 

trigger sync on Opportunity (before update,before insert) {
For (Opportunity opp:Trigger.new) {
   if (opp.recordtypeid=='012C0000000GBxA'){
if(opp.stagename=='closed')opp.sales_stage__c='closed';     
if (Trigger.isupdate){
   if(opp.Sales_Stage__c == 'Recognition' ){opp.StageName='Determining Differentiated Problems';}
   if(opp.Sales_Stage__c == 'Determine Needs'){opp.StageName='Confirming Vision Match';}
   if(opp.Sales_Stage__c == 'Evaluate Options'){opp.StageName='Confirming Value and Power';}
   if(opp.Sales_Stage__c == 'Resolve Concerns'){opp.StageName='Finalizing Mutual Plan';}
   if(opp.Sales_Stage__c == 'Negotiate'){opp.StageName='Negotiating';}
   if(opp.Sales_Stage__c == 'Closed'){opp.StageName='Closed';}
   if(opp.Sales_Stage__c == 'Lost'){opp.StageName='Lost';}
   if(opp.Sales_Stage__c == 'No Decision'){opp.StageName='No Decision';}
   if(opp.Sales_Stage__c == 'Opportunity Identified'){opp.StageName='Opportunity Identified';}
   if(opp.Sales_Stage__c == 'Prospecting'){opp.StageName='Prospecting';}
   }

}
   }
   }

 

 

 

  • April 01, 2011
  • Like
  • 0

This question is in reference to Salesforce Content. When you're on the "Content" tab, there's a filter menu in the left bar- and some filters are expanded while others are collapsed and they consistently behave this way.

 

Is there any way to expand or collapse these by default? or does anyone know why some are automtically expanded while others are collapsed?

 

Thanks

 

 

 

  • March 29, 2011
  • Like
  • 0

Hi

 

I have an scontrol that runs an external query (Noetix report), attaches the Account number from salesforce and renders results.

 

It works perfectly in IE but when if you click the link in Firefox (our preferred browser), it seems to execute but the results page is blank.

 

Can someone please help me figure this one out?

 

We have a lot of similar links and we're having to multiple browsers just to view these links.

 

This link is a Custom Account Link which calls the following scontrol

 

<html>
<head>
<script>

var accnum = "{!Account.AccountNumber}".substring(0,6);

if (accnum.length != 6) {

alert("The account number "+"{!Account.AccountNumber}"+" is incorrect.");

this.close();

} else {

var url = "http://devnoetix-dc-aus:80/NoetixGateway/ExecLinkedReportSimpleParamValues.aspx?name=afb42b63-712b-4015-923b-19fa97c773e9&type=user&prompt=no&nwq_vdir=nwq&uid=39329099288D3CCD600361E48195793F&pwd=2B6568EA8135D055CF3A8157FA4DE3E0&applicationlogindata=&secure=bound&version=3&paramvalues="+accnum;

parent.location.href = url; //pass full URL to page (refresh)
}
</script>
</head>
</html>

 

Thanks a lot

 

 

 

  • January 18, 2011
  • Like
  • 0

I know that the opportunity trend report gives you historical snapshots of your pipeline as of the 1st of every month.

 

For some reason, I'm not getting any results for 1/1/2011 (all the other months are working fine).

 

Shouldn't this data be available now?

 

Is anyone else having this issue?

 

 

  • January 10, 2011
  • Like
  • 0

Hi there.

 

I have a trigger that works almost perfectly but I need to change the behavior and I'm at a loss how to.

 

Behavior

Updates Opportunity field "Next Task Date" with the task due date

Updates Opportunity field "Next Task Subject" with the task subject

Triggered when

A new task is created or an existing open task is updated

ex. if there are 2 tasks , one due 1/1/2013 and another due 1/1/2014

if either one of these is updated or a new task is created, the opportunity fields are updated

Challenge

I need to limit the update so that it only pulls info from the next closest task due date

 

How do I change the trigger so that it achieves this? I would really appreciate some coding help.

 

Thanks  in advance. Please see code below.

 

trigger NextTaskInfo on Task (after insert, after update) {
//this is the trigger that updates next step and next step date on opportunity
  if(Trigger.new.size() == 1 ) {
    Task tk = Trigger.new.get(0);
      if (tk.WhatId != null && String.valueOf(tk.WhatId).startsWith('006')) { 
        Opportunity opp = [select OwnerId,NextTaskSubject__c,Next_Task_Date__c from Opportunity where Id = :tk.WhatId ];
          if( tk.OwnerId == opp.OwnerId && tk.ActivityDate != null) {                   
            if (tk.isClosed == false) {
              opp.Next_Step_Date__c = tk.ActivityDate;
              opp.NextStep = tk.Type;
              update opp;
}
}
}
}
}

 

 

  • December 31, 2011
  • Like
  • 0

Has anyone tried to export data from the forecast tab using the right click option on your mouse that enables you to "export to excel"? We had various people using this function but it's now giving them an error and I was wondering if anyone had come acrosss this before or knew the fix.

 

error

  • December 14, 2010
  • Like
  • 0

Is there an issue with the phone and email fields in the event object?

 

They're supposedly standard Event Fields but I can't query or reference them.

 

Help!

  • December 13, 2010
  • Like
  • 0

I deployed a change over the weekend and discovered that I could not "Login as user" to verify the change.

 

The changes had deployed succesfully. The changes were visible to me when I logged in as myself (system adminstrator). But when I used the "login as user" function to see the view from another user's perspective, I didn't see the change.

 

After hours of trying to troubleshoot it, i finally contacted the user and asked them to login and send me a screenshot of their view and sure enough, it was all working as it should have.

 

Has anyone ever come across this? Is this a bug? I thought all changes could be viwed with the login as user function.

  • August 13, 2012
  • Like
  • 0

Basically what I'm trying to do is ensure a few custom object records are created whenever an opportunity is created for a certain group of user.

 

I have with great effort created a trigger which I absolutely have to deploy urgently but I need test coverage on it. I would greatly appreciate any help on it because I don't know where to start. 

 

Can someone please help me get even part of the way there?

 

Thanks so much

 

trigger JobAidsForRDGAD on Opportunity (after insert) {
  
  List<AD_Job_Aid_NeedsAssess__c> needs = new List<AD_Job_Aid_NeedsAssess__c>();
    List<Job_Aid_Retail_AD__c> interviewers = new List<Job_Aid_Retail_AD__c>();
  
    for (Opportunity newopp: Trigger.New) {
        if (newopp.Id!= null) {
            interviewers.add(new Job_Aid_Retail_AD__c(
                        opportunity_name__c = newopp.Id,
                        recordtypeid = '01280000000G7PFAA0',
                        Name = 'Opportunity Assessment'));                            
                        
              interviewers.add           (new Job_Aid_Retail_AD__c(
                        opportunity_name__c = newopp.Id,
                        recordtypeid = '01280000000UFvqAAG',
                        Name = 'Risk Assessment'));
                        
              interviewers.add(new Job_Aid_Retail_AD__c(
                        opportunity_name__c = newopp.Id,
                        recordtypeid = '01280000000UFeoAAG',
                        Name = 'Compelling Event'));
                        
              needs.add(new AD_Job_Aid_NeedsAssess__c(
                        opportunity__c = newopp.Id,
                        Name = 'Solution Needs'));
        }
    }
    insert interviewers;
    insert needs;
}

 

  • August 10, 2012
  • Like
  • 0

For the record-this is a question from "a have to be but am not  developer ".

 

I hacked the opportunity wizard code to create a wizard that would allow me to

  • retrieve an opportunity record
  • Create an Event
  • Retrieve fields from a Custom Object related to the opportunity called "Job_Aids__c" 

It sort of works and I lack the exoertise to make this fully functional so any help would be greatly appreciated.

 

The Event does save but I need the event what id realted to the opportunity.id .

My attempt to do this is shown in line 39 but it throws back an error. 

 

The other piece of it is the custom object. I'd like to be able to update the field values and save it. What would the save method be?

 

Thank you soo much in advance.

 

Controller Code

public class newOpportunityControllerrevA {
  
   Opportunity opportunity;
   Event event;
   Job_Aid__c jac;
   
public Event getEvent() { 
if(event == null) event = new Event();     
return event;   
} 
      
       
    
   public Opportunity getOpportunity() {
         return [select id, name,amount,closedate,stagename,sales_stage__c from Opportunity 
                 where id = :ApexPages.currentPage().getParameters().get('id')];  
         return opportunity;                      
    } 
  public Job_Aid__c getJob_Aid() {
         return [select id, createddate,U_opportunityname__c,X3rd_party_pressuring_improved_bus_perf__c,text__c from Job_Aid__c  where U_opportunityname__c = :ApexPages.currentPage().getParameters().get('id')]; 
    } 

    
   public PageReference step1() {
      return Page.OpptyStep1;
   }

   public PageReference step2() {
      return Page.OpptyStep2;
   }

   public PageReference step3() {
      return Page.OpptyStep3;
   }


   public PageReference save() { 
  //event.whatid = opportunity.id;
      insert event;

      

    
      PageReference opptyPage = new PageReference('/' +
                                                  event.id);
      opptyPage.setRedirect(true);

      return opptyPage;
   }

}

 

<apex:page controller="newOpportunityControllerrevA" tabStyle="opportunity">
  <apex:form > 

<apex:pageBlock >
 <apex:pageblockbuttons >
 <!-- <apex:commandButton action="{!step2}" value="step2button"styleClass="btn"/>-->
<!--<apex:commandButton action="{!step1}" value="Previous" styleClass="btn"/>-->
 <!--         <apex:commandButton action="{!step3}" value="Next" styleClass="btn"/>-->
          <apex:commandButton action="{!save}" value="Save"  styleClass="btn"/>
</apex:pageblockbuttons>

       <apex:pageBlockSection title="Event">
       <apex:panelGrid columns="2">
Related To:<apex:inputfield value="{!event.whatid}" />
    Subject:<apex:inputField value="{!Event.Type}" /><BR />
    Subject:<apex:inputField value="{!Event.Subject}" /><BR />
    Date:<apex:inputField value="{!Event.ActivityDateTime}" /><BR />
    Minutes:<apex:inputField value="{!Event.DurationInMinutes}" /><BR />
  </apex:panelGrid>
      </apex:pageBlockSection>
      
       <apex:pageBlockSection title="JOb Aid" >
       <apex:panelGrid columns="1">
           {!job_aid.id}
 JOb aid field<apex:inputField id="jafield"    value="{!job_aid.X3rd_party_pressuring_improved_bus_perf__c}"/> 
  JOb aid field<apex:inputField id="jafield2"    value="{!job_aid.Text__c}"/>         
     </apex:panelGrid>
      </apex:pageBlockSection>  
</apex:pageBlock>
  </apex:form>
</apex:page>

 

 

  • March 09, 2012
  • Like
  • 0

Wondering if someone can help me with this issue or suggest a better way of doing this.

 

I have a Visualforce "Event" page layout that is comprised of standard event fields and a bunch of custom activity fields.

 

I need an event Id in order to get the VF page to work.

 

I can't use apex class right now to drive page behavior because our test classes are beneath the governer limit and I don't have any development resources to fix that ..huge bummer.

 

So the solution I came up with is

1) I have a custom link on the opportunity that calls an scontrol(code below)

2)I want to utilize URL parameters[save & ret] to associate that saved event id to the VF page in edit mode so users can fill out the additional fields and then save it. 

 

Can I do this and how? So far the code I pasted below, creates the event and saves it but i'm not sure how to redirect it to my '/apex/eventdetails' page.

 

I would really appreciate some help

<script type="text/javascript">
window.parent.location.href="{!URLFOR($Action.Activity.NewEvent,null,
[evt3_lkid=Opportunity.Id,evt3=Opportunity.Name,evt5="Schedule CP",save=1,retURL=URLFOR($Action.Opportunity.View, Opportunity.Id)],true
)} &RecordType=01280000000G7PPAA0&type=Event&setupid=EventRecords";
</script>

 

 

 

 

 

 

  • February 01, 2012
  • Like
  • 0

Hi- Can someone help me script my hyperlink please?

 

Use case:

Create a custom link on campaign.

When invoked, the link will display a contact View of all contacts in that campaign.

 

Current Link

This is my link. It creates the view perfectly but I don't know how to add a save and return view.(save =1 doesnt work)


<apex:outputlink value="https://cs1.salesforce.com/ui/list/FilterEditPage?ftype=c&fname=Task&devname=id&fentityvalue2=test">link</apex:outputlink>


Current Output from Link

Current View

 

This is what I'm trying to get to:

Goal

  • November 10, 2011
  • Like
  • 0

I have a custom object with 4 record types.Each RT has a custom VF page and I want to replace the standard "View" so that each record type displays it's respective VF page.

 

I was using a formula based, page include methid (pasted below) which was working but I changed something and can't seem to fix it. It now renders the same VF page for both RT's.

 

<apex:page standardController="Sales_Tool__c">
<apex:outputPanel rendered="{!IF(Sales_Tool__c.RecordTypeId!='012S00000004SX5',true,false)}">
<apex:include pageName="Assessment_Form" />
</apex:outputPanel>
<apex:outputPanel rendered="{!IF(Job_Aid__c.RecordTypeId!='012S00000004SX0',true,false)}">
<apex:include pageName="CompellingEvent_Form" /> 
</apex:outputPanel>
</apex:page>

Can someone please help me figure what's wrong this?I have a deadline to deploy this so any help would be appreciated. 

 

If you're wondering why I'm not using all apex class/page sample from the cookbook, the reason is I've inherited an sfdc environment where there poor test coverage for existing code and until that's fixed,I cant do anything new.

 

Apex page action may be the answer, I did toy around with that but I'm not too familiar with VF and couldn't quite get that to work. 

 

Thanks

  • October 03, 2011
  • Like
  • 0

With borrowed code from the discussions board (thank god for this discussion forum),after few days of trial and error, I was able to replicate an scontrol which acts as a list button on the campaign related list :campaign members

 

Presently, this scontrol allows me to mass create tasks for campaign member owners(i.e contact owners)

I've only tried it on a campaign with 15 contacts so far.

 

Issues

  1. I also need to assign tasks to Account Team members where the Team Member Role is "Inside Sales"Is it possible to query the account team member within this scontrol and if so, how would i go about doing this?
  2. The current method displays a pop-up alert which confirms the task creation for each task . How would I go about changing this to a single popup with a count of tasks created?

Posting my code - no laughing from the experts please!

I'm not a programmer and wish I didn't have to do this:(

 

Any help would be greatly appreciated

 



{!REQUIRESCRIPT("/soap/ajax/19.0/connection.js")}; 
var memberIDs = {!GETRECORDIDS( $ObjectType.CampaignMember)}; 
var tsks= []; 
var campId="{!Campaign.Id}"; 
var campName="{!Campaign.Name}"; 
var campowner="{!CampaignMember.ContactOwner__c}"; 

if (!memberIDs.length) { 
alert("Please select at least one contact to enroll."); 

} else { 
for (var i=0; i<memberIDs.length; i++) { 
var result = sforce.connection.retrieve("Account_Name__c,ID,contactowner__c,contactId", "CampaignMember", [memberIDs[i]]); 
if (result[0] == null) throw "retrive failed"; 
if(result[0].ContactId==null)throw "You have selected a lead."; 
var conId=result[0].ContactId; 
var result2 =sforce.connection.retrieve("ID,AccountID", "Contact", [conId]); 

var tsk = new sforce.SObject("Task"); 
tsk.Subject = campName + " Campaign: " + result[0].Account_Name__c; 
tsk.Description=result2[0].AccountId; 
tsk.WhatId=campId; 
tsk.Status="Not Started"; 
tsk.OwnerId=campowner;
tsk.priority="Normal"
tsk.WhoId=conId; 
tsks.push(tsk); 
} 

var result = sforce.connection.create(tsks); 

for (var i=0; i<result.length; i++) { 
if (result[i].getBoolean("success")) { 
alert("new Task created with id " + result[i].id); 
} else { 
alert("failed to create Task" + result[i]); 
}} 
}

 

  • August 26, 2011
  • Like
  • 0

I used this code as is (borrowed from visualforce documentation)  on my sites page.

It's labeled "update" and everytime it clicks, the value increments

However when the sites page is refreshed, it resets to zero.

 

What I need is to save the value everytime it increments to a field called "#ofUpdates" because I'd like to display this value alongside the counter link on the sites page. 

 

How do I go about modifying the code to achieve this? Any help would be greatly appreciated.

 

<apex:page controller="exampleCon">
    <apex:form >
        <apex:outputText value="Update: {!count}" id="counter"/>
        <apex:actionStatus id="counterStatus">
            <apex:facet name="start">
                 <img src="{!$Resource.spin}"/> <!-- A previously defined image --> 
   
            </apex:facet>
        </apex:actionStatus>   
        <apex:actionPoller action="{!incrementCounter}" rerender="counter"
            status="counterStatus" interval="7"/>
    </apex:form>
</apex:page>

 

Controller

public class exampleCon {
    Integer count = 0;
                       
    public PageReference incrementCounter() {
            count++;
            return null;
    }
                       
    public Integer getCount() {
        return count;
    }
}

Hoping someone can help-i'v been at this for some time and it's 3am and i just cant think straight anymore and I'm not a developer.

 

This is really urgent as the stage field is incorrectly updating for a particular record type and I would truly appreciate any assistance with my trigger,

 

I have a trigger on opportunities to sync fields on insert and on update.

 

The use case is;

All StageNames have a corresponding  sales stage value

 

What I need is

if the sales stage is updated, then the sales stage should automatically be updated to the defined value 

alternatively, if the stage name is updated-then I need the sales stage to be dynamically updated

How do I keep both synchronized?

 

My code updates the stage name if sales stage is changed but it won't update the sales stage if stage name is changed

 

 

 

trigger sync on Opportunity (before update,before insert) {
For (Opportunity opp:Trigger.new) {
   if (opp.recordtypeid=='012C0000000GBxA'){
if(opp.stagename=='closed')opp.sales_stage__c='closed';     
if (Trigger.isupdate){
   if(opp.Sales_Stage__c == 'Recognition' ){opp.StageName='Determining Differentiated Problems';}
   if(opp.Sales_Stage__c == 'Determine Needs'){opp.StageName='Confirming Vision Match';}
   if(opp.Sales_Stage__c == 'Evaluate Options'){opp.StageName='Confirming Value and Power';}
   if(opp.Sales_Stage__c == 'Resolve Concerns'){opp.StageName='Finalizing Mutual Plan';}
   if(opp.Sales_Stage__c == 'Negotiate'){opp.StageName='Negotiating';}
   if(opp.Sales_Stage__c == 'Closed'){opp.StageName='Closed';}
   if(opp.Sales_Stage__c == 'Lost'){opp.StageName='Lost';}
   if(opp.Sales_Stage__c == 'No Decision'){opp.StageName='No Decision';}
   if(opp.Sales_Stage__c == 'Opportunity Identified'){opp.StageName='Opportunity Identified';}
   if(opp.Sales_Stage__c == 'Prospecting'){opp.StageName='Prospecting';}
   }

}
   }
   }

 

 

 

  • April 01, 2011
  • Like
  • 0

Hi there.

 

I have a trigger that works almost perfectly but I need to change the behavior and I'm at a loss how to.

 

Behavior

Updates Opportunity field "Next Task Date" with the task due date

Updates Opportunity field "Next Task Subject" with the task subject

Triggered when

A new task is created or an existing open task is updated

ex. if there are 2 tasks , one due 1/1/2013 and another due 1/1/2014

if either one of these is updated or a new task is created, the opportunity fields are updated

Challenge

I need to limit the update so that it only pulls info from the next closest task due date

 

How do I change the trigger so that it achieves this? I would really appreciate some coding help.

 

Thanks  in advance. Please see code below.

 

trigger NextTaskInfo on Task (after insert, after update) {
//this is the trigger that updates next step and next step date on opportunity
  if(Trigger.new.size() == 1 ) {
    Task tk = Trigger.new.get(0);
      if (tk.WhatId != null && String.valueOf(tk.WhatId).startsWith('006')) { 
        Opportunity opp = [select OwnerId,NextTaskSubject__c,Next_Task_Date__c from Opportunity where Id = :tk.WhatId ];
          if( tk.OwnerId == opp.OwnerId && tk.ActivityDate != null) {                   
            if (tk.isClosed == false) {
              opp.Next_Step_Date__c = tk.ActivityDate;
              opp.NextStep = tk.Type;
              update opp;
}
}
}
}
}

 

 

  • December 31, 2011
  • Like
  • 0

Hi,

 

I would like to implement Feedback functionality to my Site / Portal. All i would like to achieve is, when a user clicks on the feedback link, Microsoft outlook should open with an To address pre-populated. How could this be achieved using salesforce? Any pointers are appreciated on the same. 

 

Thanks.

  • April 13, 2010
  • Like
  • 0

I have this custom formula field on the task object. 

 

Formula is;

HYPERLINK("/"& WhatId, 'Detail Link')

 

Displayed as

Link: Detail Link 

 

I want to display the actual account name instead of "Detail Link" 

Is there any way to change the script to achieve this?

  • September 15, 2009
  • Like
  • 0