Custom Component Dispatch Event now-ui.json setup

GGriessler
Tera Guru

Hi,

 

I'm trying to dispatch an event from a custom component to open a record on click.

 

In my first try I successfully dispatched an event, but I couldn't configure the response in the UI Builder, as I only saw undefined in the payload.

So now I searched around and checked some other tutorials, but I couldn't get it to work.

 

Currently it looks like this:

"actions": [
        {
          "action": "CARD_HEADER_CLICKED",
          "label": "Card header clicked",
          "description": "Open form of clicked card",
          "payload": [
            {
              "name": "id",
              "label": "SysID",
              "description": "SysID of record represented by clicked card",
              "defautlValue": ""
            }
          ]
        }
      ]

But this is showing up as invalid when I try to deploy it.

I can't figure out the issue looking at the documentation.

Can somebody provide me some pointer to where I could look to resolve this?

 

Thanks!

1 ACCEPTED SOLUTION

GGriessler
Tera Guru

Solution was a missing name attribute...

View solution in original post

3 REPLIES 3

GGriessler
Tera Guru
defautlValue

already changed to 

defaultValue

Ravi Gaurav
Giga Sage

Hi @GGriessler 

 

The issue is with your JSON definition, specifically the "payload" section of your action definition.
There are two problems:

  1. Typo: You wrote "defautlValue" instead of "defaultValue".

  2. Structure mismatch: The payload should define type and defaultValue, not just name and description.

That’s why UI Builder flags it as invalid during deployment.


"actions": [
{
"action": "CARD_HEADER_CLICKED",
"label": "Card header clicked",
"description": "Open form of clicked card",
"payload": [
{
"name": "id",
"label": "Sys ID",
"description": "Sys ID of the record represented by clicked card",
"type": "string",
"defaultValue": ""
}
]
}
]

GGriessler
Tera Guru

Solution was a missing name attribute...