0

Tried this using the following 2 snippets; both failed.

Snippet 1

    conn.tooling.sobject('FieldSet')
    .delete({ DeveloperName: fieldsetName }, function(err, meta) {
        if (err) console.error(err.message);
        else console.log("Fieldsets deleted: " + res.length);
    });

Provided external ID field does not exist or is not accessible: [object Object]

Snippet 2

    conn.tooling.delete('FieldSet', fsIds, function(err, res) {
        if (err) console.error(err.message);
        else console.log("Fieldsets deleted: " + res.length);
    });

x insufficient access rights on object id

x DELETE htps://mypkg.na15.visual.force.com/services/data/v34.0/tooling/sobjects/FieldSet/0IXi00000008oMTGAA 400 (Bad Request)

How can I delete a list of fieldsets using either API?

0

SObject#delete() accepts Id(s) to delete, not condition. If you delete the record set which matches condition, try Query#destroy().

conn.tooling.sobject('FieldSet').find({ DeveloperName: fieldSetName }).destroy()

By the way, the second snippet looks valid to me, so check the privilege for the field set object as shown in error.

  • I had tried the find-delete approach as well -with no luck: TypeError: Cannot read property 'load' of undefined – Mossi Jul 17 '15 at 15:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.