• SteveMTC
  • NEWBIE
  • 25 Points
  • Member since 2009

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

I'm using tabbed VF pages quite a bit and added in the <style> tag for inline CSS as per the cook book example and it worked great. What I tried to do next is to move the styles to an external style sheet. Unfortunately the cook book doesn't explain what to me is the next obvious requirement (a future improvement in the documentation perhaps?). The style sheet tag seems to be ignored. Can anyone suggest what I'm doing wrong? Below is the source for test objects to try things out.

 

I imported the style sheet as a Static resource file (Style2.css):

 

@charset "ISO-8859-1";

 

.activeTab {background-color: #236FBD; color:white;

            background-image:none}

            

inactiveTab {background-color: lightgrey;

             color:black;

             background-image:none}

 

Page:

 

<apex:page standardController="test_object_A__c" extensions="TestObjectExtension" showHeader="true" tabStyle="test_object_A__c"> <apex:stylesheet value="!$Resource.Style2}"/> <apex:tabPanel switchType="client" selectedTab="tabTestObjectDetails" id="ObjectTabPanel" tabClass="activeTab" inactiveTabClass="inactiveTab" value="{!TabInFocus}"> <apex:tab label="Object A" name="Test_object_A__c" id="tabTestObjectDetails"> <apex:detail relatedList="false" title="true"/> </apex:tab> <apex:tab label="Object B" name="Test_Object_B__r" id="tabObjectB"> <apex:relatedList subject="{!test_object_A__c}" list="Test_Object_B__r"/> </apex:tab> <apex:tab label="Object C" name="Test_Object_C__r" id="tabObjectC"> <apex:relatedList subject="{!test_object_A__c}" list="Test_Object_C__r"/> </apex:tab> <apex:tab label="Approvals" name="ProcessSteps" id="tabApproval"> <apex:relatedList subject="{!test_object_A__c}" list="ProcessSteps"/> </apex:tab> </apex:tabPanel> 

</apex:page> 

  • November 23, 2009
  • Like
  • 0

Hi All

 

I have a lookup inputField on a vf page and want an operation to run after the user selects a value. To do this I have added an actionFunction that calls the controller operation and this is referenced on the onblur and onmouseout attributes of the inputField as onchange does not work for lookup fields. This works fine on the page load (i.e. I can see requests being sent to the server when the onblur and onmouseout events occurs), but once I've opened the lookup pop up to select a record, the events stop happening, even on different elements.

 

Can anyone shed some light on why this is happening, or offer a better solution for running an operation after a user selects a record in a lookup field?

 

Thanks

 

Steve

Hi

 

I have a custom setting that contains the id of a custom field, so it can be referenced by some Apex to include as a url parameter. What's really strange is that I enter the id of the field (e.g. 00N200000025vSO) in the Name field of the custom setting, then pull this out in the apex and add '&' + fieldId + '=' + fieldvalue to a url for a pagereference, at which point I find that the value has changed to 00N200000025vSOMAA, which is actually the full correct 18-digit id for the field. This is incredibly annoying as it seems salesforce won't then pass the parameter to the field when these extra characters are included.

 

I know passing url parameters to non-standard fields is not a salesforce supported method, but the problem is coming from when I retrieve the value from the custom setting - if I query the value in the eclipse IDE, it's correct, but when I retrieve it in the Apex code, it automatically changes?!

 

Does anybody know what is going on or any way round it?

 

Thanks

 

Steve

Hi

 

I am having a bit of a strange problem with the database behaviour at the moment:

 

I have a site where a user can enter info to create one or more records for a custom object (called Applications). These can vary in number and type depending on what the user selects, and are all children of a single parent record, Application Request.

 

Once the user submits the info they are taken to a review page where if they want to change the data before final submission, they can go back to the original page and change anything entered. This works by passing a parameter through the url that indicates whether an edit or creation is taking place, and if it is an edit, the controller queries all applications relating to the application request and presents that information. When they go to submit this edited information the controller deletes the original applications and recreates new ones (even if nothing changes - just seems safer that way).

 

This works fine on a database level, but I am encountering problems when a user goes back to edit an application and for some reason the query to retrieve the related applications either retrieves old records that were deleted when the new info was submitted or doesn't retrieve records that were created. I can see the correct records by querying them through the IDE, but they just don't seem to be appearing when the controller queries the system. I am using the database.query method as I need to query all the fields of the object (to reduce redevelopment when more fields are added in the future) - could this be causing it?

 

