• cmoyle
  • NEWBIE
  • 230 Points
  • Member since 2011
  • Technical Architect
  • EDL Consulting


  • Chatter
    Feed
  • 8
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 32
    Replies
This code renders the Other_Policy_term__c visible if the user chooses 'other' from a picklist called Policy_Term__c . However, I have a script function that collapses the page block section on load. This actionSupport event causes the pageblock section to collapse . How can I update the field leaving the section expanded ? 

<apex:page standardController="Auto_Audit_Sample_Policy__c" readOnly="false" > 
<apex:variable var="a" value="{!Auto_Audit_Sample_Policy__c}" /> 
<apex:variable var="PolicyTerm" value="{!a.Policy_Term__c}" />

<apex:form id="form1">
<apex:pageBlock id="block1" title="Auto Policy" >
    <apex:outputPanel id="ajaxrequest" >
    <apex:pageBlockSection columns="1" id="section1" title="Policy Information" rendered="{!PolicyInformation=true}">

        <apex:inputField value="{!a.Policy_Term__c}" >
            <apex:actionSupport event="onchange" reRender="section1" />
        </apex:inputField>
        <apex:inputField id="fieldtest" value="{!a.Other_Policy_term__c}" rendered="{!PolicyTerm="other"}" />
 
    <script>twistSection(document.getElementById("{!$Component.section1}").childNodes[0].childNodes[0]); </script>
</apex:pageBlockSection>
</apex:outputPanel> 
</apex:pageBlock>
</apex:form>
</apex:page>
I have looked and looked and can't find an answer to this problem. Any ideas?

I have a Visualforce HTML email template that uses apex:outputtext to render a number of fields conditionally, like this:

<apex:outputText value="Survey Name: {!relatedTo.Survey__r.Name}"
                  rendered="{!IF(relatedTo.Survey__r.Yes_or_No__c ='Yes', TRUE,FALSE)}"/><br/>

I have many such apex:outputtext statements in a row. Ideally, I'd like the <br/> behavior to be embedded inside the value string, so it is also rendered conditionally. Otherwise, if many of my fields are not displayed because of the value of their rendered attribute, I get a lot of extranous blank space in my generated email.

I would like to be able to do something like:

<apex:outputText value="Survey Name: {!relatedTo.Survey__r.Name}\n\r"
                  rendered="{!IF(relatedTo.Survey__r.Yes_or_No__c ='Yes', TRUE,FALSE)}"/><br/>

Can anyone help?
Thanks in advance!!!
 
Hi All,
I have been given this great  code; however I am not a developer and having difficulties on writing the test code.
I have googled and search many test codes, but am lost and stuck. Any help would be much appreciated.
Thank you in advance!

Apex Class
01	<apex:page standardController="Case" extensions="OppProductsOnCaseController" title="Related Opportunity Products">
02	  <apex:form id="oppProdForm">
03	      <apex:pageBlock id="prodPB" title="Opportunity Product Details">
04	          <apex:pageBlockTable id="pbTable" value="{!oppLineItem}" var="oli">
05	              <apex:column headerValue="Product Name" value="{!oli.PriceBookEntry.Product2.Name}" />
06	              <apex:column headerValue="Quantity" value="{!oli.Quantity}"/>             
07	          </apex:pageBlockTable>     
08	      </apex:pageBlock>
09	  </apex:form>
10	</apex:page>

VF Page
01	public class OppProductsOnCaseController{
02	     
03	    // declatre variables to hold the current case record
04	    public Case inContextCase {get; set;}
05	    // decalre variable to hold the list of oli fields for the related opportunity
06	    public List<OpportunityLineItem> oppLineItem {get; set;}
07	     
08	    // constructor for the class
09	    public OppProductsOnCaseController(ApexPages.StandardController stdCont){
10	        // instantiate the variables decalred
11	        inContextCase = new Case();
12	        oppLineItem = new List<OpportunityLineItem>();
13	         
14	        // get the in context record from the passed in argument in the constructor
15	        inContextCase = (Case) stdCont.getRecord();
16	        // query the necessary fields from the case object like the related opportunity field value
17	        inContextCase = [SELECT Id, Related_Opportunity__c FROM Case WHERE Id = :inContextCase.Id];
18	         
19	        // if the case is related to an opportunity then using the opportunity id query and fetch the opportunity line items
20	        if(inContextCase.Related_Opportunity__c != null){
21	            // add or delete fields from the query as required
22	            oppLineItem = [SELECT Id, ListPrice, OpportunityId, PriceBookEntryId, PriceBookEntry.Product2.Name, Quantity, UnitPrice, TotalPrice FROM OpportunityLineItem
23	                            WHERE OpportunityId = :inContextCase.Related_Opportunity__c];
24	            if(oppLineItem != null && oppLineItem.size() > 0){
25	                // do further operations with opp line items if required.
26	                // if not then delete the if condition
27	            }
28	        }
29	         
30	    }
31	}


 

Any one help me writing test class for this........

 

public with sharing class ExpenseKeyWrapper
{
public Integer key {get; set;}
public Expense__c expense {get; set;}

public ExpenseKeyWrapper(){}

public ExpenseKeyWrapper(Integer inKey, Expense__c inExpense)
{
key=inKey;
expense=inExpense;
}
}

I am new to coding and I am working on my first trigger.

 

