• dreamreal
  • NEWBIE
  • 0 Points
  • Member since 2010

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

I noticed you can only schedule reports to email to "me" or an existing user. Is there anyway through apex to have it send to a contact?

This is sort of an unusual thing so bear with me as I try to explain it. I have an apex trigger that sends an email to a person when an opportunity is set to a certain stage. What I want to do however, is be able to send that email at a certain time, say at the end of the day, 4 pm. So if that trigger is activated at some point during that day for that opportunity, is there a way to send that email at a specific time?

I am trying to create a page that will open several links in new windows. I've tried several methods which dont work and am now  beginning to think that salesforce does not allow the opening of new pages. For example:

 

 

<apex:page standardcontroller="Account" extensions="maininvoice">
 <body>
  <p id="hello">Hello World</p>
  <a href="http://www.google.com" class="name">google</a>
  <a href="http://www.yahoo.com" class="name">yahoo</a>
</body>

    <apex:includeScript value="{!URLFOR($Resource.jquery, 'js/jquery-1.4.2.min.js')}"/>
<script type="text/javascript">

var j$ = jQuery.noConflict();
j$(function(){
  $('.name').each(function() {
    window.open(this.href);
  });
});
 
</script>

</apex:page>

does not work in salesforce but if I do it outside of salesforce it does: http://jsbin.com/adome/edit

 

 

Here's the situation:

 

I have a visualforce page that is accessed from a button on Account. Lets call this mainPage.

What should happen is that this page opens several other visualforce pages, several subPages.

Each subpage corresponds to a specific record. The mainPage will somehow query to find the id's of the record each subpage references (ie. salesforce.com/apex/subpage?id=1234567). And then somehow the mainpage would open each link.

 

Here's the problem:

I dont know how to open multiple windows.

I have a few ideas/observations:

- I dont believ I can use the controller - there is no way to pass the id's to the visualforce page, and my attempts at a 'hack' using escape=false failed

- I think I can do this using Javascript, except I'm not sure I could query to find the id's I need to open these new windows

- I dont understand what Ajax is, but I have a feeling it allows me to do this?

- if I cant do this could I somehow call an apex method in the controller class to pass the id's to javascript on the visualforce page?

- is there anyway of opening a page referencing a specific id without using urls? slightly annoying.

 

I'm obviously a little confused and not certain how all these components play together in salesforce. If you could advise me on this I'd very much appreciate it.

I have a trigger that currently sends an email if a field is checked and the opportunity is at a certain stage. Unfortunately, I do not want to send the email at the time the stage is changed. I want to be able to send all the emails from each instance the trigger is triggered, at one time during a day.

 

Is there any way to do this?

Here's what I want to happen:

 

From the object account a user clicks a button called "generate line summaries".

 

(Background: Each Account can have several "lines", a line is an object with a lookup field to the account.)

 

So when the user clicks the button, a line summary(a visualforce page), is generated for each line associated with the account.

 

The way I've been trying is to have one visualforce page created which creates several iframes, but with iframes you can only hard-code the source. I need a way that will work with any number of lines.

I wrote an overcomplicated piece of code in an apex extension that creates a string which I want to act as code and be proceessed as visualforce. Unfortunately, it is just displayed as text. I'll give an example:

 

public String gettester() {
return '<b> Something: </b>';
}

 

I want this to return Something: but instead it'll return <b> Something: </b>.

Is there anyway to obtain the result I want?

Is there anyway to create a visualforce page that will create a document in excel with tabs?

I want to create a visualforce page which displays some data. 

 

The standard controller is Phone Line, a custom object.

 

Each opportunity has multiple phone lines. In each phone line there is a lookup field to the opportunity it is related to.

 

I want to be able to display data from the opportunity that the current phone line is related to.

 

For example, from a particular phone line record, the user should click a button to get to the visualforce page which should display information about the opportunity the phone line is related to.

 

I'm very new to this, and from my limited understanding, I believe that I would have to either write a custom controller, or an extension in apex. Your help would be appreciated

Hey, I am new to visualforce and am trying to do something that seems pretty tough to me. Basically I want to be able to mail merge into excel, but since this functionality does not exist as of now in salesforce, the idea I came up with was using a visualforce page, and the visualforce-to-excel functionality. Hopefully a user would just click the generate button and it would create an excel document with the specific fields filled out. 

 

I was wondering if there was a particular way to style the page so I could get columns and rows, but with different fields in each box. Additionally if anyone had any similar code lying around that they could throw at me, it'd really help. Thanks!

