Skip to main content
Solved

Updating 2 User Defined fields using rest api

  • December 6, 2024
  • 2 replies
  • 74 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 Nilkanth Dipak

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!

View original
Did this topic help you find an answer to your question?

2 replies

Nilkanth Dipak
Semi-Pro I
Forum|alt.badge.img+10
  • Semi-Pro I
  • 406 replies
  • 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 I
  • 62 replies
  • 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.
 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings