function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jasjeet GrewalJasjeet Grewal 

Generating pdf from visualforce invoked from apex class

Hi All,

I am calling a static method of a class from another class. I can only invoke a static method not a constructor to assign values to properties of a class.

Now, I want to assign values to properties of a class. These properties will be accessed by VF using getter.

Here's a brief code:
public with sharing class PdfGenerator {

    public Order__c orderVF {get; set;}
    public List<Order_Line_Item__c>orderLineItemsVF {get; set;}

public static void generateOrderPDF(ID OrderID){
        Order__c order = [SOQL];
        Order_Line_Item__c orderLineItem = [SOQL];

       //how to pass this variable value to class properties orderVF and orderLineItemsVF?
       //I am basically calling this static method from another class. PdfGenerator.generateOrderPDF(Id);

any idea how can i pass value to class properties from within static method of a class?
Suraj Tripathi 47Suraj Tripathi 47
Hi Jesjeet, 
Hope below link is helpful for your Query

Hope you find your solution.