• Rick PST Admin
  • NEWBIE
  • 50 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 18
    Replies

I have a visualforce page rendered as a PDF called "Agreement" that is generated from a button on a custom object called "Agreements". The "Agreements" object has a field that identifies the Account (standard SF object) the Agreement is associated with. When saving or downloading the PDF, the name of the file is always the name of the visualforce page (Agreement.pdf). How can I define the file name when saved or downloaded as the following:

Account: Demo Tech,LLC.

Save PDF filename: Demo Tech,LLC._Agreement_Today's Date

PS. I know this has been asked before by others, but the apex class "solutions" I've read did not work for me. 

How can I create the exact image below on my visualforce page rendered as PDF? "ABC INDUSTRIES, INC." will autopopulate from the Account Name of the record from the custom object, however I would like the account name to appear bold and in ALL CAPS as seen in the image.

User-added image
I created for a custom object (Demo__c) with a button that will render the record as a Visualforce Page PDF. I have a Master-Detail field in the Demo object that lookup the standard Account object. When I added the following code {!Demo__c.Account__c} and generated the PDF, it shows up in the PDF as the Account ID opposed to the Name displayed on the object. See PDF Example below: 

PDF Example: "We are proud to announce that we now have a partnership with {!Demo__c.Account__c} (01214141421241b <--should display the Account name) for 3 years."

How can I have it display Account name AND the respective Account's BillingAddress?  
I created a button on my custom object (Education__c) that creates a PDF for that record. I am trying to code my visualforce (PDF) page so that when the value "Other" is selected from the State__c picklist field, "Other" will not display on the PDF. For exmaple:

Picklist Values:
MD
DC
VA
Other

IF "Other" is selected, the State (picklist) field is left Blank when the pdf is generated. 
I created a WFR formula that automatically inputs/updates (project expiration) Date fields based on the picklist value that is selected. I also created a time-based WFR that sends email alerts 30, 60,90 days prior to that Date. Is there a way that I can set the email alerts to only go to a specific group of users based on the picklist value that is selected?

Example:
IF Picklist Value = Project A or Project B or Project C
    Send the 30 day (60 or 90 depending on the expiration Date field) email alert to User 1 and  User 2 ONLY

IF Picklist Value = Project D or Project E or Project F
      Send the 30 day (60 or 90 depending on the expiration Date field) email alert to User 3 and User 4 ONLY

This is my current Time Based Workflow Rule:
Description: Notifies management 30/60/90 days prior to Project#1 Exp Date
Rule Criteria: Project: Project #1 Exp Date NOT EQUAL TO null

Time-Dependent Workflow Actions
Email Alert Alert 90 days before Project#1 Exp Date
Email Alert Alert 60 days before Project#1 Exp Date
Email Alert Alert 30 days before Project#1 Exp Date
The link below is my original post that was answered. However, when I enter the complete advance formula for my Date formula field I get "Error: Compiled formula is too big to execute (8,069 characters). Maximum size is 5,000 characters". I have over 70+ picklist values with long names that have to be displayed completely and each value has a corresponding date. Abbreviating is not an option. I spoke with a SF dev support analyst and was told that a possible solution maybe to create an Apex Trigger. 

Ex. PIcklist Values: Test, Demo, Draft

If Test; then date value = 12/1/2018
If Demo, then date value = 11/1/2018
If Draft then, date value = 10/1/2018

This is the code I used for testing purposes for the Date formula field. 
CASE(TEXT( Project1__c ), 'Test1', DATE(2018,12,02),'Test2', DATE(2018,11,02), null)

https://developer.salesforce.com/forums/ForumsMain?id=9060G000000Xj73QAC#!/feedtype=SINGLE_QUESTION_SEARCH_RESULT&id=9060G000000MVBiQAO

 
I've created a VF page and I'm trying to get the selected multi-picklist values to display as a vertical list opposed to a single string. 
Selected values are displaying as "Value1; Value2; Value3". I would like the values in a list with bullets.
  •  Value1
  •  Value2
  •  Value3

I found a a forum with this same issue but its not working for me. - https://developer.salesforce.com/forums/?id=906F0000000BGyzIAG

Here is the code that I am using. 
<td>
      <apex:outputField value="{!Employee_Profile__c.Professional_Certifications__c}"> <p id="demo"></p>
      </apex:outputField>
</td>    

 <script>
        var myString = '{!Employee_Profile__c.Professional_Certifications__c}';
        var res = myString.replace(new RegExp(';', 'g'), '<br/>');
        document.getElementById("demo").innerHTML =res;        
</script>  
 
    </table>      

