You need to sign in to do that
Don't have an account?
Mahmoud Abdelsalam
Passing dynamic parameters to force:canvasapp in Lightening Component
Hello All ,
I need to pass dynamic parameter to force:canvasapp , i tried the following code but actually it does not work :
Controller : here i retrieve some specific data from account standard controller , and i have a property named customerData in order to save a json formatted string .
looking forward to your valuable response ,Thank you much !
I need to pass dynamic parameter to force:canvasapp , i tried the following code but actually it does not work :
Controller : here i retrieve some specific data from account standard controller , and i have a property named customerData in order to save a json formatted string .
public with sharing class CustomerDataController { public String customerData { get; set; } // Constructor method for the controller public CustomerDataController (ApexPages.StandardController stdController) { Account account = (Account)stdController.getRecord(); account = [SELECT Name, AccountNumber, BillingStreet, BillingCity, BillingState, BillingPostalCode, BillingCountry FROM Account WHERE Id = :account.Id][0]; String accountNumber = account.AccountNumber == null ? '' : account.AccountNumber; String billingStreet = account.BillingStreet == null ? '' : account.BillingStreet; JSONGenerator gen = JSON.createGenerator(true); gen.writeStartObject(); gen.writeStringField('AccountNumber', accountNumber ); gen.writeStringField('AccountStreet', billingStreet); gen.writeEndObject(); customerData = gen.getAsString(); } }Lightening Component
<aura:component implements ="force:lightningQuickAction"> <force:canvasApp scrolling="auto" applicationName="Development Canvas" developerName="Development_Canvas" width="1200" height="1200" maxWidth="infinite" maxHeight="infinite" parameters="{!customerData}" /> </aura:component>
looking forward to your valuable response ,Thank you much !