function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
user sso1user sso1 

I am unable to update standardvalueset through tooling api and here's request body but receiving bad id 4 and malformed id

I am unable to update [patch] standardvalueset through tooling api and here's request body but receiving bad id 4 and malformed id

 

Request Body:

{
 
"Metadata" : {
      "sorted" : false,
      "standardValue" : [ {
        "allowEmail" : null,
        "closed" : null,
        "color" : null,
        "converted" : null,
        "cssExposed" : null,
        "default" : false,
        "description" : null,
        "forecastCategory" : null,
        "groupingString" : null,
        "highPriority" : null,
        "isActive" : null,
        "label" : "Agriculture",
        "probability" : null,
        "reverseRole" : null,
        "reviewed" : null,
        "urls" : null,
        "valueName" : "Agriculture",
        "won" : null
      }, {
        "allowEmail" : null,
        "closed" : null,
        "color" : null,
        "converted" : null,
        "cssExposed" : null,
        "default" : false,
        "description" : null,
        "forecastCategory" : null,
        "groupingString" : null,
        "highPriority" : null,
        "isActive" : null,
        "label" : "Chemicals1",
        "probability" : null,
        "reverseRole" : null,
        "reviewed" : null,
        "urls" : null,
        "valueName" : "Chemicals1",
        "won" : null
      } ],
      "urls" : null
    },
     "FullName" : "Test",
    "MasterLabel" : "Test"
  } 
 

Best Answer chosen by user sso1
Sai PraveenSai Praveen (Salesforce Developers) 
Hi ,

StandardValue set was returning the same Id for all the standard fields like(000000000000000AAA). 

We need id for either post or patch request but as the Ids were the same it will not update successfully.

I guess this is something not possible o achieve with tooling API.

Let me know if you face any issues.

If this solution helps, Please mark it as best answer.

Thanks,
 

All Answers

Sai PraveenSai Praveen (Salesforce Developers) 
Hi,

Can you confirm what URL you were adding in PATCH request? Are you giving any ID?

Thanks,
 
user sso1user sso1

Hi Sai Praveen,

 

I'm passing ID and here's the sample URL

 

 

/services/data/v56.0/tooling/sobjects/StandardValueSet/>>ID<<

 

Sai PraveenSai Praveen (Salesforce Developers) 
Hi ,

StandardValue set was returning the same Id for all the standard fields like(000000000000000AAA). 

We need id for either post or patch request but as the Ids were the same it will not update successfully.

I guess this is something not possible o achieve with tooling API.

Let me know if you face any issues.

If this solution helps, Please mark it as best answer.

Thanks,
 
This was selected as the best answer
Shri RajShri Raj

The error message "bad id 4 and malformed id" indicates that there is an issue with the FullName value in your request body. The FullName field is used to specify the name of the standard value set that you want to update, and it must be in the format <object_name>.<field_name>.
Make sure that the FullName field is set to the correct value for the standard value set that you want to update. For example, if you are updating the Industry picklist values for the Lead object, the FullName value should be Lead.Industry.
Additionally, check that you have the necessary permissions to update standard value sets through the Tooling API. You may need to have the "Customize Application" or "Modify All Data" permissions.