Skip to content

Instantly share code, notes, and snippets.

@j-schreiber
Created July 9, 2020 06:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save j-schreiber/fce8380e5368173fea876626ff21f5e7 to your computer and use it in GitHub Desktop.
Save j-schreiber/fce8380e5368173fea876626ff21f5e7 to your computer and use it in GitHub Desktop.
Dynamic component property on the pdf controller class
public static Component.Apex.PageBlock DynamicAddress {
public get {
if (DynamicAddress == null && Template != null && String.isNotBlank(Template.AddressFormatting__c)) {
DynamicAddress dynAddr = new DynamicAddress(Template.AddressFormatting__c);
dynAddr.RecordVariableName = 'QuoteRecord';
DynamicAddress = dynAddr.getAddressAsPageBlock();
}
return DynamicAddress;
}
private set;
}
<apex:dynamicComponent componentValue="{! DynamicAddress }" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment