I create an app using sfdx
and at one point I convert it as a package using:
sfdx force:source:convert --outputdir mdapi_packageName --packagename packageName
- and installing on a (other) org using
sfdx force:mdapi:deploy --deploydir mdapi_packageName --targetusername username
.
My package contains custom metatadata type
with two String
fields and one record.
The goal is to let user (System admin) fill the content of this record after installation but those two fields are not accessible in setup
.
Metadata definition:
<?xml version="1.0" encoding="UTF-8"?>
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
<description>Description</description>
<label>Label</label>
<pluralLabel>Descriptions</pluralLabel>
<visibility>Public</visibility>
</CustomObject>
Record:
<?xml version="1.0" encoding="UTF-8"?>
<CustomMetadata xmlns="http://soap.sforce.com/2006/04/metadata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<label>Record</label>
<protected>false</protected>
<values>
<field>fieldA__c</field>
<value xsi:type="xsd:string"></value>
</values>
<values>
<field>fieldB__c</field>
<value xsi:type="xsd:string"></value>
</values>
</CustomMetadata>
I can't find documentation I read yesterday but it seems that user need a permission (via permission set or profile) to be able to do it (Customize Application
if I remember correctly) and it is set but still not working.
Edit: I miss the field definition from other files with sfdx:
Metadata 1:
<?xml version="1.0" encoding="UTF-8"?>
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
<fullName>FieldA__c</fullName>
<externalId>false</externalId>
<fieldManageability>SubscriberControlled</fieldManageability>
<label>Field A</label>
<length>255</length>
<required>false</required>
<type>Text</type>
<unique>false</unique>
</CustomField>
Metadata 2:
<?xml version="1.0" encoding="UTF-8"?>
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
<fullName>FieldB__c</fullName>
<externalId>false</externalId>
<fieldManageability>SubscriberControlled</fieldManageability>
<label>Field B</label>
<length>255</length>
<required>false</required>
<type>Text</type>
<unique>false</unique>
</CustomField>