0

My Scenario

I have a specific RecordType of a Case Called Customer Feedback. I can create a case with this specific record type like this:

// Creates a new Case successfully, no custom fields.
conn.sobject("Case").create({ Subject : 'Post Call Survey', Status : 'In Progress', RecordType : {"Name": "Customer Feedback"}, Origin : "Phone"}, function(err, ret) {
    if (err || !ret.success) { return console.error(err, ret); }
    console.log("Created record id : " + ret.id);

In the Customer Feedback type of Case, I have custom fields. I do this because I have multiple types of cases with different custom fields in each.

My Problem

I get an error INVALID_FIELD: No such column 'Recommendation_Score__c' on sobject of type Case when I try to populate my custom field, Recommendation_Score__c like this :

My attempted Solutions

// Fails because "Recommendation_Score__c is not a Column in Case
conn.sobject("Case").create({ Subject : 'Post Call Survey', Status : 'In Progress', RecordType : {"Name": "Customer Feedback"}, Origin : "Phone", Recommendation_Score__c : "10"}, function(err, ret) {
    if (err || !ret.success) { return console.error(err, ret); }
    console.log("Created record id : " + ret.id);

This way is adding a value into the custom field in the create method. I have also tried updating the already created record like this, but I get the same error :

    // Successfully create Case (no custom field here)
    conn.sobject("Case").create({ Subject : 'Post Call Survey', Status : 'In Progress', RecordType : {"Name": "Customer Feedback"}, Origin : "Cell"}, function(err, ret) {
    if (err || !ret.success) { return console.error(err, ret); }
    console.log("Created record id : " + ret.id);
    // ...
    parentId = ret.id;
    
    // Fails because Recommendation_Score__c is not a column in Case
    conn.sobject("Case").update({
      Id: this.parentId,
      Recommendation_Score__c : "10"
      }, function(err, ret) {
      if (err) {
          console.log(err);
      } else {
          console.log(ret);
      }
  });

My Thoughts

I have seen people creating a metadata array and doing conn.metadata.upsert but it seems like that is only for creating custom fields, not simply updating its value.

I saw somebody update custom fields just like any other field in this like here, so I would think that either way I am trying to accomplish this should work. The person in that link had the issue because they were using the wrong custom field name - I know mine is correct, which leads me to believe that the issues has something to do with the fact that I'm updating a specific record type, not just any standard Case object. Any help or recommendations is appreciated.

1 Answer 1

0

Similarly to the link I posted. I was using the wrong field name. I double checked, even though I assumed I knew the correct field name - On SFDC the "API Name" is Recommendation_Score_c__c for some reason, as opposed to Recommendation_Score__c.

My apologies to anyone who has tried helping with this already.

You must log in to answer this question.

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