I have an object called "Affiliations" and another called "Addresses." The Affiliations object enables multiple Business Account relationships for Person Accounts instead of one Business Account per Person Account. The Addresses object enables an Account to have multiple Addresses.

 

Business rules:

1. Every Business Account only has 1 physical address.

2. Person Accounts may have many addresses.

3. Person Accounts may have one or more Business Account affiliation(s).

4. Business Accounts may have one or more Business Account affiliation(s).

5. Each Person Account affiliated to a Business Account should inherit the physical address of the Business Account.

 

I am trying to achieve item #5 with a trigger. Whenever an Affiliation is created between a Business Account and Person Account, I want the Address record of the Business Account to be copied/cloned and made an attribute of the Person Account. I can get the trigger to create an Address record on the Person Account when an Affiliation record is created, but don't know what to do from there to get the values from the Business Account address on the new Address record.

 

This is what I have so far...

 

 

 

trigger createAffiliationAddress on Affiliation_SC__c (after insert, after update){

 


List<Address_SC__c> copyParentAddress = new List<Address_SC__c>();

List<Address_SC__c> parentAddress = [SELECT Id, Account_SC__c, Address_Line_1_SC__c, Address_Line_2_SC__c, City_SC__c,
Country_SC__c, Postal_Code_SC__c, State_SC__c
FROM Address_SC__c
WHERE Account_SC__c = :Trigger.new[0].id];

 

for (Affiliation_SC__c newAffiliation: Trigger.new){
copyParentAddress.add (new Address_SC__c(
Account_SC__c = newAffiliation.To_Account_SC__c));

 

// Rather than insert the addresses individually, add the addresses to a list and bulk insert it. This makes the
// trigger run faster and allows us to avoid hitting the governor limit on DML statements.

}
insert copyParentAddress;
}

 

 

 

Will you please help?

  • November 22, 2013
  • Like
  • 0

So I have created this pop up when cases are logged as critical cases to remind the customer to call the hotline.

 

Problem 1 - I works fine in IE and Chrome, only thing in Chrome, you can't see the style sheet colors.  Anyone know how to remedy this?

 

Problem 2 & 3 - it doesn't show up when logged in as Partner and Customer portal users, works fine as myself (admin).  Is there any way to turn this "on" to portal users.  This is who really needs the reminder

 

Apex Page:

<apex:page standardController="Case" rendered="{!Case.Impact__c = 'Site Production Down'}" extensions="CW_alertMessage">

<script type="text/javascript">
{
    window.showModalDialog("{!urlRec}","dialogWidth:1200px; dialogHeight:200px; center:yes");
}

</script>


</apex:page>

 Apex Page with Alert Message:

<apex:page standardStylesheets="false" showHeader="false">

 <apex:stylesheet value="{!$Resource.mystyle}"/>
  <h1 class="myStyle">You have indicated that site operations is critically impaired.</h1>
  <p>Please contact <b>800-480-9830</b> to ensure Product Support is aware of your incident.
  <br><br>If site operations is not currently critically impaired, please adjust the value <br>in the <b>IMPACT</b> field to accurately reflect current site functionality</br></br></br></p>
  
</apex:page>

 Apex Class:

public with sharing class CW_alertMessage {

    public CW_alertMessage(ApexPages.StandardController controller) {

    }
public string geturlRec()
{
    string urlRec='https://caterpillar--cw.cs15.my.salesforce.com/apex/CW_AlertMessagePage';
    return urlRec;
}

}

 Static Resource:

body  {
   background-color: #236FBD;
}
 
.pbTitle {
    background-color: yellow;
}         
.myStyle {
    background-color: red; 
    
}  

 

  • November 21, 2013
  • Like
  • 0

So here's the scenario:

 

I have a main flow that was developed in the flow designer tool that has several subflows. The flows need to be visible publicly so I've embedded the main flow on a visualforce page using the flow:interview tag and added the visualforce page to a force.com site that I've set up. One of the subflows has a choice lookup that is not being populated and I am stumped.

 

Here's what I've tried:

 

I first checked that there weren't any permissions issues with the object by creating a sample visualforce page with a select list with the same data from the custom object and added it to my anonymous site - this worked and the data showed up.

 

I checked to see if it was a problem with the flow itself, but I've gone through and accessed the visualforce page as an administrator and it was working - the data was populating in the choice lookup correctly. 

 

I verfied the filter wasn't causing a problem on the choice lookup by removing the filter entirely and also checking the debug logs to make sure parameters were passing correctly - data still did not show up.

 

Here's the problem lookup - the data validation loop isn't a problem because i have another lookup without it thats not working. The unique id for the choice lookup is a custom field on the custom state object and the display value is the Name field. It has 1 filter and 2 allocations.

 

 

 

Any help is greatly appreciated.

  • January 31, 2012
  • Like
  • 0

I have 3 dependent picklists set up in my Case object and when I place the fields on my visualforce page via <apex:inputField>, they are missing some of the field values that should be displayed in the picklists. I have verfied that they are selected in the dependecy matrix, and checked that no Record Types or workflows would have them removed as well. Is there something that I'm not thinking of that drives the display for picklists in a visualforce page?

  • October 13, 2011
  • Like
  • 0

