• Attack
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 3
    Replies

Hello folks,

I am facing a werid issue .. not sure if this is a limitation of Visualforce.

 

I wanted to change the font color of the header to my pageBlockTable. I used a CSS class and assigned it to the headerClass on the apex:column inside the pageBlockTable.

 

<style>
        .headerStyle{background-color:#638658;color:#FFFFFF}
</style>

 

<apex:pageBlockTable value="{!acc}">

  <apex:column headerValue="{!accTitle}" headerClass="headerStyle">

     <apex:outputLink value="/{!acc.account.Id}" target="_blank" styleClass="{!acc.style}">      

      {!acc.account.Name}

     </apex:outputLink>
  </apex:column>

</ apex:pageBlockTable>

 

 

The  background color of the header is getting applied but not the font color. But If I use a data table instead of a pageBlockTable,the font color gets applied. But I need to use pageBlockTable for business reasons.

 

Is this a limitation ? Any hints would be greatly appreciated !

 

 

 

 

Thanks.

  • March 03, 2009
  • Like
  • 0

Hello folks,

I have a requirement to word-wrap and display the column header names of a pageBlockTable. Any idea how to achieve this ? Thanks.

 

 

 

  • February 03, 2009
  • Like
  • 0

The method works via a "after insert" trigger but I receive the following error trying to "after update": 

 

Apex trigger autoLeadConvertTrigger caused an unexpected exception, contact your administrator: autoLeadConvertTrigger: execution of AfterUpdate caused by: System.DmlException: ConvertLead failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, autoLeadConvertTrigger: execution of AfterUpdate caused by: System.DmlException: ConvertLead failed. First exception on row 0; first error: CANNOT_UPDATE_CONVERTED_LEAD, cannot reference converted lead Class.autoLeadConvert.ConvertLead: line 100, column 3 Trigger.autoLeadConvertTrigger: line 14, column 7: Class.autoLeadConvert.ConvertLead: line 100, column 3

 

The main note of importance is the "CANNOT_UPDATE_CONVERTED_LEAD" error. The reason I'm doing an after update instead of after insert is to be able to have the workflow / auto-response rules run before conversion. (workflow / auto-response rules execute after triggers). 

 

What I don't understand is why this is not working for the "after update" trigger. The error appears to be coming from the leadConvert method trying to update the convert lead record fields such as: setContactId, etc.  This doesn't seem to make sense though as to why it would work in the 'after insert' trigger. 

 

Here is the basics of my code:

 

public static void ConvertLead(lead[] leads){

 

for (lead l : leads){

 

account Account = new account();

contact Contact = new contact();

 

//convert lead

converter.setLeadId(l.id);

converter.setContactId(contact.id);

converter.setAccountId(account.id);

converter.setOwnerId(l.OwnerId);

LeadStatus convertStatus = [Select Id, MasterLabel from LeadStatus where IsConverted=true limit 1]; converter.setConvertedStatus(convertStatus.MasterLabel);

converter.setDoNotCreateOpportunity(true);

Database.ConvertLead(converter);

 

The apex documentation states the following in regards to considerations for trigger context variables:

 

Can update original object using an update DML operation: 

 

Trigger Event: After Insert 

"Allowed"  

 

Trigger Event: After Update

"Allowed. Even though a bad script could cause an infinite recursion doing this incorrectly, the error would be found by the governor limits." 

 

I know I'm not running governor limits so I'm a missing something or is this a SF bug?

 

Thanks ahead of time! 

 

 

Message Edited by IC-Tanner on 02-25-2009 12:33 PM

Hello folks,

I have a requirement to word-wrap and display the column header names of a pageBlockTable. Any idea how to achieve this ? Thanks.

 

 

 

  • February 03, 2009
  • Like
  • 0