• Breandan McCann
  • NEWBIE
  • 30 Points
  • Member since 2021

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 1
    Replies
Hi,

Is it possible to force an image pasted into a rich text field to be displayed at a certian size when rendered as a pdf?
No matter what size of an image pasted in by the user i need it to be locked to the size designated by the code.

Thanks

Hi, 
 

I am completely new to developing and im trying to create a custom quote for the company i work at.

I managed to find code i could use to display the related opportunity line items but for it displays the line item with the opportunity name before it.

User-added image

Below is the code

public class CreateQuoteClass {    
public String opportunitystringId {get;set;}
public List<Opportunity> opportunityList {get;set;}
public List<quotewrapper> quotewrapperlist {get;set;}
public List<OpportunityLineItem> oliList{get;set;}
    
    public class quotewrapper
    {
        public Boolean isChecked {get;set;}
        public OpportunityLineItem oliresult {get;set;}
        
        public quotewrapper(Boolean isChecked, OpportunityLineItem oliresult)
        {
            This.isChecked = isChecked;
            This.oliresult = oliresult;
        } 
    }   
    
    public CreateQuoteClass(ApexPages.StandardController controller)
    {
        try{
            quotewrapperlist = new List<quotewrapper>();
            opportunitystringId  = ApexPages.CurrentPage().getparameters().get('Id');
            
            if(opportunitystringId!=null)
            {
                opportunityList = [SELECT Id,Name,CloseDate,AccountId,Pricebook2Id from Opportunity WHERE Id =:opportunitystringId];
                oliList = [Select Id,Name,Quantity,OpportunityId,UnitPrice,Product2Id,PricebookentryId,TotalPrice from OpportunityLineItem WHERE OpportunityId =:opportunitystringId];
            }
            
            if(oliList.size()>0)
            {
                for(OpportunityLineItem olObj:oliList)
                {
                    quotewrapper qobj =  new quotewrapper(false, olObj);
                    quotewrapperlist.add(qobj);
                }
            }
        }
        catch(Exception e)
        {
            System.debug('The following exception has occurred: ' + e.getMessage());
        }
        
    }
    

}


Visualforce Page
        <apex:pageBlock >
            <apex:pageBlockTable var="qi" value="{!quotewrapperlist}" id="quoteitem">
                <apex:column headerValue="Additional Options" value="{!qi.oliresult.name}"/>
                <apex:column headerValue="Quantity" value="{!qi.oliresult.Quantity}"/>
                <apex:column headerValue="Sales Price" value="{!qi.oliresult.Unitprice}"/>
                <apex:column headerValue="Total Price" value="{!qi.oliresult.TotalPrice}"/>
            </apex:pageBlockTable>
        </apex:pageBlock><br/><br/>
    

Hi,

I have a header on the second page.

This page is where i will display the opportunity line items, the header for this page is different from the header displayed on the pages following it. The problem is however, if the opportunity line items spill onto the third page then that header needs to go with it. The header is a static resource image. The footer then also needs to be displayed on the bottom of the page. It also is a static resource image.

I can paste my code if necessary however I'm very new to this and I'm sure it is full of mistakes haha.
I have a header on the second page.

This page is where i will display the opportunity line items, the header for this page is different from the header displayed on the pages following it. The problem is however, if the opportunity line items spill onto the third page then that header needs to go with it. The header is a static resource image. The footer then also needs to be displayed on the bottom of the page. It also is a static resource image.

I can paste my code if necessary however I'm very new to this and I'm sure it is full of mistakes haha.
Hi, 

So are company have a very custom quote process so ive been trying to design my own visualforce page that renders as a pdf.

What im struggling with is, how do i add opportunity line items to a visualforce page?

Also i have a header on the second page. This page is where i will display the opportunity line items, the header for this page is different from the header dispalayed on the third page. The problem is however, if the opportunity line items spill onto the third page then that header needs to go with it. The header is a static resource image.

I can post my code in if needed but it is filled with a lot of display text (and is probably embarassingly inefficent and filled with errors) 

I would be extreamly grateful of anyones help.
Hi,

This is more of a question of where do i even start nevermind how to do it, haha


Basically what we want to happen is,
 
  1. Customer scans QR code and in the URL will be the ID of that corresponding machine(asset) on salesforce.
  2. It will need to call this record and get the data from salesforce and pre-fill a form on the company website from this data

Basically I need help on what way to go about this.

Will i need to find someone to build a script from scratch that will use the url and call on salesforce api to pull the data and prepopulate the form. I am not familliar with coding so i dont even know if this is possible.


Is there any easier ways that you guys can think of?