Skip to content

Instantly share code, notes, and snippets.

@lfreeland
Created April 9, 2018 02:58
Show Gist options
  • Save lfreeland/c3a6f6d340aa8165a936801b29319e73 to your computer and use it in GitHub Desktop.
Save lfreeland/c3a6f6d340aa8165a936801b29319e73 to your computer and use it in GitHub Desktop.
Page Layout Record Display Lightning Component Helper
({
retrievePageLayout : function(component, helper) {
var action = component.get("c.getPageLayoutMetadata");
var pageLayoutName = component.get("v.PageLayoutName");
console.log("pageLayoutName: " + pageLayoutName);
var actionParams = {
"pageLayoutName" : pageLayoutName
};
action.setParams(actionParams);
action.setCallback(this, function(response){
var state = response.getState();
console.log("callback state: " + state);
if (component.isValid() && state === "SUCCESS") {
var pageLayout = response.getReturnValue();
console.log("pageLayout: " + pageLayout.toString());
component.set("v.PageLayout", pageLayout);
}
});
$A.enqueueAction(action);
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment