Skip to main content
added 15 characters in body
Source Link
Andrew Fawcett
  • 40.7k
  • 5
  • 100
  • 127

As per the documentation the CustomField metadata type does not support wild cardswildcards sadly. You can access Custom FieldsCustom Fields on Standard ObjectsStandard Objects by using the CustomObjectCustomObject metadata type as described here against specific Standard Objects. Then parse the .object file to build your destructiveChanges.xmldestructiveChanges.xml file. Finally you can also use the sf:listMetadata task to download a list of all custom fields and then filter locally for Standard objects.

     <sf:listMetadata 
        username="${sf.username}"
        password="${sf.password}"
        metadataType="CustomField"/>

You might also be interested in an open-source undeploy Ant target published here, that wraps most of what i suspect your trying to develop up into a single Ant target. Sadly Salesforce do not yet give us a 'clean my org' task, so we build our own!

As per the documentation the CustomField metadata type does not support wild cards sadly. You can access Custom Fields on Standard Objects by using the CustomObject metadata type as described here against specific Standard Objects. Then parse the .object file to build your destructiveChanges.xml file. Finally you can also use the sf:listMetadata task to download a list of all custom fields and then filter locally for Standard objects.

     <sf:listMetadata 
        username="${sf.username}"
        password="${sf.password}"
        metadataType="CustomField"/>

You might also be interested in an open-source undeploy Ant target published here, that wraps most of what i suspect your trying to develop up into a single Ant target. Sadly Salesforce do not yet give us a 'clean my org' task, so we build our own!

As per the documentation the CustomField metadata type does not support wildcards sadly. You can access Custom Fields on Standard Objects by using the CustomObject metadata type as described here against specific Standard Objects. Then parse the .object file to build your destructiveChanges.xml file. Finally you can also use the sf:listMetadata task to download a list of all custom fields and then filter locally for Standard objects.

     <sf:listMetadata 
        username="${sf.username}"
        password="${sf.password}"
        metadataType="CustomField"/>

You might also be interested in an open-source undeploy Ant target published here, that wraps most of what i suspect your trying to develop up into a single Ant target. Sadly Salesforce do not yet give us a 'clean my org' task, so we build our own!

Source Link
Andrew Fawcett
  • 40.7k
  • 5
  • 100
  • 127

As per the documentation the CustomField metadata type does not support wild cards sadly. You can access Custom Fields on Standard Objects by using the CustomObject metadata type as described here against specific Standard Objects. Then parse the .object file to build your destructiveChanges.xml file. Finally you can also use the sf:listMetadata task to download a list of all custom fields and then filter locally for Standard objects.

     <sf:listMetadata 
        username="${sf.username}"
        password="${sf.password}"
        metadataType="CustomField"/>

You might also be interested in an open-source undeploy Ant target published here, that wraps most of what i suspect your trying to develop up into a single Ant target. Sadly Salesforce do not yet give us a 'clean my org' task, so we build our own!