This only happens sporadically, and if I refresh the page then it seems to 'catch up' and I can show variables that show the expected query results. The problem is that the part of the page where the user selects the type and amount of records created is a few radioSelects, which on refresh keep the same values rather than be populated by the query results.

 

This seems very bug like to me, but it could just be database.query or database.delete behaviour I don't know about?

 

Has anyone experienced anything like this before? I would show the code but I think it would complicate things even more....

Hi

 

I have a custom setting that contains the id of a custom field, so it can be referenced by some Apex to include as a url parameter. What's really strange is that I enter the id of the field (e.g. 00N200000025vSO) in the Name field of the custom setting, then pull this out in the apex and add '&' + fieldId + '=' + fieldvalue to a url for a pagereference, at which point I find that the value has changed to 00N200000025vSOMAA, which is actually the full correct 18-digit id for the field. This is incredibly annoying as it seems salesforce won't then pass the parameter to the field when these extra characters are included.

 

I know passing url parameters to non-standard fields is not a salesforce supported method, but the problem is coming from when I retrieve the value from the custom setting - if I query the value in the eclipse IDE, it's correct, but when I retrieve it in the Apex code, it automatically changes?!

 

Does anybody know what is going on or any way round it?

 

Thanks

 

Steve

I have a custom object that stores Marketing Activity.  It can be associated with either a Lead or a Contact.  When a lead that has associated object is converted I would like to update the custom record to reflect the new ContactId so that the activity will be preserved in the related list. 

 

Does anybody have any pointers on how to do this?

 

Thanks,

Phil

I'm using tabbed VF pages quite a bit and added in the <style> tag for inline CSS as per the cook book example and it worked great. What I tried to do next is to move the styles to an external style sheet. Unfortunately the cook book doesn't explain what to me is the next obvious requirement (a future improvement in the documentation perhaps?). The style sheet tag seems to be ignored. Can anyone suggest what I'm doing wrong? Below is the source for test objects to try things out.

 

I imported the style sheet as a Static resource file (Style2.css):

 

@charset "ISO-8859-1";

 

.activeTab {background-color: #236FBD; color:white;

            background-image:none}

            

inactiveTab {background-color: lightgrey;

             color:black;

             background-image:none}

 

Page:

 

<apex:page standardController="test_object_A__c" extensions="TestObjectExtension" showHeader="true" tabStyle="test_object_A__c"> <apex:stylesheet value="!$Resource.Style2}"/> <apex:tabPanel switchType="client" selectedTab="tabTestObjectDetails" id="ObjectTabPanel" tabClass="activeTab" inactiveTabClass="inactiveTab" value="{!TabInFocus}"> <apex:tab label="Object A" name="Test_object_A__c" id="tabTestObjectDetails"> <apex:detail relatedList="false" title="true"/> </apex:tab> <apex:tab label="Object B" name="Test_Object_B__r" id="tabObjectB"> <apex:relatedList subject="{!test_object_A__c}" list="Test_Object_B__r"/> </apex:tab> <apex:tab label="Object C" name="Test_Object_C__r" id="tabObjectC"> <apex:relatedList subject="{!test_object_A__c}" list="Test_Object_C__r"/> </apex:tab> <apex:tab label="Approvals" name="ProcessSteps" id="tabApproval"> <apex:relatedList subject="{!test_object_A__c}" list="ProcessSteps"/> </apex:tab> </apex:tabPanel> 

</apex:page> 

  • November 23, 2009
  • Like
  • 0

Hi All,

I’m hoping someone can assist with an error that I’m getting. My requirements are the following:

·         I have a field named TAB_Lead_Owner on my lead records. When this field is changed, it needs to be updated to a field of the same name in all open activities for this lead. This is done in a trigger named Update_Tab_Owner_Lead.

·         I also have some custom task fields. When these fields are set to certain values on a task record, they update the Lead Status value on their associated lead record. This is done in a trigger named Update_Tab_Owner_Task.

I’m running into a recursion error. I receive the following error message: First exception on row 0 with id 00T800000119bodEAA; first error: SELF_REFERENCE_FROM_TRIGGER, Object (id = 00T800000119bod) is currently in trigger Update_Tab_Owner_Task, therefore it cannot recursively update itself. I think I understand why this error is occurring. Does anyone know a way around it, to prevent bi-directional triggers on records in related lists, from causing this recursion error?  Here is the source for Update_Tab_Owner_Lead: trigger Update_Tab_Owner_Lead on Lead (after update){
        
    if(Trigger.isUpdate){
        if(Trigger.isAfter){
            //if (Trigger.old.size()==1){   
            
                Set<Id> LId = new Set<Id>();
                List<Task> updTask = new List<Task>();
                List<Event> updEvent = new List<Event>();
                
                Set<Id> TaskIds = new Set<Id>();
                Set<Id> EventIds = new Set<Id>();
                                  
                for(Lead oLead : Trigger.new){
                    if(!LId.contains(oLead.Id)){
                        LId.add(oLead.Id);
                    }                
                }
                if(LId!=null&&LId.size()>0){
                
                    //Get Existing Tasks
                    List<Task> exTask =[select Id,TAB_Lead_Owner__c from Task where WhoId in :LId and status != 'Completed'];
                    
                    //Get Existing Events
                    List<Event> exEvent =[select Id,TAB_Lead_Owner__c from Event where WhoId in :LId and EndDateTime>:datetime.now() ];
                    
                    //Loop through all leads in the batch
                    for(Lead oLead : Trigger.new){
                       
                        for(Task tmpTask:exTask){ CODE TO UPDATE TAB_LEAD_OWNER FIELD}
                                                    
                        for(Event tmpEvent:exEvent){ CODE TO UPDATE TAB_LEAD_OWNER FIELD}                         
                    }
                }
                if(updTask.size()>0){
                    update updTask;
                }
                if(updEvent.size()>0){
                    update updEvent;
                }
        }
    }    
}
 

 

Here is the source for Update_Tab_Owner_Task: 

 

trigger Update_Tab_Owner_Task on Task (before update){
    List<Id> whoIds = new List<Id>();
    for(Task oTask : Trigger.new){
        whoIds.add(oTask.WhoId);   
    }

list<Task> lTask = new list<Task>();
    List<lead> leadUpdate = new List<lead>();
    Map<Id,Lead> leadMap = new Map<Id,Lead>();

    for(Lead tmpLead:[select Id,TAB_Lead_Owner__c,Status,Notes__c from lead where Id in:whoIds]){
        leadMap.put(tmpLead.Id,tmpLead);
    }

    for(Task oTask : Trigger.new){
        //Update the Lead if the Prospect Contact=true
        if(leadMap.containsKey(oTask.WhoId)){
            Lead tmpLead = leadMap.Get(oTask.WhoId);
               if(test){
                CODE TO UPDATE TMPLEAD FIELDS

                    leadUpdate.add(tmpLead);
            }           }
    
        if(leadUpdate.size()==100)
        {
             update leadUpdate ;
             leadUpdate.clear();
       }
    }

    if(leadUpdate.size()>0)
    {
         update leadUpdate ;
   }
}
 

Thanks for any help on this! Dave

Hi

 

I am having a bit of a strange problem with the database behaviour at the moment:

 

I have a site where a user can enter info to create one or more records for a custom object (called Applications). These can vary in number and type depending on what the user selects, and are all children of a single parent record, Application Request.

 

Once the user submits the info they are taken to a review page where if they want to change the data before final submission, they can go back to the original page and change anything entered. This works by passing a parameter through the url that indicates whether an edit or creation is taking place, and if it is an edit, the controller queries all applications relating to the application request and presents that information. When they go to submit this edited information the controller deletes the original applications and recreates new ones (even if nothing changes - just seems safer that way).

 

This works fine on a database level, but I am encountering problems when a user goes back to edit an application and for some reason the query to retrieve the related applications either retrieves old records that were deleted when the new info was submitted or doesn't retrieve records that were created. I can see the correct records by querying them through the IDE, but they just don't seem to be appearing when the controller queries the system. I am using the database.query method as I need to query all the fields of the object (to reduce redevelopment when more fields are added in the future) - could this be causing it?

 

This only happens sporadically, and if I refresh the page then it seems to 'catch up' and I can show variables that show the expected query results. The problem is that the part of the page where the user selects the type and amount of records created is a few radioSelects, which on refresh keep the same values rather than be populated by the query results.

 

This seems very bug like to me, but it could just be database.query or database.delete behaviour I don't know about?

 

Has anyone experienced anything like this before? I would show the code but I think it would complicate things even more....

How do I pass an account id into filter field on a custom report via a link on the account record?

 

Want to create a generic report that I can run directly from any account record page.  Is it possible to click the link, have the account id passed into the report filter criteria field then run report?

 

Help is appreciated.