• mikechayes
  • NEWBIE
  • 5 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 3
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
Summary
I work on a managed package that has been around for some time now.  I am in the process of moving our development team to scratch orgs with VS Code.  However, our namespace does not appear to be moving correctly from the Packaging org or into the Scratch org.

Here are my steps
  • From within VS Code I execute “SFDX: Create Project”
  • I updated the project-scratch-def.json and sfdx-project.json files.
project-scratch-def.json
{
  "orgName": "Scratch Org",
  "edition": "Developer",
  "release": "",
  "adminEmail": "mike@mike.com",
  "features": [],
  "namespace": "WAVY"
}
sfdx-project.json
{
  "packageDirectories": [
    {
      "path": "force-app",
      "default": true
    }
  ],
  "namespace": "WAVY",
  "sfdcLoginUrl": "https://login.salesforce.com",
  "sourceApiVersion": "47.0"
}
  • From within VS Code I execute “SFDX: Create a Default Scratch Org…”
  • I confirm the namespace is in the Scratch org with “SELECT NamespacePrefix FROM Organization”.
  • I retrieve the metadata from the managed package with:
sfdx force:mdapi:retrieve -s -r ./mdapipkg -u mike@mail.com -p WAVYPackage
  • I unzip unpackaged.zip and convert with:
sfdx force:mdapi:convert --rootdir  ./mdapipkg
 
  • I review the code Lightning component file. The namespace is removed from all sobjectType in the Scratch org.
<aura:attribute name="Batch" type="Batch__c" access="GLOBAL" default="{ sobjectType: 'Batch__c' }" />  
<force:inputField aura:id="hiddenLookup" value="{!v.Batch.WAVY__DefaultChartofAccounts__c}" class="slds-hide" />
  • In the Packaging org this same code looks like:
<aura:attribute name="Batch" type="WAVY__Batch__c" access="GLOBAL" default="{ sobjectType: 'WAVY__Batch__c' }" />  
<force:inputField aura:id="hiddenLookup" value="{!v.Batch.WAVY__DefaultChartofAccounts__c}" class="slds-hide" />
  • When the lightning page is executed in the Scratch org I get the following error:
aura://ComponentController: org.auraframework.throwable.AuraExecutionException: ui.force.components.controllers.field.InputFieldProvider: org.auraframework.throwable.AuraRuntimeException: Error Retrieving Field for: v.batch.WAVY__DefaultChartofAccounts__c
  • If I add back the “WAVY__” namespace to the object in the Scratch Org, the code executes without error.
VS Code Version:
1.42.0
SFDX CLI Version:
47.18.0
OS and version:
Windows 10

Any input would be greatly appreciated.

Thank you.
Mike


 
Summary
I work on a managed package that has been around for some time now.  I am in the process of moving our development team to scratch orgs with VS Code.  However, our namespace does not appear to be moving correctly from the Packaging org or into the Scratch org.

Here are my steps
  • From within VS Code I execute “SFDX: Create Project”
  • I updated the project-scratch-def.json and sfdx-project.json files.
project-scratch-def.json
{
  "orgName": "Scratch Org",
  "edition": "Developer",
  "release": "",
  "adminEmail": "mike@mike.com",
  "features": [],
  "namespace": "WAVY"
}
sfdx-project.json
{
  "packageDirectories": [
    {
      "path": "force-app",
      "default": true
    }
  ],
  "namespace": "WAVY",
  "sfdcLoginUrl": "https://login.salesforce.com",
  "sourceApiVersion": "47.0"
}
  • From within VS Code I execute “SFDX: Create a Default Scratch Org…”
  • I confirm the namespace is in the Scratch org with “SELECT NamespacePrefix FROM Organization”.
  • I retrieve the metadata from the managed package with:
sfdx force:mdapi:retrieve -s -r ./mdapipkg -u mike@mail.com -p WAVYPackage
  • I unzip unpackaged.zip and convert with:
sfdx force:mdapi:convert --rootdir  ./mdapipkg
 
  • I review the code Lightning component file. The namespace is removed from all sobjectType in the Scratch org.
<aura:attribute name="Batch" type="Batch__c" access="GLOBAL" default="{ sobjectType: 'Batch__c' }" />  
<force:inputField aura:id="hiddenLookup" value="{!v.Batch.WAVY__DefaultChartofAccounts__c}" class="slds-hide" />
  • In the Packaging org this same code looks like:
<aura:attribute name="Batch" type="WAVY__Batch__c" access="GLOBAL" default="{ sobjectType: 'WAVY__Batch__c' }" />  
<force:inputField aura:id="hiddenLookup" value="{!v.Batch.WAVY__DefaultChartofAccounts__c}" class="slds-hide" />
  • When the lightning page is executed in the Scratch org I get the following error:
aura://ComponentController: org.auraframework.throwable.AuraExecutionException: ui.force.components.controllers.field.InputFieldProvider: org.auraframework.throwable.AuraRuntimeException: Error Retrieving Field for: v.batch.WAVY__DefaultChartofAccounts__c
  • If I add back the “WAVY__” namespace to the object in the Scratch Org, the code executes without error.
VS Code Version:
1.42.0
SFDX CLI Version:
47.18.0
OS and version:
Windows 10

Any input would be greatly appreciated.

Thank you.
Mike


 

Ultimately I am wanting to create a custom field called PO Received Month which pulls the month of the PO Received Date field, but in text format, not number format.

 

Currently this is the formula I put in the Formula Text field but its spitting out "4" for April and "5" for May and I want it to read "April" and "May".

 

 

TEXT(( YEAR( PO_Received_Date__c )))

 Thanks in advance!