So i'm trying to set up an ipad application to allow users to authenticate on our portal site. I've spent a ton of time researching and making different attempts but I always come to the same scenario. Either the user has to have a security token passed in with the username/password or the ipad app has to display an external salesforce page in a browser to get a token. Does anyone know of a way to authenticate a portal user with ONLY a username/password and without being redirected off the main application?

Hey, hopefully this isn't too complicated of a process, but I would like to customize the login page of my iPad when authenticating with oAuth 2.0. Right now, I've got the general code that I found on this Page to authenticate users with my salesforce org. However, it brings the user to this page:

 

 

Any way to customize this, or any better solutions?

So i'm trying to validate an apex form that submits via an ajax call. The form validation is being applied, however the form is still being submitted. It looks like the following:

 

 

<apex:form styleClass="createCaseForm" id="createCaseForm">
   <!--Form Elements-->

    <apex:commandLink rerender="status" action="{!submitCase}" styleClass="createCaseButton">
       <input type="image" value="Submit" src="..."/>
    </apex:commandLink>
</apex:form>

 Then the jquery that handles the validation looks like this:

 

 

$(document).ready(function(){
   $(".createCaseButton").click(function(event){
		if(mustCheck) {
			// Prevent submit if validation fails
			if( !checkForm($(".createCaseForm")) ) {
				event.preventDefault();
			};
		} else {
			mustCheck = !mustCheck;
		}
	});
});

 

Any idea how to prevent the form from being submitted when the validation fails?

 

 

  • April 21, 2011
  • Like
  • 0

So I have an <apex:inputText id="email"> tag in one of my visualforce pages. I'm trying to access it from one of my jquery functions to do some styling on it when the document loads. However, for some reason none of the styling is applied from the jquery function. I'm doing the following:

 

<script>

$(document).ready(function(){

...

var value = $("#emailComponent").val();

$("#" + value).style...

...

});

</script>

...

<apex:inputText id="email"/>

<input type="hidden" value="{!$Component.email}" id="emailComponent"/>

 

If I change the apex tag to a standard html input field, the jquery works. Can someone help me figure out why my jquery styling isn't applied to the apex tag?

  • April 20, 2011
  • Like
  • 0
Hi,

I have a CSV file with a list of 1800 accounts that I want to upload into our Salesforce.com database. These are all brand new accounts. We do not currently have any of these accounts within our SF. Is it better I use the Apex data loader and map the fields that way or should I use the import wizard that is in Salesforce.com and map the fields that way? I'm not sure the best way to go about it.

Let me know.

Thanks!
Ellyn
We are looking to fire a trigger based on the record result of a workflow rule.  My initial thought would be to write an entirely new trigger that encorporates the logic of the workflow rule AND the existing trigger, but if we can just tell the existing trigger to fire after the workflow completes, it won't require developer time.

Thoughts?
This code renders the Other_Policy_term__c visible if the user chooses 'other' from a picklist called Policy_Term__c . However, I have a script function that collapses the page block section on load. This actionSupport event causes the pageblock section to collapse . How can I update the field leaving the section expanded ? 

<apex:page standardController="Auto_Audit_Sample_Policy__c" readOnly="false" > 
<apex:variable var="a" value="{!Auto_Audit_Sample_Policy__c}" /> 
<apex:variable var="PolicyTerm" value="{!a.Policy_Term__c}" />

<apex:form id="form1">
<apex:pageBlock id="block1" title="Auto Policy" >
    <apex:outputPanel id="ajaxrequest" >
    <apex:pageBlockSection columns="1" id="section1" title="Policy Information" rendered="{!PolicyInformation=true}">

        <apex:inputField value="{!a.Policy_Term__c}" >
            <apex:actionSupport event="onchange" reRender="section1" />
        </apex:inputField>
        <apex:inputField id="fieldtest" value="{!a.Other_Policy_term__c}" rendered="{!PolicyTerm="other"}" />
 
    <script>twistSection(document.getElementById("{!$Component.section1}").childNodes[0].childNodes[0]); </script>
</apex:pageBlockSection>
</apex:outputPanel> 
</apex:pageBlock>
</apex:form>
</apex:page>
I have looked and looked and can't find an answer to this problem. Any ideas?

I have a Visualforce HTML email template that uses apex:outputtext to render a number of fields conditionally, like this:

<apex:outputText value="Survey Name: {!relatedTo.Survey__r.Name}"
                  rendered="{!IF(relatedTo.Survey__r.Yes_or_No__c ='Yes', TRUE,FALSE)}"/><br/>

I have many such apex:outputtext statements in a row. Ideally, I'd like the <br/> behavior to be embedded inside the value string, so it is also rendered conditionally. Otherwise, if many of my fields are not displayed because of the value of their rendered attribute, I get a lot of extranous blank space in my generated email.

I would like to be able to do something like:

<apex:outputText value="Survey Name: {!relatedTo.Survey__r.Name}\n\r"
                  rendered="{!IF(relatedTo.Survey__r.Yes_or_No__c ='Yes', TRUE,FALSE)}"/><br/>

Can anyone help?
Thanks in advance!!!
 
Hi All,

Could you please let me know will there be any performance degradation in production if system.debug are kept.What is the best pratice acording to salesforce for system.debug in production area. 

Should we remove them or not???