</apex:page>
I am trying to create a trigger that will auto populate a date field when a picklist value is selected. I'm trying to achieve this without creating another custom object. 

Ex. PIcklist Values: Test, Demo, Draft

If Test; then date value = 12/1/2018
If Demo, then date value = 11/1/2018
If Draft then, date value = 10/1/2018
I'm creating a VF page for employees to create a record for a custom object. I'm having issues writing the redirect Apex code so that after they hit "Submit", the employees will be redirected to another VF page (that I've created called "SuccessPage") that says "Your profile has been submitted successfully". After five seconds the SuccessPage it automatically redirect to the company's website. But if the employee hits Cancel, it will close the VF page.

Record Code
<apex:page standardController="Object__c"> 
<apex:form >

<div class="header">
    <center><img src="{!$Resource.companylogo}" width="10%"/></center>
  </div> 
 
        <style>
            body .bPageBlock .pbBody .blue .pbSubheader{
                background-color:#154f82;
            
            }
            body .bPageBlock .pbBody .white .pbSubheader h3{
                color:#ffffff;
            }
        </style>
        

<apex:outputPanel styleClass="blue" layout="block">
      <apex:pageBlockSection title="Skills" id="section7">
       <apex:inputField value="{!Employee_Profile__c.Skills__c}"/>        
</apex:pageBlockSection>
</apex:outputPanel>

</apex:pageBlock>

<center><apex:commandButton value="Submit" action="{!save}"/><apex:commandButton value="Cancel" action="{!cancel}"/></center> 


  </apex:form>
</apex:page>
Success VF page
<apex:page >
    <h1>Success</h1>

  
  <script type="text/javascript">
    window.setTimeout("redirectpage();", 5000);    
    function redirectpage(){
    window.top.location.href = 'http://www.website.com';
    }
</script>
</apex:page>




 

I have a visualforce page rendered as a PDF called "Agreement" that is generated from a button on a custom object called "Agreements". The "Agreements" object has a field that identifies the Account (standard SF object) the Agreement is associated with. When saving or downloading the PDF, the name of the file is always the name of the visualforce page (Agreement.pdf). How can I define the file name when saved or downloaded as the following:

Account: Demo Tech,LLC.

Save PDF filename: Demo Tech,LLC._Agreement_Today's Date

PS. I know this has been asked before by others, but the apex class "solutions" I've read did not work for me. 

I'm creating a VF page for employees to create a record for a custom object. I'm having issues writing the redirect Apex code so that after they hit "Submit", the employees will be redirected to another VF page (that I've created called "SuccessPage") that says "Your profile has been submitted successfully". After five seconds the SuccessPage it automatically redirect to the company's website. But if the employee hits Cancel, it will close the VF page.

Record Code
<apex:page standardController="Object__c"> 
<apex:form >

<div class="header">
    <center><img src="{!$Resource.companylogo}" width="10%"/></center>
  </div> 
 
        <style>
            body .bPageBlock .pbBody .blue .pbSubheader{
                background-color:#154f82;
            
            }
            body .bPageBlock .pbBody .white .pbSubheader h3{
                color:#ffffff;
            }
        </style>
        

<apex:outputPanel styleClass="blue" layout="block">
      <apex:pageBlockSection title="Skills" id="section7">
       <apex:inputField value="{!Employee_Profile__c.Skills__c}"/>        
</apex:pageBlockSection>
</apex:outputPanel>

</apex:pageBlock>

<center><apex:commandButton value="Submit" action="{!save}"/><apex:commandButton value="Cancel" action="{!cancel}"/></center> 


  </apex:form>
</apex:page>
Success VF page
<apex:page >
    <h1>Success</h1>

  
  <script type="text/javascript">
    window.setTimeout("redirectpage();", 5000);    
    function redirectpage(){
    window.top.location.href = 'http://www.website.com';
    }
</script>
</apex:page>




 

I have a visualforce page rendered as a PDF called "Agreement" that is generated from a button on a custom object called "Agreements". The "Agreements" object has a field that identifies the Account (standard SF object) the Agreement is associated with. When saving or downloading the PDF, the name of the file is always the name of the visualforce page (Agreement.pdf). How can I define the file name when saved or downloaded as the following:

Account: Demo Tech,LLC.

Save PDF filename: Demo Tech,LLC._Agreement_Today's Date

PS. I know this has been asked before by others, but the apex class "solutions" I've read did not work for me. 

How can I create the exact image below on my visualforce page rendered as PDF? "ABC INDUSTRIES, INC." will autopopulate from the Account Name of the record from the custom object, however I would like the account name to appear bold and in ALL CAPS as seen in the image.

User-added image
I created for a custom object (Demo__c) with a button that will render the record as a Visualforce Page PDF. I have a Master-Detail field in the Demo object that lookup the standard Account object. When I added the following code {!Demo__c.Account__c} and generated the PDF, it shows up in the PDF as the Account ID opposed to the Name displayed on the object. See PDF Example below: 

PDF Example: "We are proud to announce that we now have a partnership with {!Demo__c.Account__c} (01214141421241b <--should display the Account name) for 3 years."

How can I have it display Account name AND the respective Account's BillingAddress?  
The link below is my original post that was answered. However, when I enter the complete advance formula for my Date formula field I get "Error: Compiled formula is too big to execute (8,069 characters). Maximum size is 5,000 characters". I have over 70+ picklist values with long names that have to be displayed completely and each value has a corresponding date. Abbreviating is not an option. I spoke with a SF dev support analyst and was told that a possible solution maybe to create an Apex Trigger. 

Ex. PIcklist Values: Test, Demo, Draft

If Test; then date value = 12/1/2018
If Demo, then date value = 11/1/2018
If Draft then, date value = 10/1/2018

This is the code I used for testing purposes for the Date formula field. 
CASE(TEXT( Project1__c ), 'Test1', DATE(2018,12,02),'Test2', DATE(2018,11,02), null)

https://developer.salesforce.com/forums/ForumsMain?id=9060G000000Xj73QAC#!/feedtype=SINGLE_QUESTION_SEARCH_RESULT&id=9060G000000MVBiQAO

 
I've created a VF page and I'm trying to get the selected multi-picklist values to display as a vertical list opposed to a single string. 
Selected values are displaying as "Value1; Value2; Value3". I would like the values in a list with bullets.
  •  Value1
  •  Value2
  •  Value3

I found a a forum with this same issue but its not working for me. - https://developer.salesforce.com/forums/?id=906F0000000BGyzIAG

Here is the code that I am using. 
<td>
      <apex:outputField value="{!Employee_Profile__c.Professional_Certifications__c}"> <p id="demo"></p>
      </apex:outputField>
</td>    

 <script>
        var myString = '{!Employee_Profile__c.Professional_Certifications__c}';
        var res = myString.replace(new RegExp(';', 'g'), '<br/>');
        document.getElementById("demo").innerHTML =res;        
</script>  
 
    </table>      

</apex:page>
I am trying to create a trigger that will auto populate a date field when a picklist value is selected. I'm trying to achieve this without creating another custom object. 

Ex. PIcklist Values: Test, Demo, Draft

If Test; then date value = 12/1/2018
If Demo, then date value = 11/1/2018
If Draft then, date value = 10/1/2018
I'm creating a VF page for employees to create a record for a custom object. I'm having issues writing the redirect Apex code so that after they hit "Submit", the employees will be redirected to another VF page (that I've created called "SuccessPage") that says "Your profile has been submitted successfully". After five seconds the SuccessPage it automatically redirect to the company's website. But if the employee hits Cancel, it will close the VF page.

Record Code
<apex:page standardController="Object__c"> 
<apex:form >

<div class="header">
    <center><img src="{!$Resource.companylogo}" width="10%"/></center>
  </div> 
 
        <style>
            body .bPageBlock .pbBody .blue .pbSubheader{
                background-color:#154f82;
            
            }
            body .bPageBlock .pbBody .white .pbSubheader h3{
                color:#ffffff;
            }
        </style>
        

<apex:outputPanel styleClass="blue" layout="block">
      <apex:pageBlockSection title="Skills" id="section7">
       <apex:inputField value="{!Employee_Profile__c.Skills__c}"/>        
</apex:pageBlockSection>
</apex:outputPanel>

</apex:pageBlock>

<center><apex:commandButton value="Submit" action="{!save}"/><apex:commandButton value="Cancel" action="{!cancel}"/></center> 


  </apex:form>
</apex:page>
Success VF page
<apex:page >
    <h1>Success</h1>

  
  <script type="text/javascript">
    window.setTimeout("redirectpage();", 5000);    
    function redirectpage(){
    window.top.location.href = 'http://www.website.com';
    }
</script>
</apex:page>




 
Hi i am having a custom button,which when clicked generates the PDF and saves it in attachment.
Now i am trying to make it as email too.
so when the custom button is clicked,generate pdf ,save the pdf to attachment and email it to particular user email.

How can i do it?Can i do it on single button?Or do i need two buttons. 1 .generate and save
2.email pdf?
I am confused and struck here .I am able to generate it and save as attachment.
But i want all three steps(generate,save and email) in single button.Please help.
Thanks in advance.