• Andrew Weinstein
  • NEWBIE
  • 15 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 12
    Replies
as part of a scratch org setup script, i'm trying to create and/or modify records through the tooling API - things like remote site settings, outbound messages, etc. these objects all have required "Metadata" fields.

using a remote site setting as an example: if i do this through the restforce gem for ruby, it works fine. i can execute:
resp = sf.create!('RemoteProxy', Metadata: {disableProtocolSecurity: false, isActive: true, url: 'https://www.my-site.com', urls: nil, description: nil}, FullName: 'test_remote_site')
and it creates the site correctly. if i try to do this through the CLI, though:
sfdx force:data:record:create -t -s RemoteProxy -v "FullName='test_remote_site' Metadata='{"disableProtocolSecurity":false,"isActive":true,"url":"https://www.my-site.com","urls":null,"description":null}'"
it fails with error: "Cannot deserialize instance of complexvalue from null value null or request may be missing a required field." I get the same result if I serialize the JSON. The data I'm providing is the same, so the problem isn't with the data or the API itself; it seems like either I'm not using the correct format, or something in the CLI is not serializing the JSON and/or building the request correctly.

Anyone else encounter a similar problem or find a workaround? In what format am I supposed to provide the metadata for a request like this?

 
we're trying to start using salesforce DX with our existing managed packages. i started with a small package - no custom objects, a few custom fields, one custom setting, a few apex classes, one VF page, and one VF component - and everything went pretty smoothly. i was able to convert the metadata, set up a scratch org, push/pull source, etc.

when i tried this with our main managed package, which is much larger, i ran into all kinds of errors trying to do force:source:push. the pretty-printed JSON output of the errors from the CLI command is almost 33,000 lines long. a few of the errors are known issues (e.g. having history tracking enabled), but the rest are things like "referenceTo value of 'Custom_Object__c' does not resolve to a valid sObject type," when "Custom_Object__c" is one of the custom objects included in the source i'm trying to push. there are a bunch of similar things like "Field Custom_Field__c does not exist," "In field: field - no CustomField named Custom_Object__c.Custom_Field__c found," "Invalid type: Custom_Object__c," etc.

i don't know how to determine the source of all of these errors. i've tried most of the things i've found on here already, like enabling external sharing, pushing with --ignorewarnings, etc., and none of it has made any difference.

FWIW, i've also noticed that the metadata i get from force:mdapi:retrieve is missing certain things, like view all permissions on Account in one of our custom profiles. this generates a few errors, but the vast majority remain even after fixing that. maybe that's an entirely separate issue, but it seems worth mentioning.

has anyone else encountered problems like this? any suggestions about where i should look to find the source?
as part of a scratch org setup script, i'm trying to create and/or modify records through the tooling API - things like remote site settings, outbound messages, etc. these objects all have required "Metadata" fields.

using a remote site setting as an example: if i do this through the restforce gem for ruby, it works fine. i can execute:
resp = sf.create!('RemoteProxy', Metadata: {disableProtocolSecurity: false, isActive: true, url: 'https://www.my-site.com', urls: nil, description: nil}, FullName: 'test_remote_site')
and it creates the site correctly. if i try to do this through the CLI, though:
sfdx force:data:record:create -t -s RemoteProxy -v "FullName='test_remote_site' Metadata='{"disableProtocolSecurity":false,"isActive":true,"url":"https://www.my-site.com","urls":null,"description":null}'"
it fails with error: "Cannot deserialize instance of complexvalue from null value null or request may be missing a required field." I get the same result if I serialize the JSON. The data I'm providing is the same, so the problem isn't with the data or the API itself; it seems like either I'm not using the correct format, or something in the CLI is not serializing the JSON and/or building the request correctly.

Anyone else encounter a similar problem or find a workaround? In what format am I supposed to provide the metadata for a request like this?

 
we're trying to start using salesforce DX with our existing managed packages. i started with a small package - no custom objects, a few custom fields, one custom setting, a few apex classes, one VF page, and one VF component - and everything went pretty smoothly. i was able to convert the metadata, set up a scratch org, push/pull source, etc.

when i tried this with our main managed package, which is much larger, i ran into all kinds of errors trying to do force:source:push. the pretty-printed JSON output of the errors from the CLI command is almost 33,000 lines long. a few of the errors are known issues (e.g. having history tracking enabled), but the rest are things like "referenceTo value of 'Custom_Object__c' does not resolve to a valid sObject type," when "Custom_Object__c" is one of the custom objects included in the source i'm trying to push. there are a bunch of similar things like "Field Custom_Field__c does not exist," "In field: field - no CustomField named Custom_Object__c.Custom_Field__c found," "Invalid type: Custom_Object__c," etc.

i don't know how to determine the source of all of these errors. i've tried most of the things i've found on here already, like enabling external sharing, pushing with --ignorewarnings, etc., and none of it has made any difference.

FWIW, i've also noticed that the metadata i get from force:mdapi:retrieve is missing certain things, like view all permissions on Account in one of our custom profiles. this generates a few errors, but the vast majority remain even after fixing that. maybe that's an entirely separate issue, but it seems worth mentioning.

has anyone else encountered problems like this? any suggestions about where i should look to find the source?
Hello There,

I am learning to use Salesforce DX. I set up the dev hub and trying to link namespace of my developer edition however, finding that the button itself is disabled The button name is - Link Namespace. Does anyone has went through such issue as well? Please, help me out.

