• viktorV
  • NEWBIE
  • 75 Points
  • Member since 2010

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

Hi,

 

I'd like to create a custom master-detail field like the WhoId field on Activities.

Now I can only create master-detail field for Contacts, but nut a combined field for Leads and therefrom converted Contacts in just one entry.

 

Is it possible?

 

Thank you,

Viktor 

Hi,

 

I've created a one-time scheduled apex, which sends out an email 5 days after a value changes on a custom object.

I get the next error:

System.AsyncException: Based on configured schedule, the given trigger will never fire.

 

My code is the next for scheduler:

 

Datetime plus5 = Datetime.now().addDays(5);
String sched = plus5.second()+' '+plus5.minute()+' '+plus5.hour()+' '+plus5.day()+' '+plus5.month()+' ? '+plus5.year();

schClass sch = new schClass();
System.schedule('Sending follow up mail',sched,sch);

What is the problem?

 

Thank you,

Viktor 

 

Hi,

Is there any way to give delete acces with a sharing rule?? Sales team's data adminiastrators should have it (even for merging records) but I DON'T WANT to give them "modify all" permission.

I've tried to write some APEX but it seems there's NO solution for my problem.

I cannot make a sharing rule for records with "all" access level. I even cannot write the ContactId field so I'm not sure I'm able to create any kind of sharing rule for each records with APEX.

My other idea was to change the owner before merge actions. Btu the problem is that the examination of user access runs before the before triggers. So this is  also not possible...

Can I do anything or this is a big defect of salesforce???

Thanks,
viktor

Hi,

 

I'd like decide in a trigger, if the current action (insert, update, etc) is performed by using force.com api or by the normal web gui.

 

Thank you,

Viktor

Hi,

 

I know I can get deleted records with queryAll() using API.

But I recognised that queryAll() gives all deleted records even if the recycle bin is empty.

Is there any limit, till I can get back totally deleted (deleted from recycle bin as well) records?

 

Thank you,

Viktor

I'm creating a trigger in which I'd like to check some Opportunity details. I tried

 

for(Event e: trigger.new){
  if(e.What.CloseDate == ...){
    
  }
}

 but it gives Invalid field CloseDate for SObject Name error.

Is there a way to get these details? I don't want to use SOQL,

 

Thank you,

Viktor

 

I'd like to create a before insert trigger for contacts, which copies some details from the referenced account. My problem is, that I can get the AccountId, but the Account.field values are null.

An example code:

 

trigger account_details  on Contact (before insert) {
 for(Contact t: trigger.new){
  t.Custom_detail__c = t.Account.Custom_detail_on Account__c;
 }
}

Contact custom detail will be null, even it has value on referenced Account.

Is there a kind of simple solution or I should get the Account details with SOQL?

 

Thank you,

Viktor

 

 

Hi,

 

I have a custom object, related to Contacts (lookup relationship, cannot use master-details because different reasons).

 

I'd like to handle delete and merge functions: when user deletes a contact, related custom object should be deleted as well ->

I've created a before delete trigger on contacts, worked well. (cannot use after delete, because contact reference disappears from custom object on delete)

 

I'd like to handle merge as well, so I need an if(triggerContact.MasterRecordId == null) expression for my delete trigger (so the merge could be done), but the problem is that MasterRecordId field is just getting value after delete, not before.

 

How could I solve this anomaly??

I'd appreciate any kind of idea..

Thank you,

Viktor

Is there any way to create an API script which could download the schedule created DataExport zip file?

I'm thinking about getting the ID of the last (actual) zip file and just paste it into corresponding url..

 

Any ideas to do this?

 

Thanks,

Viktor

Hi,

I'd like to create a query, but always get malformed query error: Didn't understand relationship Activity__c.Lead__r in FROm part of query call

Activity is a custom object, with a foregn key to Leads.

 

 

SELECT 
Activity__c.Name, 
Activity__c.Id, 
Activity__c.Lead__c, 
(SELECT Lead__r.Status, Lead__r.CreatedDate, Lead__r.OwnerId, Lead__r.Country__r FROM Activity__c.Lead__r) 
FROM 
Activity__c 
WHERE 
 Name = 'xxx'

 

 

What would be the right syntax?

 

Thank you,

Viktor

Hi,

I've got a php import script, which moves data from webserver to salesforce.

Some data needs assignment rules during import and some not.

I have only one client for the whole script

 

