• Patlatus
  • NEWBIE
  • 35 Points
  • Member since 2013

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 5
    Questions
  • 18
    Replies
hello...
is it possible to use a informed value in a Visualforce page in future?

For example I inform an email and I will use this email to JOB schedule ....

Are you doing this?
How do I?

Thank you

global class ASchedTeste implements System.Schedulable {
public String str{get;set;}
public String mail{get;set;}
public String nomJob{get;set;}

global void execute(SchedulableContext sc) {
  newPublier();
}

//Cria bem o job na hora informada 0 28 15 * * ?
public void schedulejob(){
        String NomJobSchedulable = nomJob;
        ASchedTeste p = new ASchedTeste();
        String sch = str; 
        system.schedule(NomJobSchedulable , sch, p);    
}

public void newPublier(){

List<case> acclist = [Select casenumber,subject, accountid from case limit 10];
string header = 'Id, Subject,Account, '+'\n';
string finalstr = header ;
for(case a: acclist)
{
   string recordString = a.casenumber + ',' + a.subject+ ',' + a.accountid +'\n';
   finalstr = finalstr + recordString;
}
Messaging.EmailFileAttachment csvAttc = new Messaging.EmailFileAttachment();
blob csvBlob = Blob.valueOf(finalstr);
string csvname= 'cases.csv';
csvAttc.setFileName(csvname);
csvAttc.setBody(csvBlob);
Messaging.SingleEmailMessage email =new Messaging.SingleEmailMessage();
String[] toAddresses = new list<string> {mail};
String subject = 'Report CSV';
email.setSubject(subject);
email.setToAddresses( toAddresses );
email.setPlainTextBody('Informations HERE');
email.setFileAttachments(new Messaging.EmailFileAttachment[]{csvAttc});
Messaging.SendEmailResult [] r = Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});
  }   
}

--------------------------------------------------------------------------------------------------------------------

<apex:page controller="ASchedTeste">
  <apex:form >
  <apex:PageBlock >
    :::::::::: TEST TEST TEST :::::::::: <br /><br />  
    Mail..........:&nbsp;<apex:inputText styleClass="classeMail" value="{!mail}"/><br /><br />
    Nom Job.......:&nbsp;<apex:inputText styleClass="classeMail" value="{!nomJob}"/><br /><br />
    Plan.....:<apex:inputText value="{!str}" />
    <apex:commandButton value="Schedule" action="{!schedulejob}" />
   
  </apex:PageBlock>
  </apex:form>
</apex:page>

Hello.

I have following questions.

Assuming I have following code

public class MessageMaker {
	public static void helloMessage() {
		System.debug( 'Entry point' );
        
        Case c = new Case();
        insert c;
        
        EmailMessage e = new EmailMessage();
        System.debug( 'EmailMessage created' );
        e.parentid = c.id;
        // Set to draft status.
        // This status is required 
        // for sendEmailMessage().
        e.Status = '5'; 
        e.TextBody = 
          'Sample email message.';
        e.Subject = 'Apex sample';
        e.ToAddress = 'my@mail.com';
        insert e;
        
        List<Messaging.SendEmailResult> 
          results = 
          Messaging.sendEmailMessage(new ID[] 
            { e.id });
        System.debug(results.size());
        System.debug(results[0].success);       
        System.debug(results[0].getErrors().size());
        System.assertEquals(1, results.size());
        System.assertEquals(true, results[0].success);

	}
}

1. First question.

 I want to find out using apex code if the message was really delivered.

 

Here documentation says

http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_sendemail_emailresult.htm

Even if success = true, it does not mean the intended recipients received the email, as it could have bounced or been blocked by a spam blocker. Also, even if the email is successfully accepted for delivery by the message transfer agent, there can still be errors in the error array related to individual addresses within the email.

 

 So I have been trying to send email by apex code and look for results[0].success.

It seems it says like it is described in documentation, so success is true even though email address was incorrect.

 

Also I have tried to check this manually through email logs 

http://eu2.salesforce.com/help/doc/en/email_logs.htm

 

And I have found following row in resulting log regarding my email sent to incorrect address

 

