You need to sign in to do that
Don't have an account?
Jasjeet 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:
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?
Hope below link is helpful for your Query
https://salesforce.stackexchange.com/questions/280327/apex-class-to-generate-pdf-and-save-it-in-attachement
Hope you find your solution.
Thanks