$sf = new SforceEnterpriseClient();

 and I enable my default assignment rule

 

$useAssignmentRule = new AssignmentRuleHeader(null , true);
$sf->setAssignmentRuleHeader($useAssignmentRule);

 for an import function.

 

I'd like to know, what happens after setting the assignment rule. Is it valid for the whole script lifetime?

I thought, it doesn't but seems it does..

I recognized, that some other following import functions use the assignment rule as well and I don't need that. I just need enabled rule for some exceptional import cases.

How can I disable the assignment rule after the success exceptional import?

 

Thanks,

Viktor

 

 

 

I'd like to create an automated, scheduled mass email sending method. I cannot use orgWideEmailAddresses for Mass mails (please promote this idea: http://sites.force.com/answers/ideaView?c=09a30000000D9y3&id=08730000000BqBoAAK ) and the limit of 10 single email sending method is not enough.

The From header is filled with the method calling user, so I'd like to set the method calling user for apex classes.

How can I do that?

(could it work if I submit the job scheduling with the given user?)

 

thanks,

Viktor

 

  • September 29, 2010
  • Like
  • 0

I'd like to create a scheduled mass email sending automatism.

My code is:

 

List<Lead> newLeads= [SELECT Id FROM Lead WHERE ... ];
List<Id> toAddresses = new List<Id>();
for (Lead l: newLeads){
     	toAddresses.add(l.Id);
}
Messaging.MassEmailMessage welcomeMail = new Messaging.MassEmailMessage();
welcomeMail_Italy.setTargetObjectIds(toAddresses);
welcomeMail_Italy.setTemplateId(' ... ');
welcomeMail_Italy.setReplyTo(' ... ');
welcomeMail_Italy.setSenderDisplayName(' ... ');

Messaging.sendEmail(new Messaging.MassEmailMessage[] { welcomeMail });

 I get the next error for the last line:

System.EmailException: SendEmail failed. First exception on row 0; first error: INVALID_CROSS_REFERENCE_KEY, invalid cross reference id: []

 

Can you help me pls?

 

Thanks

V

 

  • September 24, 2010
  • Like
  • 0

I know, write a query but the governor limit is 1000 row...

Is there another way to get the task number (and the OwnerId too..needed for further logic)

 

thanks,

Viktor

  • September 14, 2010
  • Like
  • 0

Just a short question:

I have a trigger based on connection forwarded records.  I'd like to create a test class to hold code coverage. I have some active connections in the production system on I can write the test methods

 

I want to be sure that I won't forward the test Lead in test method, when I create a PartnerNetworkRecordConnection with an active connections Id in the test method. 

 

Thanks,

Viktor

 

  • September 10, 2010
  • Like
  • 0

I've got a lead detail page button which opens a VF page with most important lead details. Clicking on Send on VF page runs my class which sends out the email the given address.

The class works right, but I'm newbie and cannot create the test method.

VF code:

 

<apex:page standardController="Lead" extensions="sendLeadInEmail" title="Send Lead in Email">
 <apex:form >
     <apex:sectionHeader title="Send Lead in email to a specified person"/>
     <apex:pageBlock mode="edit" >
         <apex:messages />
         <apex:pageBlockSection title="Lead details">
                <apex:pageBlockTable value="{!lead}" var="lead">
                    <apex:column value="{!lead.Name}"></apex:column>
                    <apex:column value="{!lead.Company}"></apex:column>
                    <apex:column value="{!lead.Title}"></apex:column>
                    <apex:column value="{!lead.Phone}"></apex:column>
                    <apex:column value="{!lead.Email}"></apex:column>
                    <apex:column value="{!lead.Street}"></apex:column>
                    <apex:column value="{!lead.City}"></apex:column>
                    <apex:column value="{!lead.State}"></apex:column>
                    <apex:column value="{!lead.PostalCode}"></apex:column>
                    <apex:column value="{!lead.Country}"></apex:column>
                    <apex:column value="{!lead.Website}"></apex:column>
                    <apex:column value="{!lead.Product__c}"></apex:column>
                    <apex:column value="{!lead.CreatedDate}"></apex:column>
               </apex:pageBlockTable>
         </apex:pageblockSection>
         <apex:pageblockSection title="Name of Recipient">
                <apex:inputText value="{!recipient}" id="Recipient" maxlength="80" required="true" />
         </apex:pageBlockSection>
         <apex:pageblockSection title="Email address">
                <apex:inputText value="{!address}" id="Address" maxlength="80" required="true"/>
         </apex:pageBlockSection>
         <apex:pageBlockSection title="Personal message (optional)"  >
                <apex:inputTextarea value="{!comment}" id="Comment" required="false" cols="75" rows="6"/>
         </apex:pageBlockSection>
         <apex:pageBlockButtons location="bottom">
                <apex:commandButton value="Send Email" action="{!send}" />                        
                <apex:commandButton value="Cancel" action="{!cancel}"/>
         </apex:pageBlockButtons>
    </apex:pageBlock>    
  </apex:form>
