c# - Hard delete custom field in Salesforce -
i having problem in deleting custom fields permanently.
like e.g. have created custom field in contact entity name "newsletter" salesforce internaly stores "newsletter__c" custom field.
then utilize below code delete custom field of contact.
var cstfield = new customfield { type = fieldtype.checkbox, fullname = "contact.newsletter__c" }; // delete object var r = metaservice.delete(new metadata[] { cstfield })[0]; the above code deletes custom field, keeps under "deletedfields" category can 1 time again "erase" or "undelete" custom field. these custom fields deleted automatically after 15 days.
i want delete custom fields these category if 1 time again create cf same name sf gives error "already exists".
i tried purgeondelete alternative while deploying no luck far.
purgeondelete. if true, deleted components in destructivechanges.xml manifest file aren't stored in recycle bin. instead, become eligible deletion. field available in api version 22.0 , later. alternative works in developer edition or sandbox organizations; doesn't work in production organizations. extending salesforce migration tool back upwards purgeondelete.. reason first-class feature has still not been exposed salesforce migration tools via sf:deploy ant task. bit of java skills can create new deploy ant task extending current one, expose attribute ant build scripts, example...
prebuilt ant-salesforce.jar deploypurge in it. can download modified ant-salesforce.jar here financialforce.com developers github repo (be warned api v22.0, though can utilize deploy code @ version).
building own extended ant-salesforce.jar. if want rebuild new version, need download java class, compile it, unzip ant-salesforce.jar (rename .jar .zip), set in , zip 1 time again , set!
refer : http://salesforce.stackexchange.com/questions/12709/hard-delete-objects-using-the-force-com-migration-tool
c# salesforce
No comments:
Post a Comment