• Autobat
  • NEWBIE
  • 50 Points
  • Member since 2009

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

Hey Guys,

 

I have tried the two different options available for setting the DML trigger user email option and still no email is being sent to the new user.  If i open the edit screen the 'Generate New Password and Notify User immediately' is still available.  Any ideas?

 

Approach 1

 

Database.DMLOptions dmo = new Database.DMLOptions();
dmo.EmailHeader.triggerUserEmail = true;
theUser.SetOptions(dmo);
		
database.insert(theUser);

 

 

Approach 2

 

Database.DMLOptions dmo = new Database.DMLOptions();
dmo.EmailHeader.triggerUserEmail = true;
		
database.insert(theUser, dml);

 

 

Hey Guys,

 

Here is an interesting one for you.  I have dug through the documentation and cant find a limitation documented anywhere so I'm now thinking its an undocumented feature???

 

 

Apex Scheduler triggers a batch that simply runs an update over a subset of Leads at 5am each morning.  The batch runs perfectly and updates a number of complex status fields as defined by some related objects.  Its really just a workaround for not being able to use a master detail.  Where the problem lies is that there are a number of small conditions that should fire an email to the Lead via workflow, all of these are configured and working if i perform an update through the front end, however, when the batch runs no emails are produced.

 

So, enforced limitation, undocumented feature or bug?

 

Cheers,

 

Hey Guys,

 

We are putting together some integration to the banking network and understandably the test servers we are connecting to all have self-signed certificates and only the production environments have CA signed certificate.

 

Now, i understand why Salesforce in a production environment will only connect to CA signed servers but in test we need to connect to the banks test servers........  how can we do this?  I have exhausted all of my ideas :/

 

Cheers,

 

Chris 

Hey guys,

 

Interesting one here.  Code that was working perfectly last week is now behaving differently....

 

When the command link is clicked the action that it is attached to is not being fired but instead the page is reloading and therefore the page Init method is the next one to fire.  So i guess my problem is that the command link and the APEX method are no longer hooked together.  I have recompiled all the code and no errors so im a little confused as to why.....  

 

To add some complexity, this problem only exists in IE.  

 

Safari, firefox and chrome are all working perfectly.

 

Cheers,

 

Chris 

Hey Guys,

 

I understand the inability to commit DB changes (no updates or inserts) before you can make a callout.  This however is a monumental problem.....

 

Scenario:

Drupal passes personal and payment details to Salesforce via SOAP.  Salesforce sends payment details to bank and returns message back to drupal with success or error.

 

Problem:

Because i cant commit anything to the database before making the call out there is no way for me to make the application thread safe as i need to reserve a unique reference for the payment (client wants sequential references).

 

So my question, is there a way for me to make this thread safe?  e.g. how do i stop 2 website users sending in a payment at exactly the same time and the system using the same reference for both?  Or is the only way i can do this is by making the client move away from sequential references and I construct one from some source or another?

 

Many thanks,

 

Chris 

 

  • September 10, 2009
  • Like
  • 0

Hey Guys,

Doing some work integration work with a custom web service and we have a Master Detail between Opportunities and Custom Object for tracking banking interface transactions.

There are currently 2 methods of initiating the banking interface, one through the org and visual force and one through the website and a custom webservice.  When the VF is used the rollup summary on the Opportunity works as expected.  When a transaction record is created through the custom webservice the rollup summary is left unchanged.  I have tested that all is ok by forcing a recalculation of the rollup summary and the correct values come out.

Any ideas?  I have looked through the docs but can't see anything that I'm missing.....

Cheers,

Chris

Hey Guys,

 

I have two classes, one updates 2 fields on a record and the other class updates a different field on the record.  Sounds simple......

 

The first class is working perfectly and is encrypting some user entered data perfectly and storing it against the record.  The second class can read the record and access the encrypted data, however, i try and set a third field and update the record and all hell breaks loose!  The site goes straight to the Unauthorized page and there is nothing in the debug log around a failure and i cant catch any exceptions.

 

Checked apex security, page security, object CRUD and FLS and all is how it should be...

 

 

Any ideas where i should check next? 

The recent items list in the sidebar updates but the record isn’t recorded in the recent items list within the tab view.  Is there something I need to populate in my controller?

Hey Guys,

 

But stumped here, a client of mine is currently getting an 'Unexpected Metadata' error coming up while trying to delete or edit a record.  Record is a custom object with some validation rules, workflow and APEX on it.  Any ideas where or how I should start debugging this one?

 

Cheers,

Good Morning,

 

I admit, this will sound like I'm about to make a huge assumption that could bite me in the future....  you could be right :)

 

With the web to lead, will the leads always come through in a trigger batch size of 1 or can they be batched together if multiple lead forms were submitted at the same time?

OK, it's late in the week and i have to admit that I'm very tired so I'm hoping that I'm just going a little crazy!

Code compiles but sends out an error when run of : System.TypeException: Invalid integer: 1

The error looks mightily strange to begin with as I have become accustomed to 1 being an integer for sometime now.

Never the less, i have split the into seperate stages (please no comments about how i could just parse it in one line, i know) and we still get an error, now im going to leave this one here and go to the pub as i mentioned before its been a long week and i really fancy a nice cold beer!

 

Oh, nearly forgot, License_Duration__c is a numeric in the database and so is retrieved as a double.

 

double dDuration = sPCC.Product__r.License_Duration__c;
integer iDuration = integer.valueOf(dDuration);
sLicense.Expiry_Date__c = sLicense.Start_Date__c.addMonths(iDuration);

 

 

 


I have an external application that needs to call a webservice and auth a user against information held on the client record and one custom object (license).

Am I correct in understanding that the external application only needs a platform license to call the webservice as APEX will run as System and will have access to the core objects?
Hey Guys,
 
I have a strange one here, I have done some tinkering but sadly I have to run out for the rest of the day so thought I would leave a question up so I might have an answer for this evening and I can finish the project.
 
I have a Visualforce page that in turn loads two other Visualforce pages (long story).  In Firefox all runs perfectly, however, after some cross platform testing can see IE is going to screw me once again!  As soon as the page starts to load IE pops up a message just under the title bar saying:
 
To help protect your security, Internet Explorer blocked this site from downloading files to your computer, Click here for options....
 
Of course none of the options are helpful, trying to download the file is useless as it is the VF page it is trying to download and I’m a bit stumped to be honest.
 
Any ideas would be welcome,

 

Hey Guys,

 

This one has just popped up on a clients org when running test classes, im frantically searching through the config to make sure no one has change something to unique but i havent found anything yet, any ideas?

 

System.DmlException: Insert failed. First exception on row 0; first error: DUPLICATE_VALUE, duplicate value found: <unknown> duplicates value on record with id: <unknown>

Hey Guys,

So I have created a heap of code that works perfectly if the entry point to my class is executed from an SControl using the old sforce.apex.execute(…) method and a web service.  Now the web service that fires basically tees up an Argument and Return object and then fires the entry point in one of my campaign automation classes.

Now here comes the interesting bit, and by interesting I swore very loudly!

If I move that web service code into the constructor of my Visualforce controller all of the code runs perfectly apart from none of the future methods are queued up and therefore not run……..  The code (confirmed by System Debug messages) just jumps over the call to the @future, the two log files look near identical with the only difference being what process inits everything.

Any ideas?  I really don’t want to execute this code from an SControl.

Hey Guys,

 

Here is an interesting one for you.  I have dug through the documentation and cant find a limitation documented anywhere so I'm now thinking its an undocumented feature???

 

 