</apex:page>

APEX Class code:

 

public class sendLeadInEmail {
 
	public String recipient{ get; set; }
	public String address { get; set; }
 	public String comment { get; set; }
 	public String plainPersonalMessage;
 	public String htmlPersonalMessage;
 	public String subject;
 	public String plainTextBody;
 	public String htmlBody;
 	public String Title, Phone, EmailAddress, Street, City, State, PostalCode, Country, Website, Product;
 
	private final Lead lead;
 
 	// Create a constructor that populates the Lead object
	public sendLeadInEmail(ApexPages.StandardController controller) {
  		lead = [select Name, Company, Title, Phone, Email, Street, City, State, PostalCode, Country, Website, Product__c, CreatedDate, Sent_in_Email_to__c
    			from Lead where id = :ApexPages.currentPage().getParameters().get('id')];
 	}
  
	 
 	public PageReference send() {
  		// Define the email
  		Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
 		   
  		subject = 'Lead details';
	
  		if (lead.Title == null) Title = ''; else Title = lead.Title;
  		if (lead.Phone == null) Phone = ''; else Phone = lead.Phone;
  		if (lead.Email == null) EmailAddress = ''; else EmailAddress = lead.Email;
  		if (lead.Street == null) Street = ''; else Street = lead.Street;
  		if (lead.City == null) City = ''; else City = lead.City+',';
  		if (lead.State == null) State = ''; else State = lead.State;
  		if (lead.PostalCode == null) PostalCode = ''; else PostalCode = lead.PostalCode;
  		if (lead.Country == null) Country = ''; else Country = lead.Country;
  		if (lead.Website == null) Website = ''; else Website = lead.Website;
  		if (lead.Product__c == null) Product = ''; else Product = lead.Product__c;
 
	  	plainPersonalMessage = comment;
  		htmlPersonalMessage = comment;
 
 	 	if (plainPersonalMessage != '') plainPersonalMessage = comment + '\n\n';
  		if (htmlPersonalMessage != '') htmlPersonalMessage = '<pre><font face="times,times new roman,liberation sans,liberation serif,helvetica,arial,sans,serif" size="4">' + comment + '</font></pre><br>';
  
  		plainTextBody = 'Dear '
  			+ recipient + ',\n\n' + plainPersonalMessage + /* ... */ + 'Best regards,';
  
    	htmlBody = '<font face="times,times new roman,liberation sans,liberation serif,helvetica,arial,sans,serif" size="4">Dear ' + recipient + ',<br><br>' +
  	 		htmlPersonalMessage + /* ... */ + 'Best regards,</font>';
  
		String[] toAddresses = address.split(',',0);          
  		String bccAddress = /* ... */;
  		String[] bccAddresses = bccAddress.split(',',0);  
		
  		// Sets the paramaters of the email
 		email.setSubject( subject );
  		email.setToAddresses( toAddresses );
  		email.setPlainTextBody( plainTextBody );
  		email.setHtmlBody( htmlBody );
	  
	  	// Sends the email
  		Messaging.SendEmailResult [] r = Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});
		
		//set the 'Sent in Email to' field on related Lead:
  		if (lead.Sent_in_Email_to__c == null) lead.Sent_in_Email_to__c = recipient + ' (' + address + ')';
  		else lead.Sent_in_Email_to__c += ', ' + recipient + ' (' + address + ')';
  		update lead;

		// After email sent, navigate to the default view page:
  		return (new ApexPages.StandardController(lead)).view();

	}
	  			

 	static testMethod void myTest() {
       	Lead l = new Lead(
       		FirstName = 'testFirst',
       		LastName = 'testLast',
       		Company ='testcompany',
       		Title = 'testTitle',
       		Phone = '1234',
       		Email = 'test@email.com',
       		Street = 'testStreet',
       		City = 'testCity',
       		State = 'testState',
       		PostalCode = 'testPostal',
       		Country = 'testCountry',
       		Website = 'testWebsite',
       		Product__c = 'testProduct');
		insert l;
		
		Lead testL = [SELECT Id FROM Lead WHERE FirstName = 'testFirst'];
		PageReference leadPage = new PageReference('partialURL');
 		Test.setCurrentPage(leadPage);
		ApexPages.currentPage().getParameters().put('id',testL.Id);
		
		Id testID = ApexPages.currentPage().getParameters().get('id');
		System.assertEquals(testID,testL.Id);
		

		// Instantiate String_function controller
   		ApexPages.StandardController s = new ApexPages.standardController(testL);
   		sendLeadInEmail testSend = new sendLeadInEmail(s);
   		testSend.send();
        
 	}

}

 running the testSend.send(); line gives the next error:

