• jjvdev
  • NEWBIE
  • 9 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 17
    Questions
  • 18
    Replies
How does one test loading an opportunity record page?

There is an action that fires when the opportunity page is loaded (via a visualforce page).  I know the controller extension and action work because its been proven via the UI.  Just not sure to how properly write a unit test to load the page, and thus trigger the action to run.
Why does this result in duplicate values for a single owner change event?
select Id, CreatedDate, Field, LeadId, NewValue, OldValue 
from LeadHistory
where (field = 'ownerAssignment' or field = 'Owner')
The lead history object has one record where the newvalue/oldvalue is the actual owner/ namequeue name, and then a duplicate record with the exact same CreatedDate time stamp that shows newvalue/oldvalue as the owner id/queue id.

What is going on here?  Why does lead history have 2 records for the exact same event?

User-added image
Need to rollback a process to a previous version.  After deactivating the most recent version, receiving this error when attempting to re-activate the original version.

"Unfortunately, there was a problem. Please try again. If the problem continues, contact Salesforce Customer Support with the error ID shown here and any other related details. Error ID: 158541872-10573 (1952119784)"

activation error

Submitted a case to Support, but find the community often does a better job answering these questions.
The line attempting to create the Set "ids" is throwing an error upon insert of a new lead.

Here is the error "System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, leadTrigger: execution of BeforeInsert     caused by: System.NullPointerException: Attempt to de-reference a null object". 

How do you get the Id for trigger.new?
 
trigger leadTrigger on Lead (before insert, after insert, after update) {
    Set<ID> ids = Trigger.newMap.keySet();  // getting error here
    List<Lead> triggerLeads = [SELECT Id, Email, LeadSource FROM Lead WHERE Id in :ids];
}

 
The code below runs successfully with no errors.  The test leads ownerid and the activeuser Id are exactly the same.

So explain this to me???

15:44:36.155 (9155332602)|USER_DEBUG|[9]|DEBUG|***** user data *****User:{IsActive=true, Id=00517000000GYztAAG}

15:44:36.499 (9499882380)|USER_DEBUG|[15]|DEBUG|***** lead owner active *****false

How is the same user active in one query, but inactive in another???



 
@isTest
private class UserIsActiveTest {

    static testMethod void myUnitTest() {
        
	// get active users
	  List<User> reps = new List<User> ([select Id, IsActive from User where IsActive = true]);
	  User activeuser = reps.get(0);
	  system.debug ('***** user data *****'+reps.get(0));
	  
	  // insert test lead and assign to active user
	  Lead testLead = new Lead(LastName='Test1', Company='Test1 Inc.', Email='test1@test.com', Description='Description', OwnerId=activeuser.Id);
	  insert testLead;
	  system.assertEquals(activeuser.Id, testLead.OwnerId);
	  system.debug ('***** lead owner active *****'+testLead.Owner.IsActive);
	  
    }

}

 
Greetings everyone,

I recently changed all my triggers to classes and then created a main trigger for each object that calls the classes for each respective object.

Anywho, my opportunity trigger calls quite a few classes. The issue is that if I don't add a recursion check, I can't deploy the trigger due to the SOQL query limit being broken. But if I do add the recursion check, only the Before triggers work. Not the After triggers.


Here is the trigger (with the recursion call up top):

trigger MainTriggerOpportunity on Opportunity (before insert, before update, after insert, after update) {
   
    if(checkRecursive.runOnce()){
   
    if(trigger.isBefore){
        if(trigger.isInsert){
            ClassOppIndustry updater = new ClassOppIndustry();
            updater.updateOppIndustry(trigger.new);
           
            ClassRenewalDate updater1 = new ClassRenewalDate();
            updater1.updateRenewalDate(trigger.new);
        }
        if(trigger.isUpdate){
            ClassOppIndustry updater = new ClassOppIndustry();
            updater.updateOppIndustry(trigger.new);
           
            ClassRenewalDate updater1 = new ClassRenewalDate();
            updater1.updateRenewalDate(trigger.new);
        }
    }
   
    if(trigger.isAfter){
        if(trigger.isInsert){
            ClassRenewalProcess updater = new ClassRenewalProcess();
            updater.updateRenewalStatus(Trigger.new);
           
            ClassOppBrandCreate updater1 = new ClassOppBrandCreate();
            updater1.addBrand(trigger.new);
        }
        if(trigger.isUpdate){
            ClassRenewalProcess updater = new ClassRenewalProcess();
            updater.updateRenewalStatus(Trigger.new);
           
            ClassOppBrandCreate updater1 = new ClassOppBrandCreate();
            updater1.addBrand(trigger.new);
           
            ClassChatterAlerts updater2 = new ClassChatterAlerts();
            updater2.addChatterAlert(Trigger.new,Trigger.oldMap);
        }
    }
}
   
}




Here is the recursion check class:

public Class checkRecursive{
   
    private static boolean run = true;
   
    public static boolean runOnce(){
       
    if(run){
     run=false;
     return true;  
    }
    else{
        return run;
    }
       
    }
}



Perhaps I have to allow the trigger to run twice? I'm a newb, so any help would be much appreciated!

Thanks,
Greg

I am very new to visualforce and apex, so I hope this is not a dumb question.  I am looking for a simple search where I can put a field on a visualforce page and a search box.  When the button is hit I want it to lookup leads for the last name using the input in the field.  I am just not even sure how to start with this. 

Hate it when this happens!!

 

Any ideas on how I can reduce Compiled Size is 5,960 - so only a little bit over!

 

