• apap
  • NEWBIE
  • 0 Points
  • Member since 2011

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

I have win 7 and eclipse 3.6(Helios) in my machine.I installed Force.com ide plugin but I am unable to download data from SFDC to eclipse 3.6.

What might be the problem.

  • August 27, 2011
  • Like
  • 0

Hi,

 

I am having two custom objects ,there is no direct relationship between them.I need to iterate  through 3 objects.

 

Is there anyway i can display on same  section on result page  when we perform search

 

Thanks in advance

  • February 16, 2012
  • Like
  • 0

Hi All,

 

I'm slowly understanding the apex code but the testmethods are still outwitting me.

 

I created the below custom controller which loads a custom New Task Page prepopulated from a Custom Object so the User can submit the task without having to fill in the details.

 

This works great, however, I can't figure out the testmethod.  As far as I understand I need to create the data, create the task and confirm the task was created.

 

So as you can see in my Test Method I have created two contact records and associated them with a new custom object record.  I've then created the Task and checked it's inserted.  However none of the test method works and it shows as 0% Coverage.

Any help or guidance would be really appreciated as I'm starting to go mad!!

Kev 

 

 

static testmethod void testCustomReferralTaskController() {
    Test.startTest();
    	//Create Referrer
    	VistageTestData data = new VistageTestData();
    	Account[] testAccounts = data.gimmeAccounts(2);
    	Contact testContact = data.gimmeContacts(testAccounts)[0];
    	Contact testContactDetails = [SELECT Id, FirstName, LastName, Staff__c FROM Contact WHERE Id = :testContact.Id];
    	testContactDetails.Staff__c = true;
    	update testContactDetails;
    
	//Create Referral
	VistageTestData data2 = new VistageTestData();
	Account[] testAccounts2 = data2.gimmeAccounts(2);
	Contact testContact2 = data2.gimmeContacts(testAccounts)[0];
	Contact testContactDetails2 = [SELECT Id, FirstName, LastName, Staff__c FROM Contact WHERE Id = :testContact.Id];
	testContactDetails2.Member__c = true;
	update testContactDetails2;    
    
	Referral__c Referral = new Referral__c(
        Referrer__c = testContactDetails.Id,
        Contact_Referral_Name__c = testContactDetails2.Id
		);
        insert Referral;
            
	Task testTask = new Task (
		WhoId = testContactDetails2.Id,
		WhatId = Referral.Id,
		Subject = 'Referral Validation',
		ActivityDate = date.today() + 7,
		ReminderDateTime = datetime.now() + 7,
		Description = 'Please Validate the Referral');
	insert testTask; 
    
   	Task t = [Select Id, whoid from Task where WhatId = :Referral.Id Limit 1];
   	system.assertEquals(t.whoid,testContactDetails2.Id);
   	Test.stopTest();
} 

 

 

I made a button to disable scheduled apex jobs, and I want to show a confirmation once completed.  I also want that button to disappear once completed as it serves no purpose if there aren't any active jobs.


I can't make both of these work at the same time though :(  Any tips?

 

VF Page:

 

<apex:page controller="c" >
  <apex:pagemessages />


    <apex:form >
        <apex:pageBlock id="thePageBlock"  >
            <apex:pageBlockButtons >
                <apex:commandButton id="disableButton" value="Disable Integration" rendered="{!schedulersActive}" action="{!deactivateScheduler}">
	                <apex:actionSupport event="oncomplete" action="{!renderButtons}"/>
	                <apex:actionSupport event="oncomplete" rerender="disableButton"/> 
                </apex:commandButton>
            </apex:pageBlockButtons>    
        </apex:pageBlock>
    </apex:form>
</apex:page>

 

Controller methods:

public class c{

    public Boolean schedulersActive { get; set; }

    public c(){
        renderButtons();
    }//method c

	public static void deactivateScheduler(){
		myUtils.deactivateScheduler();
        ApexPages.Message confirmation=new ApexPages.Message(ApexPages.severity.CONFIRM, 'Confirmed: The daily synchronization has been deactivated.');
        ApexPages.addmessage(confirmation);
	}//deactivateScheduler
    
    public void renderButtons(){
        List<CronTrigger> cts=myUtils.getCronTriggers();
        //If there isn't a result here, that means the scheduler hasn't been started
        if (cts.size()==myUtils.numScheduledJobs){
            schedulersActive = TRUE;
        } else {
//            system.debug('ct.CronExpression= '+ct[0].CronExpression);
            schedulersActive = FALSE;
        }//if 1
        system.debug('The number of cron jobs active is: '+cts.size()+' and the value of SchedulersActive is:'+schedulersActive);
    }//renderScheduler
	

}//class c

 

Hi folks,

 

 

I have created one aprooval process and i have activated it for testing purpose but aprooval process was wrong so i have inactive that process and created new one. Now when i am trying to delete the old one i am not able to do so.

 

I am getting error given below :-

 

Cannot Modify Active/Once Active Approval Process Definition Once an approval process has been activated, you cannot add or remove steps. Please create a new approval process from this one for modification. You may only delete an approval process that has no data records associated with it.

Click here to return to the previous page.       

 

Please help me in this matter.

 

Thanks,

Minkesh Patel

 I tried to create a before trigger, before update trigger on event that would fetch a field from prospect/contact according to the whoid specified .

But when inserting recurring events through bulk . I get the following error:-

 

"UnexpectedException: Apex Event trigger cannot handle batch operations on recurring events."

 

 

Is there any way to avoid this error ?

I have win 7 and eclipse 3.6(Helios) in my machine.I installed Force.com ide plugin but I am unable to download data from SFDC to eclipse 3.6.

What might be the problem.

  • August 27, 2011
  • Like
  • 0