9/2/2013 9:36 66/FC-09306-20B54225 T julfy@i.ia julfy=i.ua__0-6uvic1ltvun1nf@95mngihd2hpe0w.b-ysubea0.bl.bnc.salesforce.com   1434 005b0000000J7bm <_0vTJ000000000000000000000000000000000000000000000MSHRSY00W1-CKg3DShWC5xu24ccHFA@sfdc.net> 1 311.627583       421 4.4.0 [internal] no MXs for this domain could be reached at this time

 

But I don't know how to access this information by apex code. Any thoughts?

 

2. Second question.

If message was delivered and recipient forwarded it, is any possibility to monitor that using apex code?

Anybody?

I know that you can monitor if user has read email sent by SalesForce and even how many times the email was viewed.

Is it possible to monitor forwarding email or errors during email delivery by salesforce also?

For example, I send an email from SalesForce and I want to know if user has forwarded that email to anyone.

Or, if there were mistake in user email and email wasn't delivered can I track that using SalesForce?

Or, if mailbox of recipient is full, can I track that using SalesForce?

I have tried to use Force.com IDE. I have downloaded the latest version of Force.com IDE (version 28.0) and while creating class or synchronize try (push changes to web) I receive the same error

 

com.salesforce.ide.api.metadata.types.Metadata$JaxbAccessorF_fullName cannot be cast to com.sun.xml.internal.bind.v2.runtime.reflect.Accessor

 

I have googled and found that 26 version should be downloaded instead of 28 to work with Force.com without experiencing nasty obscure errors.

Is this really the case?

 

Unfortunately I can't find download link to older version (version 26). Can anyone share link to download version 26 of Force.com IDE?

Is it possible to write MMORPG using SalesForce or PlayByEmail or any other game?

My question is following.
I am trying to follow "Integration Workbook" from SalesForce, and I have problems with OAuth.
It seems I am missing something important but I can't understand what it is exactly.
So, when I try to access external java heroku callout application http://bdovhan-sfjavaco-advanced.herokuapp.com/orderui I see error
"redirect_uri must match configuration"
despite I have been steps from Integration Workbook.

 

 
 
which shows
 
error=redirect_uri_mismatch&error_description=redirect_uri%20must%20match%20configuration
So, the book says I should go to "Develop\Remote Access". When I go there, I see page
Remote Access
 
Remote Access Objects have been moved to Applications. You'll be redirected to that page in five seconds, or you can click Take Me There to go now. 

 
which redirects me to  Create\Apps page.
 
So I created there new "Connected app" with OAuth Settings
OAuth Settings
Consumer Key
3MVG99qusVZJwhskauq_mFaTDmKNd6sj0K1H.A3yHEU9NDt8RrFK9tUOHoo3d_cCTozj.THYcUC8DuGyh4Udx
Consumer Secret
608214169699987470
Selected OAuth Scopes
Full access (full)
Callback URL
https:/bdovhan-sfjavaco-advanced.herokuapp.com/_auth

which I have copied to heroku.

 

So, what is wrong?

Hello Dear,
As we all knew that people are talking Number,Eail,Text is use for External ID.
but i found one option that we can use auto number as Extenal ID.Please Clarify me this.

Hi,
My understanding was, we can not use 'webservice' keyword in trigger. However, I saw in apex guide, we can use 'webservice' key word.

You can only use the webService keyword in a trigger when it is in a method defined as asynchronous; that is, when the
method is defined with the @future keyword.


Can someone clear me this idea? How to write a code here, any example..

Thank you.
 
  • January 08, 2015
  • Like
  • 0
Hello Buddies,

Iam preparing for 501 exam, in many of the blogs i collected many questions. Some of the below questions am not able to answer. Will you give me the answers for these.
Q1) How can multiple Force.com developers colloborate as a team? Select Only 2options
A) Store metadata definitions in a version control system.
B) Share application source code with third parties using AppExchange publishing.
C) Create a seperate a sandbox for each developer.
D) Save historical version of every metadata component on the Force.com Servers.

