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?

1 Answer 1

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.

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .