1

Trying to use External Services to process a list of Objects.

YAML JSON attribute looks like below,

            "FirstName": {
                "type": "string",
                "description": "FirstName is the firstname to use for creating the account. @gotag: valid:\"required\""
            },

Generated corresponding Apex Wrapper class (Dynamic Apex) has below,

// [PROPERTY] FirstName
// FirstName is the firstname to use for creating the account. @gotag: valid:"required"
@AuraEnabled
global String FirstName {get; set{ this.FirstName = value; this.FirstName_set = true; }}
global Boolean FirstName_set {get; set;}

JSON body sent by flow has below,

{ "FirstName_set" : true, "FirstName" : "Test" }

Endpoint is throwing error as it does not expect 'FirstName_set' in the request body. I wonder why Salesforce is adding this attribute? Is there a way to remove it?

Thanks!

5
  • 1
    Send it to your own Apex REST service that acts as a middleware to remove it or write your own Apex wrapper that removes it.
    – identigral
    Commented Nov 8, 2023 at 7:59
  • @identigral Yeah, That's of course possible, but we're trying to use this no code solution which is great! trying to understand why it's doing this. Commented Nov 8, 2023 at 22:01
  • ...because (for reasons not related to this use case) they need to know if a particular field has been set and that's how they chose to implement it. There's no way around this other than above.
    – identigral
    Commented Nov 8, 2023 at 22:35
  • @identigral, please add your very useful comment as an answer. People ask exactly the same question again and apparently this is only discouraged when the duplicated question has an answer. This one has - but up to now only in the comments. Commented Mar 8 at 6:52
  • Also facing this issue - is the only solution to write code to remove it? Commented Jul 31 at 12:17

1 Answer 1

1

Send it to your own Apex REST service that acts as a middleware to remove it or write your own Apex wrapper that removes it

1
  • Have added this as a commity wiki for now - if @identigral adds an answer can remove it again.
    – Matt Lacey
    Commented Mar 8 at 14:16

You must log in to answer this question.

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