What I've done is attempt to write code to attach files from the "Notes and Attachments"  list into an email that automatically sends when the opportunity stage changes to 'Send Request'. I set the target object ID to a contact to whom I wish to send the email to. I am using a template which has merge fields from opportunity. Whats currently happening is that the email is being sent to the owner of the contact, and not the contact himself. Also the attachment is not attaching, so apparently nothing is going right. Advice/criticism is much appreciated

 

 

 

trigger sendEmailAlert on Opportunity (after update) {

for(opportunity o:Trigger.new){
if(o.Stagename == 'Send Request'){
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();

Attachment[] queryAttachment = [select Name from Attachment where Parentid=:'accountId' order by CreatedDate DESC];

Messaging.EmailFileAttachment[] allAttachments = new Messaging.EmailFileAttachment[queryAttachment.size()];
        for(integer i=0;i<queryAttachment.size();i++)
        {
            Messaging.EmailFileAttachment fileAttachment = new Messaging.EmailFileAttachment();
            fileAttachment.setBody(queryAttachment[i].Body);
            fileAttachment.setFileName(queryAttachment[i].Name);
            allAttachments[i] =  fileAttachment;
        } 
        
        mail.setFileAttachments(allAttachments);
        mail.setTemplateID('00XQ0000000QHJS');
        mail.setTargetObjectID('003Q000000BQKyk');
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });


}
}
}

 

I am attempting to write a trigger that fires at a specific stage of a opportunity. I feel like this is really stupid but salesforcce isnt allowing me to refer to the current stage as Opportunity.stagename

What am I doing wrong

Hey all, 

 

I need your help with trying to create a function that sends emails on a recurring basis. I called support but they werent very clear on how I could do this, so I'm turning to you for help. 


My function should send an email to the assigned user every 2 hour if the case priority is high and the status is new

 

So far I've tried the following but I believe it will not work:

 

 

trigger alertUser on Case (after update, after insert) {
datetime now = datetime.now();
datetime created = case.Createddate;
If (math.mod(datetime.getTime(created)  -  datetime.getTime(now), 7200000) == 0){
//send email
}
} 

 Thanks in advance

 

I'm trying to create a trigger to send an email with an attachment from the "notes and attachments'" object. However it wont compile and give the error: Method does not exist or incorrect signature: ISPICKVAL(Schema.SObjectField, String) at line 3 column 5. I've been banging my head against my desk for the better part of half an hour trying to figure this out. please help.

 

