• Chance Hoskins KU
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 2
    Questions
  • 0
    Replies
I would like to be able to create a record using the standard page layout, but I would like to also allow the addition of a custom component to that page layout. 

Currently , it seems that the only way to get custom components is to create a completely new component and code in the individual fields into that component. I don't like this solution because it makes it difficult to maintain.

However, if I wanted to require information from my custom component, I have no way of doing that with a standard creation/edit page layout.

Is it possible to add a custom component to a page layout, or even add a page layout to a custom component so I don't have to hard code the fields?
For some reason, when I create code within a scratch org, I will often get this error. I've tried troubleshooting it, and it appears to be something related to either a component bundle or a class, but it's impossible to determine which ones. The only work around that I have been able to accomplish is to copy/paste the code to notepad and delete the bundle and class from the scratch org.
I'm running on windows 10, sfdx version 6.1.19, and getting an error when I try to pull source froma scratch org.  I feel like I've tracked it down to some code in node_modules\sfdx-cli\node_modules\salesforce-alm\dist\lib\typeDefUtil.js  which seems to assume a POSIX path seperator.  The parameter auraBundleFileProperties is an array of objects representing file properties.  The fullName property doesn't seem consistent in what path separator is being used.  Sometimes it's '/', Sometimes it's '\' -- I was able to solve the issue by changing the line

            const parentBundle = auraBundleFileProperties.find(fileProperty => fileProperty.fullName.split(path.sep)[0] === bundleName);

to

            const parentBundle = auraBundleFileProperties.find(fileProperty => path.normalize(fileProperty.fullName).split(path.sep)[0] === bundleName);

That seemed to work, but I've obviously hacked the original code delivered by SF... Has anyone else run into this issue?

The function was originally written as...
static getDefaultAggregateMetadataPath(devName, typeDef, defaultSrcDir, metadataRegistry, auraBundleFileProperties) {
        let metadataPath;
        const defaultTypeDir = !util.isNullOrUndefined(typeDef.defaultDirectory) ?
            path.join(defaultSrcDir, typeDef.defaultDirectory) : defaultSrcDir;
        if (typeDef.metadataName === metadataRegistry.typeDefs.AuraDefinitionBundle.metadataName) {
            const bundleName = devName.split(path.sep)[0];
            const parentBundle = auraBundleFileProperties.find(fileProperty => fileProperty.fullName.split(path.sep)[0] === bundleName);
            const fileName = `${path.basename(parentBundle.fileName)}${metadataRegistry.metadataFileExt}`;
            metadataPath = path.join(defaultTypeDir, bundleName, fileName);
        }
       .... more code.....
}