Apex Scheduler triggers a batch that simply runs an update over a subset of Leads at 5am each morning.  The batch runs perfectly and updates a number of complex status fields as defined by some related objects.  Its really just a workaround for not being able to use a master detail.  Where the problem lies is that there are a number of small conditions that should fire an email to the Lead via workflow, all of these are configured and working if i perform an update through the front end, however, when the batch runs no emails are produced.

 

So, enforced limitation, undocumented feature or bug?

 

Cheers,

 

I have a trigger that sends an email using a Visual Force Email template to a contact when an Opportunity stage changes to a couple specific values and the type of transaction (custom field) is set to a couple of specific values.  There is a text field on the opportunity that holds an email address that this email is to be sent to.  A query using this text field determines if a contact exists with this email or if it does not exists, creates a dummy contact.  The existing contact or dummy contact is the recipient.  A "Send Test and Verify Merge Fields" on the template works fine.  The Trigger won't deploy and here is the debug code.

 

mail=Messaging.SingleEmailMessage[
getBccAddresses=null;
getCcAddresses=null;
getCharset=null;
getDocumentAttachments=null;
getFileAttachments=null;
getHtmlBody=null;
getPlainTextBody=null;
getTargetObjectId=0037000000lx8iHAAQ;
getTemplateId=00X700000016C9gEAE;
getToAddresses=null;
getWhatId=0067000000IkfgVAAR;
isUserMail=false;]

 

21:11:27.566|METHOD_ENTRY|[77,4]|Messaging.sendEmail(LIST:Messaging.SingleEmailMessage)
21:11:27.749|EXCEPTION_THROWN|[77,4]|System.EmailException: SendEmail failed. First exception on row 0; first error: UNKNOWN_EXCEPTION, java.lang.NullPointerException: Argument Error: Parameter value is null
21:11:27.751|METHOD_EXIT|[77,4]|sendEmail(LIST:Messaging.Email)
21:11:27.751|FATAL_ERROR|System.EmailException: SendEmail failed. First exception on row 0; first error: UNKNOWN_EXCEPTION, java.lang.NullPointerException: Argument Error: Parameter value is null

How can I determine what parameter value is null?

Thanks

 

  • June 03, 2010
  • Like
  • 0

Hey guys,

 

Interesting one here.  Code that was working perfectly last week is now behaving differently....

 

When the command link is clicked the action that it is attached to is not being fired but instead the page is reloading and therefore the page Init method is the next one to fire.  So i guess my problem is that the command link and the APEX method are no longer hooked together.  I have recompiled all the code and no errors so im a little confused as to why.....  

 

To add some complexity, this problem only exists in IE.  

 

Safari, firefox and chrome are all working perfectly.

 

Cheers,

 

Chris 

Images in PDF attachment of a Visualforce email Template are missing in time based workflows or when called from @future method:

 

I have a VF email template which references images from a static resource. This works perfectly, if I send the email from workflow rule, except for, if it is a time based workflow or if the workflow is a result of a change made in a @future apex method.

 

The email is still sent out, but all images are missing and are replaced by the standard VF-icon for missing images.

 

Easy Steps to reproduce:

 

1. create a simple VF email with PDF attachment

 

 

<messaging:emailTemplate subject="BugTest" recipientType="Contact">
<messaging:htmlEmailBody >
Body
</messaging:htmlEmailBody>

<messaging:attachment renderAs="pdf" filename="bugTest.pdf">
<img src="{!URLFOR($Resource.pdfLogo)}"/>
</messaging:attachment>

</messaging:emailTemplate>

 

2. create a method which uses the template (replace the IDs with IDs from your org)

 

 

@Future

public static void sendBuggyMails() {
Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
email.setTargetObjectId('003S0000004qO5I');
email.setTemplateId('00XS0000000QN6W');
Messaging.sendEmail(new Messaging.SingleEmailMessage[] { email });
}

 

3. Call the @future.method e.g. from execute anonymous

 

==> you receive an email with a PDF attachment but without the image

 

4. Remove the @future annotation and call the method again

 