Thanks.
Hi,

Curently doing the App Development with Salesforce DX / Convert and Deploy an Existing App.

I have the following error when performing the final deployment task :

Error  mdapioutput/applications/DreamInvest.app        DreamInvest    In field: tab - no CustomTab named Fund_Explorer found
Error  mdapioutput/flexipages/Fund_Explorer.flexipage  Fund_Explorer  You must have My Domain deployed to use component c:FundTileList.
Error  mdapioutput/tabs/Fund_Explorer.tab              Fund_Explorer  In field: flexiPage - no FlexiPage named Fund_Explorer found

Do you know why ?

Regards,
Erwan
 
On clicking Run All  getting this error. Please help.
Failed to enqueue tests.: An unknown exception occurred
Hi Can some one explain me how to use two components with Lightning Data Service, i tried the following code for accDisplay and accEdit.
This worked as i expected but i got the following error!

I am missing some thing, can some one explain me how LDS works with multiple componets!
 
Challenge Not yet complete... here's what's wrong: 
The 'accDisplay' Lightning Component does not appear to be displaying the 'Name' using 'ui:outputText' and the value 'v.accountRecord.Name
 
<!--accDisplay component-->
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId">
 <aura:attribute name="accountRecord" type="Object" />
<force:recordData aura:id="AccountRecordCreator"
    recordId="{!v.recordId}"
    layoutType="FULL"
    targetRecord="{!v.accountRecord}"
    targetFields="{!v.simpleNewAccount}"
    targetError="{!v.newContactError}"
                  mode="VIEW"
    />
   



    <!-- Display a header with details about the record -->
    <div class="slds-form--stacked">
        <div class="slds-form-element">
            <label class="slds-form-element__label" for="recordName">Name: </label>
            <div class="slds-form-element__control">
              <ui:outputText class="slds-input" aura:id="recordName"
                value="{!v.simpleNewAccount.Name}" />
            </div>
            <label class="slds-form-element__label" for="recordIndustry">Industry: </label>
            <div class="slds-form-element__control">
              <ui:outputText class="slds-input" aura:id="recordIndustry"
                value="{!v.simpleNewAccount.Industry}" />
            </div>
             <label class="slds-form-element__label" for="recordDescription">Description: </label>
            <div class="slds-form-element__control">
              <ui:outputTextArea class="slds-input" aura:id="recordDescription"
                value="{!v.simpleNewAccount.Description}" />
            </div>
             <label class="slds-form-element__label" for="recordPhone">Phone: </label>
            <div class="slds-form-element__control">
              <ui:outputPhone class="slds-input" aura:id="recordPhone"
                value="{!v.simpleNewAccount.Phone}" />
            </div>
        </div>
    </div>

   

   
</aura:component>
<!--accEdit-->
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId">

<aura:attribute name="accountRecord" type="Object"/>
<aura:attribute name="simpleNewAccount" type="Object"/>
<aura:attribute name="newContactError" type="String"/>

<force:recordData aura:id="AccountRecordCreator"
    recordId="{!v.recordId}"
    layoutType="FULL"
    targetRecord="{!v.accountRecord}"
    targetFields="{!v.simpleNewAccount}"
    targetError="{!v.newContactError}"
                  mode="EDIT"
    />
   
    <ui:outputText class="slds-output" 
                value="Edit Account" />
     <lightning:input aura:id="recordName" name="accountRecord" label="Name"
                  value="{!v.simpleNewAccount.Name}" />

     <lightning:button label="Save Account" onclick="{!c.handleSaveRecord}"
               variant="brand" class="slds-m-top--medium"/>
</aura:component>

 
I am having an issue verifying the Prevent Open Redirect Challenge. The code I put into the VF page is actually working correctly, but the verify is coming back with a standard error message.
 
Also I happen to notice that the code displayed for the "Force Local Redirects Only" section on the trailhead page for "Prevent Open Redirects in Your Code" is inconsistent and possibly in error.
 
In the larger code display it shows the line (09) as being
 
           completion.replaceFirst('/','');
 
but in the follow on description it shows that line of code to be
 
completion.replaceFirst('/+','');
 
And according to the documentation for the ReplaceFirst method it returns a string with the desired changes and does not change the target string. That would seem to indicate that the code in the example given in the module content given is not going to actually remove any initial '/' from completion.
 
The code I put in the VF page which is working, but not verifying for the "Check Challenge" is
 
              if(finishURL.startsWith('/')){ 
                    finishURL = finishURL.replaceFirst('/+',''); 
                    }
                savePage = new PageReference('/'+finishURL);
 
Can someone tell me what I need to change in order to get past this challenge? I have actually completed all the other challenges for this module so this is holding up my completion of this particular module.
 
Thanks in advance for any assistance!
The following won't validate, but won't pass the validation in this trail.  Quantity field is howver using the correct field.  Thoughts?

User-added image

<aura:component>

<aura:attribute name="item" type="Camping_Item__c" required="true"/>    
    <ui:outputText value="{!v.item.Name}"/>
    <ui:outputCheckbox value="{!v.item.Packed__c}"/>
    <ui:outputCurrency value="{!v.item.Price__c}"/>
      <ui:outputNumber value="{!v.item.Quantity}"/>
            
</aura:component>