Regards
Hi All,
I have been given this great  code; however I am not a developer and having difficulties on writing the test code.
I have googled and search many test codes, but am lost and stuck. Any help would be much appreciated.
Thank you in advance!

Apex Class
01	<apex:page standardController="Case" extensions="OppProductsOnCaseController" title="Related Opportunity Products">
02	  <apex:form id="oppProdForm">
03	      <apex:pageBlock id="prodPB" title="Opportunity Product Details">
04	          <apex:pageBlockTable id="pbTable" value="{!oppLineItem}" var="oli">
05	              <apex:column headerValue="Product Name" value="{!oli.PriceBookEntry.Product2.Name}" />
06	              <apex:column headerValue="Quantity" value="{!oli.Quantity}"/>             
07	          </apex:pageBlockTable>     
08	      </apex:pageBlock>
09	  </apex:form>
10	</apex:page>

VF Page
01	public class OppProductsOnCaseController{
02	     
03	    // declatre variables to hold the current case record
04	    public Case inContextCase {get; set;}
05	    // decalre variable to hold the list of oli fields for the related opportunity
06	    public List<OpportunityLineItem> oppLineItem {get; set;}
07	     
08	    // constructor for the class
09	    public OppProductsOnCaseController(ApexPages.StandardController stdCont){
10	        // instantiate the variables decalred
11	        inContextCase = new Case();
12	        oppLineItem = new List<OpportunityLineItem>();
13	         
14	        // get the in context record from the passed in argument in the constructor
15	        inContextCase = (Case) stdCont.getRecord();
16	        // query the necessary fields from the case object like the related opportunity field value
17	        inContextCase = [SELECT Id, Related_Opportunity__c FROM Case WHERE Id = :inContextCase.Id];
18	         
19	        // if the case is related to an opportunity then using the opportunity id query and fetch the opportunity line items
20	        if(inContextCase.Related_Opportunity__c != null){
21	            // add or delete fields from the query as required
22	            oppLineItem = [SELECT Id, ListPrice, OpportunityId, PriceBookEntryId, PriceBookEntry.Product2.Name, Quantity, UnitPrice, TotalPrice FROM OpportunityLineItem
23	                            WHERE OpportunityId = :inContextCase.Related_Opportunity__c];
24	            if(oppLineItem != null && oppLineItem.size() > 0){
25	                // do further operations with opp line items if required.
26	                // if not then delete the if condition
27	            }
28	        }
29	         
30	    }
31	}


 

Hi I have two fields in product object where i need to split the data and send to the other custom field for this i have split the data

eg:cable/1234  1234 will be placed in the other custom field there are some records like cable/MO1234 i just want to remove the string Mo for such records any help or make them as default to be 1 for such records ant help thanks in advance

trigger ProductFieldUpdate on Product2 (Before insert, before update){
    for(Product2 p : trigger.new){
  
        if(p.Ampics_PL__c != null && p.Ampics_PL__c == 'UTILUX'  ) {
        if(p.description!= null && p.description.lastIndexOf('/') != -1) {
      
      
      
        Integer lastIndx = p.description.lastIndexOf('/');
        p.GPL_Desc__c  = string.valueOf(p.description.subString(lastIndx + 1));
       
      
        }
       
           } else {
        p.GPL_Desc__c = '1';
           }
        }
        }

HI,

 

        I develop a webservice i am getting the date 12/9/2013 format while i am inserting this date in oppoertunity object but the date which comes from thirdparty system is not inserting exactly.

 

  my code is for date insert.

 

  Opportunity o = new Opportunity()

  o.Name = rName// rName Which Coming from Third Party system

  o.CloseDate =  ocDate; // when i map like this means it not taking may i know i want to da any modifications

   the date which was given by third party system that data must be insert in sfdc

 

      insert 0;

 

 

I have my code completed, but when I try to upload it to production I am getting an error:   I am very new to code so any help would be greatly appriciated.

 

 

System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, LastActDate3: execution of AfterInsert

caused by: System.DmlException: Update failed. First exception on row 0; first error: MISSING_ARGUMENT, Id not specified in an update call: []

Trigger.LastActDate3: line 55, column 1: []

 

 

 

Here is my trigger code

 

 

trigger LastActDate3 on Task (after insert, after update) {

Set <ID> OptyIDs = new Set <ID> ();

Set<Id> Ready4Update = new Set<Id>();

List<Opportunity> OppList = new List<Opportunity>();

for (Task t: Trigger.new){

OptyIDs.add(t.WhatID);

}

Map<ID, Opportunity> OptyMap = new Map<ID, Opportunity> ([Select ID,Last_Activity__c from Opportunity where ID in :OptyIDs]);

for (Task t: Trigger.new){

if (t.WhatID != NULL){

 

Opportunity OptyRec = new Opportunity(); if(OptyMap.size()>0 && OptyMap.containsKey(t.WhatId)){ OptyRec = OptyMap.get(t.WhatID); If (t.subject <> null && t.subject.contains('Act-On Email') == false){ Optyrec.Last_Activity__c = t.ActivityDate; } if(!Ready4Update.contains(OptyRec.id)){ OppList.add(OptyRec); Ready4Update.add(OptyRec.id); } }

If (((!t.subject.contains('Act-On Email')) )){

 

Optyrec.Last_Activity__c = t.ActivityDate;

 

}

if(!Ready4Update.contains(OptyRec.id)){

 

   OppList.add(OptyRec);   

   Ready4Update.add(OptyRec.id);

 

}

 

}

}

if(OppList.size() > 0){

update oppList;

}

}