trigger sendEmailAlert on Opportunity (after insert, after update) {

if (ISPICKVAL(opportunity.stagename, 'Send Rebecca Request')){
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();

Attachment[] queryAttachment = [select Name from Attachment where Parentid=:'accountId' order by CreatedDate DESC];

Messaging.EmailFileAttachment[] allAttachments = new Messaging.EmailFileAttachment[queryAttachment.size()];
        
        
        for(integer i=0;i<queryAttachment.size();i++)
        {
        
        
            Messaging.EmailFileAttachment fileAttachment = new Messaging.EmailFileAttachment();
            fileAttachment.setBody(queryAttachment[i].Body);
        
        
        
            fileAttachment.setFileName(queryAttachment[i].Name);
            allAttachments[i] =  fileAttachment;
        } 

 

 

 

 

 

Basically what I am trying to do is figure out a workaround for the fact that reports do not have in-line editing. What I've done so far is import from salesforce all my opportunities by stages (a very long, manual process). The administrator can now edit reports in-line, and it will automatically change the opportunities. The problem with this though, is that the rest of the organization uses salesforce to enter new opportunities, and the administrator will not be able to see these changes unless he  uses query to update at a certain interval of time. Is there any way to avoid this?

Here's the situation:

 

I have a visualforce page that is accessed from a button on Account. Lets call this mainPage.

What should happen is that this page opens several other visualforce pages, several subPages.

Each subpage corresponds to a specific record. The mainPage will somehow query to find the id's of the record each subpage references (ie. salesforce.com/apex/subpage?id=1234567). And then somehow the mainpage would open each link.

 

Here's the problem:

I dont know how to open multiple windows.

I have a few ideas/observations:

- I dont believ I can use the controller - there is no way to pass the id's to the visualforce page, and my attempts at a 'hack' using escape=false failed

- I think I can do this using Javascript, except I'm not sure I could query to find the id's I need to open these new windows

- I dont understand what Ajax is, but I have a feeling it allows me to do this?

- if I cant do this could I somehow call an apex method in the controller class to pass the id's to javascript on the visualforce page?

- is there anyway of opening a page referencing a specific id without using urls? slightly annoying.

 

I'm obviously a little confused and not certain how all these components play together in salesforce. If you could advise me on this I'd very much appreciate it.

Here's what I want to happen:

 

From the object account a user clicks a button called "generate line summaries".

 

(Background: Each Account can have several "lines", a line is an object with a lookup field to the account.)

 

So when the user clicks the button, a line summary(a visualforce page), is generated for each line associated with the account.

 

The way I've been trying is to have one visualforce page created which creates several iframes, but with iframes you can only hard-code the source. I need a way that will work with any number of lines.

I wrote an overcomplicated piece of code in an apex extension that creates a string which I want to act as code and be proceessed as visualforce. Unfortunately, it is just displayed as text. I'll give an example:

 

public String gettester() {
return '<b> Something: </b>';
}

 

I want this to return Something: but instead it'll return <b> Something: </b>.

Is there anyway to obtain the result I want?

Is there anyway to create a visualforce page that will create a document in excel with tabs?

I want to create a visualforce page which displays some data. 

 

The standard controller is Phone Line, a custom object.

 

Each opportunity has multiple phone lines. In each phone line there is a lookup field to the opportunity it is related to.

 

I want to be able to display data from the opportunity that the current phone line is related to.

 

For example, from a particular phone line record, the user should click a button to get to the visualforce page which should display information about the opportunity the phone line is related to.

 

I'm very new to this, and from my limited understanding, I believe that I would have to either write a custom controller, or an extension in apex. Your help would be appreciated

What I've done is attempt to write code to attach files from the "Notes and Attachments"  list into an email that automatically sends when the opportunity stage changes to 'Send Request'. I set the target object ID to a contact to whom I wish to send the email to. I am using a template which has merge fields from opportunity. Whats currently happening is that the email is being sent to the owner of the contact, and not the contact himself. Also the attachment is not attaching, so apparently nothing is going right. Advice/criticism is much appreciated

 

 

 

trigger sendEmailAlert on Opportunity (after update) {

for(opportunity o:Trigger.new){
if(o.Stagename == 'Send Request'){
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();

Attachment[] queryAttachment = [select Name from Attachment where Parentid=:'accountId' order by CreatedDate DESC];

Messaging.EmailFileAttachment[] allAttachments = new Messaging.EmailFileAttachment[queryAttachment.size()];
        for(integer i=0;i<queryAttachment.size();i++)
        {
            Messaging.EmailFileAttachment fileAttachment = new Messaging.EmailFileAttachment();
            fileAttachment.setBody(queryAttachment[i].Body);
            fileAttachment.setFileName(queryAttachment[i].Name);
            allAttachments[i] =  fileAttachment;
        } 
        
        mail.setFileAttachments(allAttachments);
        mail.setTemplateID('00XQ0000000QHJS');
        mail.setTargetObjectID('003Q000000BQKyk');
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });


}
}
}

 

I am attempting to write a trigger that fires at a specific stage of a opportunity. I feel like this is really stupid but salesforcce isnt allowing me to refer to the current stage as Opportunity.stagename

What am I doing wrong

Hey all, 

 

I need your help with trying to create a function that sends emails on a recurring basis. I called support but they werent very clear on how I could do this, so I'm turning to you for help. 


My function should send an email to the assigned user every 2 hour if the case priority is high and the status is new

 

So far I've tried the following but I believe it will not work:

 

 

trigger alertUser on Case (after update, after insert) {
datetime now = datetime.now();
datetime created = case.Createddate;
If (math.mod(datetime.getTime(created)  -  datetime.getTime(now), 7200000) == 0){
//send email
}
} 

 Thanks in advance

 

I'm trying to create a trigger to send an email with an attachment from the "notes and attachments'" object. However it wont compile and give the error: Method does not exist or incorrect signature: ISPICKVAL(Schema.SObjectField, String) at line 3 column 5. I've been banging my head against my desk for the better part of half an hour trying to figure this out. please help.

 

trigger sendEmailAlert on Opportunity (after insert, after update) {

if (ISPICKVAL(opportunity.stagename, 'Send Rebecca Request')){
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();

Attachment[] queryAttachment = [select Name from Attachment where Parentid=:'accountId' order by CreatedDate DESC];

Messaging.EmailFileAttachment[] allAttachments = new Messaging.EmailFileAttachment[queryAttachment.size()];
        
        
        for(integer i=0;i<queryAttachment.size();i++)
        {
        
        
            Messaging.EmailFileAttachment fileAttachment = new Messaging.EmailFileAttachment();
            fileAttachment.setBody(queryAttachment[i].Body);
        
        
        
            fileAttachment.setFileName(queryAttachment[i].Name);
            allAttachments[i] =  fileAttachment;
        }