Q2) What is a best practice when writing unit tests?  Select 2 options only
A) Leverage Existing Organizational data in test execution to validate data-specific reasons.
B) Develop unit test, which cover upto 50% of classes an triggers.
C) Leverage the startTest and stopTest static methods to test governor limits.
D) Test governors for triggers by using many records when performing DML.

Q3) What is a best practice of testMethods? Only one option
A) Assert the behavior of the application on all test Scenarios.
B) Query up existing records to use in tests rather than creating new records in the testMethod.
C) Write atleast one bulk test for every functionality that tests Large data volumes for applicable use cases.
D) The testMethod should make multiple startTest and stopTest statements to start and stop multiple test scenarios.

Q4) A financial company provides financial services to individuals with high net worth.They use Salesforce CRM to track their client interactions. In a Developer Sand box, they enhanced custom businesss logic to remind their account managers about important dates, such as birthdays and anniversaries, for any client or member of a client's household.
How should the financial company roll out their Force.com application from the Developer Sandbox to the account managers?
A) by exporting the application as a .csv file.
B) by deploying the application using metadata files.
C) by publishing the application as a package.
D) by using Salesforce to Salesforce.

Q5) Which environment should be used to debug data-related issues reported in an active production organization?
A) Partial Data Sandbox
B) Developer Pro Sandbox
C) Full Sandbox
Developer Sandbox.

Q6) A Java Program running on a UNIX machine needs to access Salesforce data? What could be used to accomplish this? Only 2options
A) Force.com SOAP API
B) Visualforce pages.
C) Apex trigger
D) Custom Apex Web Services

Q7) Which environment is appropriate for developing a new Force.com application for sale or distribution? Only one option
A) Developer Sandbox
B) Salesforce Commerce edition
C) Full Sandbox
D) Partial Data Sandbox

 
Hi everyone,

I have been a SF admin for a while now and I'm staring to dive into some customization.

In theory, what I'm trying to do is simple. I have a custom object, which has a lookup relationship with the Opportunity object.

Here's the user journey:

1) New record is created via related list on opportunity (has to be this way)

2) Edit page loads with opportunity name lookup field pre populated

3) User clicks save

4) All lookup and formula fields get to work and the record is completed

This is all working fine.

However, I needed to build a visualforce page for the custom object records (detail page).

How do I replace the custom object record page layout with my visualforce page?

When I test the page by adding the id to the URL (?=id.....) the page works great. I can't work out how to do this automatically. 

I have tried creating a new Save button, but the page loads blank.

I have also been reading up on extending the VF page, and then overriding the save button with a new Save method. When I do this, I don't know how to format the pageReference URL because the record id has not been created yet.

Can anyone provide some guidance please? Im happy to provide code, although the VF is quite long.

Thanks
  • May 30, 2014
  • Like
  • 0
hello...
is it possible to use a informed value in a Visualforce page in future?

For example I inform an email and I will use this email to JOB schedule ....

Are you doing this?
How do I?

Thank you

global class ASchedTeste implements System.Schedulable {
public String str{get;set;}
public String mail{get;set;}
public String nomJob{get;set;}

global void execute(SchedulableContext sc) {
  newPublier();
}

//Cria bem o job na hora informada 0 28 15 * * ?
public void schedulejob(){
        String NomJobSchedulable = nomJob;
        ASchedTeste p = new ASchedTeste();
        String sch = str; 
        system.schedule(NomJobSchedulable , sch, p);    
}

public void newPublier(){

List<case> acclist = [Select casenumber,subject, accountid from case limit 10];
string header = 'Id, Subject,Account, '+'\n';
string finalstr = header ;
for(case a: acclist)
{
   string recordString = a.casenumber + ',' + a.subject+ ',' + a.accountid +'\n';
   finalstr = finalstr + recordString;
}
Messaging.EmailFileAttachment csvAttc = new Messaging.EmailFileAttachment();
blob csvBlob = Blob.valueOf(finalstr);
string csvname= 'cases.csv';
csvAttc.setFileName(csvname);
csvAttc.setBody(csvBlob);
Messaging.SingleEmailMessage email =new Messaging.SingleEmailMessage();
String[] toAddresses = new list<string> {mail};
String subject = 'Report CSV';
email.setSubject(subject);
email.setToAddresses( toAddresses );
email.setPlainTextBody('Informations HERE');
email.setFileAttachments(new Messaging.EmailFileAttachment[]{csvAttc});
Messaging.SendEmailResult [] r = Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});
  }   
}

