We’re rewarding the question askers & reputations are being recalculated! Read more.
14

As per the discussion with Pranay in the comments, the cause of the issue was the "singlePackage" setting in the deploy options. Indicates whether the specified .zip file points to a directory structure with a single package (true) or a set of packages (false). Typically my deployment tooling would have this set to true (and then would work fine with v45....


10

This is a very similar scenario to what is occurring in Tooling API in Apex - polymorphism, generic query() callout? and is caused by an underlying limitation in Wsdl2Apex and WebServiceCallout.invoke(). The Metadata API readMetadata web method returns a generic ReadResult with records of type tns:Metadata: <xsd:complexType name="ReadResult"> <...


10

You have two choices. First, you can use force:package commands to create an unlocked package. You can install this in production with force:package:install; it is similar to installing an AppExchange package. Otherwise, you would need to use force:source:convert to get a mdapi style format, then use force:mdapi:deploy with the relevant test level (e.g. ...


8

As of Summer '19 (v46.0), the INVALID_OPERATION errors you were hitting are no longer an issue! force:source:deploy now works when deploying to production. See an example below: sfdx force:source:deploy -m ApexClass:MyApexClass -l RunSpecifiedTests -r MyApexClass_Test -w 3 -u MyProductionOrg


7

The best place to check for it is the workbench. Reference: API Names of System and App Permissions?


7

Metadata API sometimes have different API names than the one shown on the UI. Manage Public List Views permission is called as "EditPublicFilters" and Create and Customize List Views is called as "CreateCustomizeFilters" So your user permission will be. <userPermissions> <enabled>true</enabled> <name>...


7

The flow can be invoked from a user-facing process. Here are the parameters: /services/auth/xds/{org_id}/{authprovider_developer_name} - this issues the logout, &startURL=/0XA... - this ID tells SF which Named Credential to link the grant against, &scope=full... - list of scopes/privileges presented to the user at the Allow screen, Apex code to ...


5

GlobalPicklist was introduced in 37.0 version and is available only in this version GlobalPicklist components are available in API version 37.0 only. In API version 38.0 and later, GlobalPicklist is replaced by the GlobalValueSet type. you can read it from documentation you should use only GlobalValueSet as it replaces GlobalPicklist


5

Yes. Each object has two fields, "sharingModel" and "externalSharingModel". You can import and export these values between orgs. You'll find this setting in the CustomObject metadata. I personally use this method to set up the sharing model for standard and custom objects. There's some weird bugs around it sometimes, so some manual setup may still yet be ...


5

Via twitter, it sounds like they have added a work item to expose this functionality in a future release. https://twitter.com/tahir_farhan/status/1085939366764134401?s=09 Cool. Let us get to work on that. FYI, W-4277797 is the work number we are using to track. You can reference it in future conversations. Thanks Farhan Tahir


5

Since the error is not so clear on why this is happening , this is where one needs to see whats the actual metadata for the object that is getting deployed. There is an environment variable in the DX CLI named SFDX_MDAPI_TEMP_DIR you might want to set it to a temp metadata directory so that when sfdx push command runs you see the actual metadata thats being ...


5

Is there a standardized approach or automated process for making a Scratch-Org look exactly like your Production Environment (Metadata/Packages/etc.)? force:org:shape and force:org:snapshot are in pilot, so eventually there will be automated support. However, this does not help you right now if you're not already in the pilot programs. This means you'd have ...


5

In the provided example, the core thing to bound this field to account is naming of .xml file. It will be Account.object-meta.xml. Therefore, the fields in xml with such name will be added to Account. It is also very important to deploy your archived xml files with proper names, so the organization understands what you want from it.


4

For objects supported by Tooling API, you can simply write a query for this. Open the Developer Console, click on the Query tab, enter the Tooling API query, and check the "Use Tooling API" checkbox. Example SELECT TableEnumOrId, DeveloperName FROM CustomField WHERE LastModifiedDate > 2018-09-01T00:00:00.000Z Note: This means you'll have to query all ...


4

Set the isactive attribute to false and deploy those values back using ant.The values will be made inactive Check documentation here Example to set 2 values as inactive: <?xml version="1.0" encoding="UTF-8"?> <StandardValueSet xmlns="http://soap.sforce.com/2006/04/metadata"> <sorted>true</sorted> <standardValue> ...


4

You can retrieve DX-compatible formatted source using DX: sfdx force:source:retrieve -u prod-login -m "CustomObject:Account,CustomObject:Case,Profile" This should retrieve all the metadata you're asking for without the need for a package.xml, which you can then immediately turn around and push: sfdx force:source:push -u scratch-org-login You'll need to ...


4

If all you need to do is to kick off the oAuth flow so that the user may authorize the app, the auth provider supports this natively: public PageReference (String authProvider) { AuthProvider provider = [ SELECT Id,OauthKickoffUrl FROM AuthProvider WHERE DeveloperName = :authProvider ]; return ...


4

The way I use to update custom metadata in Apex is via the Andrew Fawcett Github (unmanaged) Custom Metadata Services Custom Metadata Services (CMS) is a small library created to wrap the native Apex Metadata API to leverage the native SObject types for custom metadata in a more DML orientated way. It also aims to simplify the handling of the async ...


3

You are looking at the .flow file inside flows folder. There will be another file with extension .flowDefinition inside flowDefinitions folder. The .flowDefinition file has details about which version is active for a given flow. EDIT: Force IDE or Force migration tool will retrieve flowDefinition files only if package.xml contains the below elements: <...


3

It can be done by using the Edit menu and the options in VSCode. Just navigate to the folder and perform the operation there. You can always perform such operation in any standard editor, viz., Notepad++.


3

Taken from Issue # 225 on their repo. Error occurred when obtaining a custom picklist fields CustomValue. Error: System.CalloutException: Web service callout failed: Unable to find apex schema info Fresh install looked like this: public virtual class CustomValue extends Metadata { public String color; public Boolean default_x; public ...


3

FYI: You can't create new state and country picklist values via Metadata API: You can’t use the Metadata API to create or delete new states or countries. https://developer.salesforce.com/docs/atlas.en-us.216.0.api_meta.meta/api_meta/meta_addresssettings.htm?search_text=AddressSettings Real bummer, forcing you to manually create dozens of values ...


3

as I can see from error message, you have trailing space in Text(space goes here). you need to remove that space before passing to API by using normalizeSpace() or trim() String methods . customField.type_x = fieldType; change to customField.type_x = fieldType.normalizeSpace(); it is better to sanitise string before passing to createCustomFields ...


3

Yes, it's possible. You can access Workflow Rule metadata through the Metadata API. There is an Apex wrapper available, and its README and examples class include some examples that can be adapted to get started on your objectives. To read out Workflow Rule metadata, for example, you can do MetadataService.MetadataPort service = new MetadataService....


3

I also tried the below commands and it worked fine. sfdx force:source:retrieve -x ./manifest/package.xml OR sfdx force:source:retrieve -m Layout You may like to verify if you have the Layout attribute added in your package.xml This has worked for me in VS Code, if at all you are open to this option. Create a Project with Manifest In the package.xml, ...


3

I went to the Metadata Coverage Report and searched for Profile. It showed up two Known Issues for Profile: sfdx force:source:pull does not fetch the changes on Profile for record type permission change If "sfdx force:source:pull" command is run to fetch the profile details after changing the assigned record types, we see that the changes do not get ...


3

[edited based on @Derek F's comments] Reports are located in three places that control visibility: Public: the report's ownerId is the Organization; anyone can view Shared (my label): the report's ownerId is a shareable Folder Private: the report's ownerId is the user's Id; only the user can view Public and Shared reports are accessible with the Metadata ...


3

This is the purpose of Salesforce DX. The folders won't be on the Salesforce server, but you will be able to organize your folders/packages in a repo. See the DX Falcon Template for an example. Yes, it will take time to convert and organize your source code, but the sooner you get started, the sooner you'll be able to take advantage of this feature.


3

I think the second problem you listed is causing the first problem, and unfortunately it's a bit of a layered answer. I'm also assuming that the MetadataService layer you've generated is all correct. The first part to solve is getting the ConnectedAppOauthConfig.isAdminApproved = true. Now I couldn't get this to set on creation of the Connected App. However,...


3

Basically, you can't. At a per-field level, the field's metadata must be fully formed and correct. The documentation states: You must supply values for all the required fields in the component.


Only top voted, non community-wiki answers of a minimum length are eligible