System.NullPointerException: Attempt to de-reference a null object.

 

Where should I set to test the appropriate object?

 

thanks,

Viktor

 

 

  • September 02, 2010
  • Like
  • 0

I'd like to use Eclipse + Force.com IDE for creating my apex codes, but I get this error when IDE's trying to connect to the sandboy/production environment.

 

How can I solve this problem?

thanks

I had an APEX class which sends out a specified email to the given address with some lead details, then updates the lead.

I've completed the class with a simple function, it inserts a completed task  assigned to the lead.

The class works fine in Sandbox but deployment is failed. In the result I get the next failures: all my active triggers are listed with problem: "Test coverage of selected Apex Trigger is 0%, at least 1% test coverage is required"

 

What's wrong?

 

Thanks for the answers!

I don't understand how this limit works. I have three active triggers (all on tasks), all contains some queries.

I'd like to create some new triggers on opportunities and lineItems but no matters how simple my code is, I always get the query limit error.

What could I make wrong? My triggers doesn't come from any other trigger, so the queries cannot sum up

 

thanks for the answers

Hi,

 

I've created a one-time scheduled apex, which sends out an email 5 days after a value changes on a custom object.

I get the next error:

System.AsyncException: Based on configured schedule, the given trigger will never fire.

 

My code is the next for scheduler:

 

Datetime plus5 = Datetime.now().addDays(5);
String sched = plus5.second()+' '+plus5.minute()+' '+plus5.hour()+' '+plus5.day()+' '+plus5.month()+' ? '+plus5.year();

schClass sch = new schClass();
System.schedule('Sending follow up mail',sched,sch);

What is the problem?

 

Thank you,

Viktor 

 

Hi,

 

I'd like decide in a trigger, if the current action (insert, update, etc) is performed by using force.com api or by the normal web gui.

 

Thank you,

Viktor

I'm creating a trigger in which I'd like to check some Opportunity details. I tried

 

for(Event e: trigger.new){
  if(e.What.CloseDate == ...){
    
  }
}

 but it gives Invalid field CloseDate for SObject Name error.

Is there a way to get these details? I don't want to use SOQL,

 

Thank you,

Viktor

 

I'd like to create a before insert trigger for contacts, which copies some details from the referenced account. My problem is, that I can get the AccountId, but the Account.field values are null.

An example code:

 

trigger account_details  on Contact (before insert) {
 for(Contact t: trigger.new){
  t.Custom_detail__c = t.Account.Custom_detail_on Account__c;
 }
}

Contact custom detail will be null, even it has value on referenced Account.

Is there a kind of simple solution or I should get the Account details with SOQL?

 

Thank you,

Viktor

 

 

Hi,

I've got a php import script, which moves data from webserver to salesforce.

Some data needs assignment rules during import and some not.

I have only one client for the whole script

 

$sf = new SforceEnterpriseClient();

 and I enable my default assignment rule

 

$useAssignmentRule = new AssignmentRuleHeader(null , true);
$sf->setAssignmentRuleHeader($useAssignmentRule);

 for an import function.

 

I'd like to know, what happens after setting the assignment rule. Is it valid for the whole script lifetime?

I thought, it doesn't but seems it does..

I recognized, that some other following import functions use the assignment rule as well and I don't need that. I just need enabled rule for some exceptional import cases.

How can I disable the assignment rule after the success exceptional import?

 

Thanks,

Viktor

 

 

 

I'd like to create a scheduled mass email sending automatism.

My code is:

 

