Skip to main content
Solved

Updating 2 User Defined fields using rest api

  • December 6, 2024
  • 2 replies
  • 173 views

Hi,

 

I am trying to update custom fields within the Leads aspect of acumatica.  My payload works fine for the fields listed, plus I am able to update notes.  My issue comes with trying to update multiple custom fields.  Whenever I can successfully submit my jSon, only one of the fields updates.  This is what I have:

'"custom":{

"Lead": {

"AttributeFOLLOWDT": {

"type": "CustomStringField",

"value": "12-10-2024"}

},

"Lead": {

"AttributeWRSOURCE": {

"type": "CustomStringField",

"value": "Andersen" }

}

},'

 

Best answer by DipakNilkanth

Hi ​@andersen 
Try below Payload to update both of them.

"custom": {
"Lead": {
"AttributeFOLLOWDT": {
"type": "CustomStringField",
"value": "12-10-2024"
},
"AttributeWRSOURCE": {
"type": "CustomStringField",
"value": "Andersen"
}
}
}

Hope, it helps!

2 replies

DipakNilkanth
Pro III
Forum|alt.badge.img+13
  • Pro III
  • Answer
  • December 7, 2024

Hi ​@andersen 
Try below Payload to update both of them.

"custom": {
"Lead": {
"AttributeFOLLOWDT": {
"type": "CustomStringField",
"value": "12-10-2024"
},
"AttributeWRSOURCE": {
"type": "CustomStringField",
"value": "Andersen"
}
}
}

Hope, it helps!


Forum|alt.badge.img+1
  • Jr Varsity III
  • December 8, 2024

Hi ​@andersen ,
There's an issue with your JSON structure - you're using the same key "Lead" twice in the same object, which isn't valid JSON. In JSON, object keys must be unique. When you have duplicate keys, only the last one will be used, which explains why only one field is being updated.
Try with ​@Dipak Nilkanth sent structure it will work.