Hi,

 

I have a custom date field last_Modified_date__c on Account object. I am writing a before upate trigger, and some part of the code must execute only when last_Modified_date__c != NULL. I get the error 'Invalid field for Sobject Account when i refer the last modified field. How can I overcome this situation and check the null vlaue in the trigger for date field?

 

Thank You in advance for your help.

 

  • November 25, 2013
  • Like
  • 0

Any one help me writing test class for this........

 

public with sharing class ExpenseKeyWrapper
{
public Integer key {get; set;}
public Expense__c expense {get; set;}

public ExpenseKeyWrapper(){}

public ExpenseKeyWrapper(Integer inKey, Expense__c inExpense)
{
key=inKey;
expense=inExpense;
}
}

Hey Guys,

 

I have an urgent fix needed, I deployed a new Trigger (and subsequently had to comment it out).

 

I have no idea, why when modifying an Account, is causing a Task trigger to error out. 

 

There are obviously two triggers fighting back and forth and I am not sure why.

 

The Trigger is this: 

trigger AccountUpdateonLogCall on Task (after insert, after update) {
	
	//To do - If the Purpose of a completed task contains "Low Redemption" or "Proactive", put the description of the completed task in the 
	//the "Low_Redemption_Notes__c" and/or "Proactive_Communication_Notes__c" field on the account object

//Create a set of related account ID's
Set <ID> acctIDs = new Set <ID> ();


//For every task, add it's related to account ID to the set
	for (Task t: Trigger.new){
	  acctIDs.add(t.accountID);
//Create a map to match the task related to ID's with their corresponding account ID's
	  Map<ID, Account> acctMap = new Map<ID, Account> ([Select ID, Proactive_Communication_Notes__c, Low_Redemption_Notes__c  from Account where ID in :acctIDs]);
//Create the account object
      Account acctRec = acctMap.get(t.whatID);

//If the account ID isn't null, the Purpose is Pro or Low, and the task has been marked as completed    
//Check to see if the which fields to update based upon the Purpose__c field.
  	  if (t.accountID != null && t.Purpose__c.Equals('Proactive Communication') && t.Status == 'Completed'){
//Update the Last_SW_Activity__c field on the account object with the task's end date  
  		  acctrec.Proactive_Communication_Notes__c = t.Description;
  		  update acctRec;
  	  }
  	  else if (t.accountID != null &&  t.Purpose__c == ('Low-Redemption Communication') && t.Status == ('Completed')){
  	  	  acctrec.Proactive_Communication_Notes__c = t.Description;
  	  	  acctrec.Low_Redemption_Notes__c = t.Description;
  		  update acctRec;
  	}
  }

 

 The end of the error is here: 

09:28:50.461|CUMULATIVE_LIMIT_USAGE_END

09:28:58.640 (15640685095)|CODE_UNIT_FINISHED|TestClass.myUnitTest
09:28:58.640 (15640691443)|EXECUTION_FINISHED
09:28:58.672 (15672545565)|EXECUTION_STARTED
09:28:58.672 (15672557111)|CODE_UNIT_STARTED|[EXTERNAL]|01pU0000000uhEc|unsubscribe.testUnsubscribe
09:28:58.672 (15672823603)|METHOD_ENTRY|[1]|01pU0000000uhEc|unsubscribe.unsubscribe()
09:28:58.672 (15672831894)|METHOD_EXIT|[1]|unsubscribe
09:28:58.672 (15672929931)|SYSTEM_CONSTRUCTOR_ENTRY|[94]|<init>()
09:28:58.672 (15672964293)|SYSTEM_CONSTRUCTOR_EXIT|[94]|<init>()
09:28:58.673 (15673000365)|SYSTEM_CONSTRUCTOR_ENTRY|[95]|<init>()
09:28:58.673 (15673018059)|SYSTEM_CONSTRUCTOR_EXIT|[95]|<init>()
09:28:58.673 (15673179045)|DML_BEGIN|[103]|Op:Insert|Type:Lead|Rows:1
09:28:59.261 (16261741837)|CODE_UNIT_STARTED|[EXTERNAL]|Workflow:Lead
09:28:59.268 (16268756720)|CODE_UNIT_FINISHED|Workflow:Lead
09:28:59.270 (16270842834)|DML_END|[103]
09:28:59.271 (16271021000)|DML_BEGIN|[110]|Op:Insert|Type:Contact|Rows:1
09:28:59.392 (16392831876)|DML_END|[110]
09:28:59.392 (16392927559)|CONSTRUCTOR_ENTRY|[117]|01pU0000000uhEc|<init>()
09:28:59.392 (16392984711)|CONSTRUCTOR_EXIT|[117]|01pU0000000uhEc|<init>()
09:28:59.393 (16393010727)|METHOD_ENTRY|[118]|01pU0000000uhEc|unsubscribe.handleInboundEmail(Messaging.InboundEmail, Messaging.InboundEnvelope)
09:28:59.393 (16393088911)|SYSTEM_CONSTRUCTOR_ENTRY|[8]|<init>()
09:28:59.393 (16393117648)|SYSTEM_CONSTRUCTOR_EXIT|[8]|<init>()
09:28:59.393 (16393137238)|SYSTEM_CONSTRUCTOR_ENTRY|[11]|<init>()
09:28:59.393 (16393158715)|SYSTEM_CONSTRUCTOR_EXIT|[11]|<init>()
09:28:59.393 (16393204778)|SYSTEM_CONSTRUCTOR_ENTRY|[12]|<init>()
09:28:59.393 (16393227885)|SYSTEM_CONSTRUCTOR_EXIT|[12]|<init>()
09:28:59.393 (16393527015)|SOQL_EXECUTE_BEGIN|[33]|Aggregations:0|select Id, Name, Email, HasOptedOutOfEmail from Contact 
09:28:59.418 (16418074120)|SOQL_EXECUTE_END|[33]|Rows:1
09:28:59.418 (16418167403)|SYSTEM_METHOD_ENTRY|[33]|Database.QueryLocator.iterator()
09:28:59.418 (16418328865)|SYSTEM_METHOD_ENTRY|[7]|QueryLocatorIterator.QueryLocatorIterator()
09:28:59.418 (16418343945)|SYSTEM_METHOD_EXIT|[7]|QueryLocatorIterator
09:28:59.418 (16418429734)|SYSTEM_METHOD_EXIT|[33]|Database.QueryLocator.iterator()
09:28:59.418 (16418447665)|SYSTEM_METHOD_ENTRY|[33]|Database.QueryLocatorIterator.hasNext()
09:28:59.418 (16418485833)|SYSTEM_METHOD_ENTRY|[33]|LIST<Contact>.size()
09:28:59.418 (16418516395)|SYSTEM_METHOD_EXIT|[33]|LIST<Contact>.size()
09:28:59.418 (16418532213)|SYSTEM_METHOD_EXIT|[33]|Database.QueryLocatorIterator.hasNext()
09:28:59.418 (16418543964)|SYSTEM_METHOD_ENTRY|[33]|Database.QueryLocatorIterator.next()
09:28:59.418 (16418562952)|SYSTEM_METHOD_ENTRY|[48]|Database.QueryLocatorIterator.hasNext()
09:28:59.418 (16418583322)|SYSTEM_METHOD_ENTRY|[33]|LIST<Contact>.size()
09:28:59.418 (16418594968)|SYSTEM_METHOD_EXIT|[33]|LIST<Contact>.size()
09:28:59.418 (16418605734)|SYSTEM_METHOD_EXIT|[48]|Database.QueryLocatorIterator.hasNext()
09:28:59.418 (16418645056)|SYSTEM_METHOD_EXIT|[33]|Database.QueryLocatorIterator.next()
09:28:59.418 (16418723679)|SYSTEM_METHOD_ENTRY|[41]|LIST<Contact>.add(Object)
09:28:59.418 (16418755646)|SYSTEM_METHOD_EXIT|[41]|LIST<Contact>.add(Object)
09:28:59.418 (16418766937)|SYSTEM_METHOD_ENTRY|[33]|Database.QueryLocatorIterator.hasNext()
09:28:59.418 (16418781516)|SYSTEM_METHOD_EXIT|[33]|Database.QueryLocatorIterator.hasNext()
09:28:59.418 (16418853617)|DML_BEGIN|[45]|Op:Update|Type:Contact|Rows:1
09:28:59.445 (16445474217)|DML_END|[45]
09:28:59.445 (16445960322)|SOQL_EXECUTE_BEGIN|[53]|Aggregations:0|select Id, Name, Email, HasOptedOutOfEmail from Lead 
09:28:59.477 (16477011223)|SOQL_EXECUTE_END|[53]|Rows:1
09:28:59.477 (16477077421)|SYSTEM_METHOD_ENTRY|[53]|Database.QueryLocator.iterator()
09:28:59.477 (16477308106)|SYSTEM_METHOD_EXIT|[53]|Database.QueryLocator.iterator()
09:28:59.477 (16477327336)|SYSTEM_METHOD_ENTRY|[53]|Database.QueryLocatorIterator.hasNext()
09:28:59.477 (16477368820)|SYSTEM_METHOD_ENTRY|[33]|LIST<Lead>.size()
09:28:59.477 (16477381191)|SYSTEM_METHOD_EXIT|[33]|LIST<Lead>.size()
09:28:59.477 (16477401035)|SYSTEM_METHOD_EXIT|[53]|Database.QueryLocatorIterator.hasNext()
09:28:59.477 (16477411846)|SYSTEM_METHOD_ENTRY|[53]|Database.QueryLocatorIterator.next()
09:28:59.477 (16477425170)|SYSTEM_METHOD_ENTRY|[48]|Database.QueryLocatorIterator.hasNext()
09:28:59.477 (16477439702)|SYSTEM_METHOD_ENTRY|[33]|LIST<Lead>.size()
09:28:59.477 (16477449821)|SYSTEM_METHOD_EXIT|[33]|LIST<Lead>.size()
09:28:59.477 (16477460138)|SYSTEM_METHOD_EXIT|[48]|Database.QueryLocatorIterator.hasNext()
09:28:59.477 (16477511767)|SYSTEM_METHOD_EXIT|[53]|Database.QueryLocatorIterator.next()
09:28:59.477 (16477588069)|SYSTEM_METHOD_ENTRY|[61]|LIST<Lead>.add(Object)
09:28:59.477 (16477623318)|SYSTEM_METHOD_EXIT|[61]|LIST<Lead>.add(Object)
09:28:59.477 (16477648698)|SYSTEM_METHOD_ENTRY|[63]|String.valueOf(Object)
09:28:59.477 (16477711423)|SYSTEM_METHOD_EXIT|[63]|String.valueOf(Object)
09:28:59.477 (16477729129)|SYSTEM_METHOD_ENTRY|[63]|System.debug(ANY)
09:28:59.477 (16477737311)|USER_DEBUG|[63]|DEBUG|Lead Object: Lead:{Name=Rasmus Mencke, Email=rmencke@salesforce.com, Id=00QU000000D4GPdMAN, HasOptedOutOfEmail=true}
09:28:59.477 (16477743969)|SYSTEM_METHOD_EXIT|[63]|System.debug(ANY)
09:28:59.477 (16477760011)|SYSTEM_METHOD_ENTRY|[53]|Database.QueryLocatorIterator.hasNext()
09:28:59.477 (16477772573)|SYSTEM_METHOD_EXIT|[53]|Database.QueryLocatorIterator.hasNext()
09:28:59.477 (16477815825)|DML_BEGIN|[66]|Op:Update|Type:Lead|Rows:1
09:28:59.535 (16535285783)|ENTERING_MANAGED_PKG|RT1
09:28:59.537 (16537085362)|CODE_UNIT_STARTED|[EXTERNAL]|Workflow:Lead
09:28:59.537 (16537109734)|CODE_UNIT_FINISHED|Workflow:Lead
09:28:59.537 (16537182920)|DML_END|[66]
09:28:59.537 (16537249306)|SYSTEM_METHOD_ENTRY|[73]|System.debug(ANY)
09:28:59.537 (16537272785)|USER_DEBUG|[73]|DEBUG|Found the unsubscribe word in the subject line.
09:28:59.537 (16537281200)|SYSTEM_METHOD_EXIT|[73]|System.debug(ANY)
09:28:59.537 (16537302671)|METHOD_EXIT|[118]|01pU0000000uhEc|unsubscribe.handleInboundEmail(Messaging.InboundEmail, Messaging.InboundEnvelope)
09:28:51.358 (16537327168)|CUMULATIVE_LIMIT_USAGE
09:28:51.358|LIMIT_USAGE_FOR_NS|(default)|
  Number of SOQL queries: 2 out of 100
  Number of query rows: 2 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 4 out of 150
  Number of DML rows: 4 out of 10000
  Number of code statements: 27 out of 200000
  Maximum CPU time: 0 out of 10000
  Maximum heap size: 0 out of 6000000
  Number of callouts: 0 out of 10
  Number of Email Invocations: 0 out of 10
  Number of fields describes: 0 out of 100
  Number of record type describes: 0 out of 100
  Number of child relationships describes: 0 out of 100
  Number of picklist describes: 0 out of 100
  Number of future calls: 0 out of 10

09:28:51.358|LIMIT_USAGE_FOR_NS|RT1|
  Number of SOQL queries: 0 out of 100
  Number of query rows: 0 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 0 out of 150
  Number of DML rows: 0 out of 10000
  Number of code statements: 4 out of 200000
  Maximum CPU time: 0 out of 10000
  Maximum heap size: 0 out of 6000000
  Number of callouts: 0 out of 10
  Number of Email Invocations: 0 out of 10
  Number of fields describes: 0 out of 100
  Number of record type describes: 0 out of 100
  Number of child relationships describes: 0 out of 100
  Number of picklist describes: 0 out of 100
  Number of future calls: 0 out of 10

09:28:51.358|CUMULATIVE_LIMIT_USAGE_END

09:28:59.537 (16537378369)|CODE_UNIT_FINISHED|unsubscribe.testUnsubscribe
09:28:59.537 (16537386450)|EXECUTION_FINISHED
09:28:59.597 (16597443514)|EXECUTION_STARTED
09:28:59.597 (16597456990)|CODE_UNIT_STARTED|[EXTERNAL]|01pU0000000uhEc|unsubscribe.testUnsubscribe2
09:28:59.597 (16597725101)|METHOD_ENTRY|[1]|01pU0000000uhEc|unsubscribe.unsubscribe()
09:28:59.597 (16597734223)|METHOD_EXIT|[1]|unsubscribe
09:28:59.597 (16597847377)|SYSTEM_CONSTRUCTOR_ENTRY|[125]|<init>()
09:28:59.597 (16597884686)|SYSTEM_CONSTRUCTOR_EXIT|[125]|<init>()
09:28:59.597 (16597903204)|SYSTEM_CONSTRUCTOR_ENTRY|[126]|<init>()
09:28:59.597 (16597917993)|SYSTEM_CONSTRUCTOR_EXIT|[126]|<init>()
09:28:59.598 (16598028373)|DML_BEGIN|[134]|Op:Insert|Type:Lead|Rows:1
09:28:59.689 (16689902323)|CODE_UNIT_STARTED|[EXTERNAL]|Workflow:Lead
09:28:59.689 (16689934241)|CODE_UNIT_FINISHED|Workflow:Lead
09:28:59.692 (16692004222)|DML_END|[134]
09:28:59.692 (16692166896)|DML_BEGIN|[141]|Op:Insert|Type:Contact|Rows:1
09:28:59.724 (16724815820)|DML_END|[141]
09:28:59.724 (16724868518)|CONSTRUCTOR_ENTRY|[148]|01pU0000000uhEc|<init>()
09:28:59.724 (16724907249)|CONSTRUCTOR_EXIT|[148]|01pU0000000uhEc|<init>()
09:28:59.724 (16724922296)|METHOD_ENTRY|[149]|01pU0000000uhEc|unsubscribe.handleInboundEmail(Messaging.InboundEmail, Messaging.InboundEnvelope)
09:28:59.724 (16724975920)|SYSTEM_CONSTRUCTOR_ENTRY|[8]|<init>()
09:28:59.724 (16724998785)|SYSTEM_CONSTRUCTOR_EXIT|[8]|<init>()
09:28:59.725 (16725021927)|SYSTEM_CONSTRUCTOR_ENTRY|[11]|<init>()
09:28:59.725 (16725027792)|SYSTEM_CONSTRUCTOR_EXIT|[11]|<init>()
09:28:59.725 (16725036228)|SYSTEM_CONSTRUCTOR_ENTRY|[12]|<init>()
09:28:59.725 (16725039402)|SYSTEM_CONSTRUCTOR_EXIT|[12]|<init>()
09:28:59.725 (16725076379)|SYSTEM_METHOD_ENTRY|[76]|System.debug(ANY)
09:28:59.725 (16725093675)|USER_DEBUG|[76]|DEBUG|No Unsuscribe word found in the subject line.
09:28:59.725 (16725099499)|SYSTEM_METHOD_EXIT|[76]|System.debug(ANY)
09:28:59.725 (16725108978)|METHOD_EXIT|[149]|01pU0000000uhEc|unsubscribe.handleInboundEmail(Messaging.InboundEmail, Messaging.InboundEnvelope)
09:28:51.546 (16725133358)|CUMULATIVE_LIMIT_USAGE
09:28:51.546|LIMIT_USAGE_FOR_NS|(default)|
  Number of SOQL queries: 0 out of 100
  Number of query rows: 0 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 2 out of 150
  Number of DML rows: 2 out of 10000
  Number of code statements: 20 out of 200000
  Maximum CPU time: 0 out of 10000
  Maximum heap size: 0 out of 6000000
  Number of callouts: 0 out of 10
  Number of Email Invocations: 0 out of 10
  Number of fields describes: 0 out of 100
  Number of record type describes: 0 out of 100
  Number of child relationships describes: 0 out of 100
  Number of picklist describes: 0 out of 100
  Number of future calls: 0 out of 10

09:28:51.546|CUMULATIVE_LIMIT_USAGE_END

09:28:59.725 (16725166488)|CODE_UNIT_FINISHED|unsubscribe.testUnsubscribe2
09:28:59.725 (16725171193)|EXECUTION_FINISHED

 

Hi Guys,

 

 I want to create a pdf of my vf page ,

 

 we can create like this way

 

pdfPage = page.product_delivery;//new PageReference('/apex/product_delivery1');
pdfPage.getParameters().put('id',oppid);
pdfPage.setRedirect(false);
Blob b=pdfPage.getContentAsPDF();

 

In my vf i am displaying some records with checkbox. When i click on Selected Button , It is displaying Selected Records.

 

I want to Create PDF for Selected Records only.

 

But it is Generating PDF for my intial VF page.. 

 

 

please suggest me..

 

 

 

prem

So I have created this pop up when cases are logged as critical cases to remind the customer to call the hotline.

 

Problem 1 - I works fine in IE and Chrome, only thing in Chrome, you can't see the style sheet colors.  Anyone know how to remedy this?

 

Problem 2 & 3 - it doesn't show up when logged in as Partner and Customer portal users, works fine as myself (admin).  Is there any way to turn this "on" to portal users.  This is who really needs the reminder

 

Apex Page:

<apex:page standardController="Case" rendered="{!Case.Impact__c = 'Site Production Down'}" extensions="CW_alertMessage">

<script type="text/javascript">
{
    window.showModalDialog("{!urlRec}","dialogWidth:1200px; dialogHeight:200px; center:yes");
}

</script>


</apex:page>

 Apex Page with Alert Message:

<apex:page standardStylesheets="false" showHeader="false">

 <apex:stylesheet value="{!$Resource.mystyle}"/>
  <h1 class="myStyle">You have indicated that site operations is critically impaired.</h1>
  <p>Please contact <b>800-480-9830</b> to ensure Product Support is aware of your incident.
  <br><br>If site operations is not currently critically impaired, please adjust the value <br>in the <b>IMPACT</b> field to accurately reflect current site functionality</br></br></br></p>
  
</apex:page>

 Apex Class:

public with sharing class CW_alertMessage {

    public CW_alertMessage(ApexPages.StandardController controller) {

    }
public string geturlRec()
{
    string urlRec='https://caterpillar--cw.cs15.my.salesforce.com/apex/CW_AlertMessagePage';
    return urlRec;
}

}

 Static Resource:

body  {
   background-color: #236FBD;
}
 
.pbTitle {
    background-color: yellow;
}         
.myStyle {
    background-color: red; 
    
}  

 

  • November 21, 2013
  • Like
  • 0