List<Lead> newLeads= [SELECT Id FROM Lead WHERE ... ];
List<Id> toAddresses = new List<Id>();
for (Lead l: newLeads){
     	toAddresses.add(l.Id);
}
Messaging.MassEmailMessage welcomeMail = new Messaging.MassEmailMessage();
welcomeMail_Italy.setTargetObjectIds(toAddresses);
welcomeMail_Italy.setTemplateId(' ... ');
welcomeMail_Italy.setReplyTo(' ... ');
welcomeMail_Italy.setSenderDisplayName(' ... ');

Messaging.sendEmail(new Messaging.MassEmailMessage[] { welcomeMail });

 I get the next error for the last line:

System.EmailException: SendEmail failed. First exception on row 0; first error: INVALID_CROSS_REFERENCE_KEY, invalid cross reference id: []

 

Can you help me pls?

 

Thanks

V

 

  • September 24, 2010
  • Like
  • 0

I've got a lead detail page button which opens a VF page with most important lead details. Clicking on Send on VF page runs my class which sends out the email the given address.

The class works right, but I'm newbie and cannot create the test method.

VF code:

 

<apex:page standardController="Lead" extensions="sendLeadInEmail" title="Send Lead in Email">
 <apex:form >
     <apex:sectionHeader title="Send Lead in email to a specified person"/>
     <apex:pageBlock mode="edit" >
         <apex:messages />
         <apex:pageBlockSection title="Lead details">
                <apex:pageBlockTable value="{!lead}" var="lead">
                    <apex:column value="{!lead.Name}"></apex:column>
                    <apex:column value="{!lead.Company}"></apex:column>
                    <apex:column value="{!lead.Title}"></apex:column>
                    <apex:column value="{!lead.Phone}"></apex:column>
                    <apex:column value="{!lead.Email}"></apex:column>
                    <apex:column value="{!lead.Street}"></apex:column>
                    <apex:column value="{!lead.City}"></apex:column>
                    <apex:column value="{!lead.State}"></apex:column>
                    <apex:column value="{!lead.PostalCode}"></apex:column>
                    <apex:column value="{!lead.Country}"></apex:column>
                    <apex:column value="{!lead.Website}"></apex:column>
                    <apex:column value="{!lead.Product__c}"></apex:column>
                    <apex:column value="{!lead.CreatedDate}"></apex:column>
               </apex:pageBlockTable>
         </apex:pageblockSection>
         <apex:pageblockSection title="Name of Recipient">
                <apex:inputText value="{!recipient}" id="Recipient" maxlength="80" required="true" />
         </apex:pageBlockSection>
         <apex:pageblockSection title="Email address">
                <apex:inputText value="{!address}" id="Address" maxlength="80" required="true"/>
         </apex:pageBlockSection>
         <apex:pageBlockSection title="Personal message (optional)"  >
                <apex:inputTextarea value="{!comment}" id="Comment" required="false" cols="75" rows="6"/>
         </apex:pageBlockSection>
         <apex:pageBlockButtons location="bottom">
                <apex:commandButton value="Send Email" action="{!send}" />                        
                <apex:commandButton value="Cancel" action="{!cancel}"/>
         </apex:pageBlockButtons>
    </apex:pageBlock>    
  </apex:form>
</apex:page>

APEX Class code:

 

public class sendLeadInEmail {
 
	public String recipient{ get; set; }
	public String address { get; set; }
 	public String comment { get; set; }
 	public String plainPersonalMessage;
 	public String htmlPersonalMessage;
 	public String subject;
 	public String plainTextBody;
 	public String htmlBody;
 	public String Title, Phone, EmailAddress, Street, City, State, PostalCode, Country, Website, Product;
 
	private final Lead lead;
 
