1

This is how I am trying to create the quickAction.

MetadataService.MetadataPort service = createService();
MetadataService.QuickAction customObject = new MetadataService.QuickAction();
customObject.targetObject = 'Test__c';
customObject.lightningWebComponent = 'uploadWordDocument';
customObject.actionSubtype = 'ScreenAction';
customObject.label = 'testButton 123';
customObject.fullName = 'testButton123';
customObject.description = 'Test 123';
customObject.optionsCreateFeedItem = false;
customObject.type =  'QuickAction' ;
customObject.type_x = 'lightningWebComponent';
List<MetadataService.SaveResult> results = service.createMetadata(
                    new MetadataService.Metadata[] { customObject });
handleSaveResults(results[0]);

I am getting following error:

common.apex.runtime.impl.ExecutionException: Web service callout failed: WebService returned a SOAP Fault: Must specify a {http://www.w3.org/2001/XMLSchema-instance}type attribute value for the {http://soap.sforce.com/2006/04/metadata}metadata element faultcode=soapenv:Client faultactor="|0x33ffe847

4
  • shouldn't type_x = LightningComponent per doc ?
    – cropredy
    Commented Aug 29, 2022 at 21:28
  • I tried that as well, still getting the error @cropredy
    – user121585
    Commented Aug 30, 2022 at 9:47
  • one strategy to follow is to retrieve an existing QuickAction of similar type and debug the values of the properties
    – cropredy
    Commented Aug 30, 2022 at 22:53
  • I tried that as well, no success @cropredy
    – user121585
    Commented Sep 1, 2022 at 8:51

0

You must log in to answer this question.

Browse other questions tagged .