--------------------------------------------------------------------------------------------------------------------

<apex:page controller="ASchedTeste">
  <apex:form >
  <apex:PageBlock >
    :::::::::: TEST TEST TEST :::::::::: <br /><br />  
    Mail..........:&nbsp;<apex:inputText styleClass="classeMail" value="{!mail}"/><br /><br />
    Nom Job.......:&nbsp;<apex:inputText styleClass="classeMail" value="{!nomJob}"/><br /><br />
    Plan.....:<apex:inputText value="{!str}" />
    <apex:commandButton value="Schedule" action="{!schedulejob}" />
   
  </apex:PageBlock>
  </apex:form>
</apex:page>
I know that sandboxes are now generated with "System Email Only" setting for Email Deliverability. However, this immediately breaks a whole bunch of unit tests.

Has anybody found a workaround for this, other than just changing "Email Deliverability" straight back to "All"? Seems like a bit of an oversight by Salesforce here not to excempt test code from those settings.

So based on the discussion board, it seems like you can make conditional required fields through validation rules. However, is there a way to let the customer know which conditional fields are required based on their input? (i.e. display a red line at a conditional field if it is required, and no red line if it is not required)? 

 

Or does anyone have any tips/advice on how best to display/let the customer know which conditional fields are required based on their input? 

 

Thanks in advance! 

  • December 10, 2013
  • Like
  • 0

I know that you can monitor if user has read email sent by SalesForce and even how many times the email was viewed.

Is it possible to monitor forwarding email or errors during email delivery by salesforce also?

For example, I send an email from SalesForce and I want to know if user has forwarded that email to anyone.

Or, if there were mistake in user email and email wasn't delivered can I track that using SalesForce?

Or, if mailbox of recipient is full, can I track that using SalesForce?

Hi,

 

I purchased an indiividual group user account yesterday and need someone to help set it up.  Can you assist?

 

Thanks,

 

Trudy

 

tkstemen@gmail.com

My question is following.
I am trying to follow "Integration Workbook" from SalesForce, and I have problems with OAuth.
It seems I am missing something important but I can't understand what it is exactly.
So, when I try to access external java heroku callout application http://bdovhan-sfjavaco-advanced.herokuapp.com/orderui I see error
"redirect_uri must match configuration"
despite I have been steps from Integration Workbook.

 

 
 
which shows
 
error=redirect_uri_mismatch&error_description=redirect_uri%20must%20match%20configuration
So, the book says I should go to "Develop\Remote Access". When I go there, I see page
Remote Access
 
Remote Access Objects have been moved to Applications. You'll be redirected to that page in five seconds, or you can click Take Me There to go now. 

 
which redirects me to  Create\Apps page.
 
So I created there new "Connected app" with OAuth Settings
OAuth Settings
Consumer Key
3MVG99qusVZJwhskauq_mFaTDmKNd6sj0K1H.A3yHEU9NDt8RrFK9tUOHoo3d_cCTozj.THYcUC8DuGyh4Udx
Consumer Secret
608214169699987470
Selected OAuth Scopes
Full access (full)
Callback URL
https:/bdovhan-sfjavaco-advanced.herokuapp.com/_auth

which I have copied to heroku.

 

So, what is wrong?

How can I convert the Set od IDs to List of IDs. Because I am using 'oldmap' concept? 

 

-Kaity

  • July 23, 2013
  • Like
  • 0
I know that sandboxes are now generated with "System Email Only" setting for Email Deliverability. However, this immediately breaks a whole bunch of unit tests.

Has anybody found a workaround for this, other than just changing "Email Deliverability" straight back to "All"? Seems like a bit of an oversight by Salesforce here not to excempt test code from those settings.