==>  you receive an email with a PDF attachment including the image

 

 

The same issue happens, when the email is sent from a time based workflow, or from a workflow which was triggered from a @future-method.

 

 

Is this a bug or am I doing something wrong here?

 

 

Ingo

 

 

 

 

 

 

  • November 03, 2009
  • Like
  • 0

Hey Guys,

Doing some work integration work with a custom web service and we have a Master Detail between Opportunities and Custom Object for tracking banking interface transactions.

There are currently 2 methods of initiating the banking interface, one through the org and visual force and one through the website and a custom webservice.  When the VF is used the rollup summary on the Opportunity works as expected.  When a transaction record is created through the custom webservice the rollup summary is left unchanged.  I have tested that all is ok by forcing a recalculation of the rollup summary and the correct values come out.

Any ideas?  I have looked through the docs but can't see anything that I'm missing.....

Cheers,

Chris

Hey Guys,

 

I have two classes, one updates 2 fields on a record and the other class updates a different field on the record.  Sounds simple......

 

The first class is working perfectly and is encrypting some user entered data perfectly and storing it against the record.  The second class can read the record and access the encrypted data, however, i try and set a third field and update the record and all hell breaks loose!  The site goes straight to the Unauthorized page and there is nothing in the debug log around a failure and i cant catch any exceptions.

 

Checked apex security, page security, object CRUD and FLS and all is how it should be...

 

 

Any ideas where i should check next? 

OK, it's late in the week and i have to admit that I'm very tired so I'm hoping that I'm just going a little crazy!

Code compiles but sends out an error when run of : System.TypeException: Invalid integer: 1

The error looks mightily strange to begin with as I have become accustomed to 1 being an integer for sometime now.

Never the less, i have split the into seperate stages (please no comments about how i could just parse it in one line, i know) and we still get an error, now im going to leave this one here and go to the pub as i mentioned before its been a long week and i really fancy a nice cold beer!

 

Oh, nearly forgot, License_Duration__c is a numeric in the database and so is retrieved as a double.

 

double dDuration = sPCC.Product__r.License_Duration__c;
integer iDuration = integer.valueOf(dDuration);
sLicense.Expiry_Date__c = sLicense.Start_Date__c.addMonths(iDuration);

 

 

 

Hey Guys,
 
I have a strange one here, I have done some tinkering but sadly I have to run out for the rest of the day so thought I would leave a question up so I might have an answer for this evening and I can finish the project.
 
I have a Visualforce page that in turn loads two other Visualforce pages (long story).  In Firefox all runs perfectly, however, after some cross platform testing can see IE is going to screw me once again!  As soon as the page starts to load IE pops up a message just under the title bar saying:
 
To help protect your security, Internet Explorer blocked this site from downloading files to your computer, Click here for options....
 
Of course none of the options are helpful, trying to download the file is useless as it is the VF page it is trying to download and I’m a bit stumped to be honest.
 
Any ideas would be welcome,

 

Hey Guys,

 

This one has just popped up on a clients org when running test classes, im frantically searching through the config to make sure no one has change something to unique but i havent found anything yet, any ideas?

 

System.DmlException: Insert failed. First exception on row 0; first error: DUPLICATE_VALUE, duplicate value found: <unknown> duplicates value on record with id: <unknown>

Hey Guys,

So I have created a heap of code that works perfectly if the entry point to my class is executed from an SControl using the old sforce.apex.execute(…) method and a web service.  Now the web service that fires basically tees up an Argument and Return object and then fires the entry point in one of my campaign automation classes.

Now here comes the interesting bit, and by interesting I swore very loudly!

If I move that web service code into the constructor of my Visualforce controller all of the code runs perfectly apart from none of the future methods are queued up and therefore not run……..  The code (confirmed by System Debug messages) just jumps over the call to the @future, the two log files look near identical with the only difference being what process inits everything.

Any ideas?  I really don’t want to execute this code from an SControl.