 	// Create a constructor that populates the Lead object
	public sendLeadInEmail(ApexPages.StandardController controller) {
  		lead = [select Name, Company, Title, Phone, Email, Street, City, State, PostalCode, Country, Website, Product__c, CreatedDate, Sent_in_Email_to__c
    			from Lead where id = :ApexPages.currentPage().getParameters().get('id')];
 	}
  
	 
 	public PageReference send() {
  		// Define the email
  		Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
 		   
  		subject = 'Lead details';
	
  		if (lead.Title == null) Title = ''; else Title = lead.Title;
  		if (lead.Phone == null) Phone = ''; else Phone = lead.Phone;
  		if (lead.Email == null) EmailAddress = ''; else EmailAddress = lead.Email;
  		if (lead.Street == null) Street = ''; else Street = lead.Street;
  		if (lead.City == null) City = ''; else City = lead.City+',';
  		if (lead.State == null) State = ''; else State = lead.State;
  		if (lead.PostalCode == null) PostalCode = ''; else PostalCode = lead.PostalCode;
  		if (lead.Country == null) Country = ''; else Country = lead.Country;
  		if (lead.Website == null) Website = ''; else Website = lead.Website;
  		if (lead.Product__c == null) Product = ''; else Product = lead.Product__c;
 
	  	plainPersonalMessage = comment;
  		htmlPersonalMessage = comment;
 
 	 	if (plainPersonalMessage != '') plainPersonalMessage = comment + '\n\n';
  		if (htmlPersonalMessage != '') htmlPersonalMessage = '<pre><font face="times,times new roman,liberation sans,liberation serif,helvetica,arial,sans,serif" size="4">' + comment + '</font></pre><br>';
  
  		plainTextBody = 'Dear '
  			+ recipient + ',\n\n' + plainPersonalMessage + /* ... */ + 'Best regards,';
  
    	htmlBody = '<font face="times,times new roman,liberation sans,liberation serif,helvetica,arial,sans,serif" size="4">Dear ' + recipient + ',<br><br>' +
  	 		htmlPersonalMessage + /* ... */ + 'Best regards,</font>';
  
		String[] toAddresses = address.split(',',0);          
  		String bccAddress = /* ... */;
  		String[] bccAddresses = bccAddress.split(',',0);  
		
  		// Sets the paramaters of the email
 		email.setSubject( subject );
  		email.setToAddresses( toAddresses );
  		email.setPlainTextBody( plainTextBody );
  		email.setHtmlBody( htmlBody );
	  
	  	// Sends the email
  		Messaging.SendEmailResult [] r = Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});
		
		//set the 'Sent in Email to' field on related Lead:
  		if (lead.Sent_in_Email_to__c == null) lead.Sent_in_Email_to__c = recipient + ' (' + address + ')';
  		else lead.Sent_in_Email_to__c += ', ' + recipient + ' (' + address + ')';
  		update lead;

		// After email sent, navigate to the default view page:
  		return (new ApexPages.StandardController(lead)).view();

	}
	  			

 	static testMethod void myTest() {
       	Lead l = new Lead(
       		FirstName = 'testFirst',
       		LastName = 'testLast',
       		Company ='testcompany',
       		Title = 'testTitle',
       		Phone = '1234',
       		Email = 'test@email.com',
       		Street = 'testStreet',
       		City = 'testCity',
       		State = 'testState',
       		PostalCode = 'testPostal',
       		Country = 'testCountry',
       		Website = 'testWebsite',
       		Product__c = 'testProduct');
		insert l;
		
		Lead testL = [SELECT Id FROM Lead WHERE FirstName = 'testFirst'];
		PageReference leadPage = new PageReference('partialURL');
 		Test.setCurrentPage(leadPage);
		ApexPages.currentPage().getParameters().put('id',testL.Id);
		
		Id testID = ApexPages.currentPage().getParameters().get('id');
		System.assertEquals(testID,testL.Id);
		

		// Instantiate String_function controller
   		ApexPages.StandardController s = new ApexPages.standardController(testL);
   		sendLeadInEmail testSend = new sendLeadInEmail(s);
   		testSend.send();
        
 	}

}

 running the testSend.send(); line gives the next error:

System.NullPointerException: Attempt to de-reference a null object.

 

Where should I set to test the appropriate object?

 

thanks,

Viktor

 

 

  • September 02, 2010
  • Like
  • 0

I'd like to use Eclipse + Force.com IDE for creating my apex codes, but I get this error when IDE's trying to connect to the sandboy/production environment.

 

How can I solve this problem?

thanks

I had an APEX class which sends out a specified email to the given address with some lead details, then updates the lead.

I've completed the class with a simple function, it inserts a completed task  assigned to the lead.

The class works fine in Sandbox but deployment is failed. In the result I get the next failures: all my active triggers are listed with problem: "Test coverage of selected Apex Trigger is 0%, at least 1% test coverage is required"

 

What's wrong?

 

Thanks for the answers!

I don't understand how this limit works. I have three active triggers (all on tasks), all contains some queries.

I'd like to create some new triggers on opportunities and lineItems but no matters how simple my code is, I always get the query limit error.

What could I make wrong? My triggers doesn't come from any other trigger, so the queries cannot sum up

 

thanks for the answers