IF(
AND(
Account_Manager_Assigned__c ="OK",
Accounts_Approval__c ="OK",
Final_Client_Approval__c ="OK",
Initial_Client_Approval__c ="OK",
QAT_Approval__c  ="OK",
QAT_Approval__c  ="OK",
Sales_Handover_Completed__c  ="OK",
Script_Build_Complete__c  ="OK",
Scriptor_Allocated__c  ="OK",
SID_Received__c  ="OK",
Skill_Level_Assigned__c  ="OK",
Trainer_Assigned__c  ="OK",
Training_Completed__c  ="OK",
UAT_Approval__c  ="OK",
Welcome_Call_Completed__c  ="OK"),
IMAGE("/img/msg_icons/confirm16.png","OK"),
IMAGE("/img/msg_icons/error16.png","Stop"))

 

Hey all,

 

trying to figure out if there is anywhere out there where someone has made a single pageBlockTable/dataTable (whatever) that combines multiple objects, and uses pagination.

 

Use case would be something like:

a single list of History type happenings that tracks: new files, new notes, maybe a change in field value here and there - all in one quick list rather that multiples...

 

Paginaiton would be great if I could use "standardSet Controler" ( http://www.salesforce.com/us/developer/docs/pages/Content/pages_custom_list_controller.htm )

Is it possible to write a trigger on OpportunityTeamMember object?

 

-Thanks

I have an external site being rendered through an <iframe>.  This external page has a login which I can login fine using Chrome and Firefox, but I can not login through the iframe in IE 7.  How can this problem be fixed without changing IE security settings?

 

 

<apex:tab label="MyExternalPage" name="ExternalPage" id="External">
  <iframe width="100%" height="800" scrolling="true" marginheight="100%" marginwidth="100%" escape="false"
  src="https://login.yahoo.com/config/login_verify2?&.src=ym">  <!--just an example not my actual page!-->
  </iframe>
</apex:tab>

 

Thanks

 

I have designed a VF page and using <iframe> tag to open an external site into the page itself. Purpose of embedding this iframe is to allow user to login into another website and view the external details in the same VF page. In Internet explorer, I can see the login screen but when I pass username/password, It does nothing and I can't login into external site. Same VF page is working perfect in Firefox and Chrome and I am able to login successfully and view external details.
Any help is appreciated.

 

I have designed a VF page and using <apex:iframe> tag to open an external site into the page itself. Purpose of embedding this iframe is to allow user to login into another website and view the external details in the same VF page. In Internet explorer, I can see the login screen but when I pass username/password, It does nothing and I can't login into external site. Same VF page is working perfect in Firefox and Chrome and I am able to login successfully and view external details.


Any help is appreciated.

I have an IF statement that needs to read

 

"New monthly rate going forward is $1,000.00"

 

My formula is

 

IF(ISBLANK( Custom_Description__c ),
"" ,
"New monthly rate going forward is" &""& Opportunity__r.Current_Monthly_Revenue__c)

 

but the Opportunity__r field is a currency field and the formula Error says "Incorrect parameter for function &(). Expected Text, received Number

 

Thank you in advance

Does bind parameters work when they appear in the "INCLUDES" clause of SOQL. Here's my observation

 

 
String userTypes='\'All\',\'Avon Leader\'';
String titleLevels='\'All\',\'4\'';
String SPLASHPAGE_TYPE='Splash Page';
System.debug('>>>>>>>>>>>>>>>userTypes='+userTypes);
System.debug('>>>>>>>>>>>>>>>titleLevels='+titleLevels);
List<Market_Content__c> mcList = [select        Type__c,Content_Type__c,Content__c, User_Type__c,
Title_Levels__c, Market__r.Name
from Market_Content__c
where Type__c='Splash Page'
and Market__r.Market_Id__c = 'RO'
and User_Type__c includes (:userTypes)
and Title_Levels__c includes (:titleLevels)
 order by CreatedDate];

 

This SOQL returns 0 rows. However the following SOQL returns 1 row:

 

List<Market_Content__c> mcList = [select       Type__c,Content_Type__c,Content__c, User_Type__c,                                                                                                                               Title_Levels__c, Market__r.Name                                                                         from Market_Content__c
where Type__c='Splash Page'
and Market__r.Market_Id__c = 'RO'
and User_Type__c includes ('All','Avon Leader')
and Title_Levels__c includes ('All','4')
order by CreatedDate];

 

What am I missing?

 

Hi guys,

 

Here is my situation, I want to query multi-select picklists in static soql, I have done this in dynamic soql, but in static soql, I don't know how to do it?

 

code snippet:

 

String categories = 'Featured, Super Featured';List<Product2> products = [select Category__c from Product2 where Category__c includes (:categories)];

 

In this way, I want to select all the products include Featured or Super Featured category, but I cannot get the right records.

 

But in this way, I got the right records.

 

List<Product2> products = [select Category__c from Product2 where Category__c includes ('Featured','Super Featured')];

Is there anyone can help me this problem? Thanks in advance!!

 

Thanks

 

Message Edited by Eriksson on 03-02-2010 12:50 AM
Message Edited by Eriksson on 03-02-2010 05:03 PM
Message Edited by Eriksson on 03-02-2010 05:04 PM
I get the following error message for my formula:
Error: Compiled formula is too big to execute (5,217 characters).
 
I've tried shortening the Field Labels as well as the Field Names.  I even tried making the field lengths shorter.
 
Nothing I've tried has changed the formula size.
 
Any other suggestions???