cancel
Showing results for 
Search instead for 
Did you mean: 

Overriding actions in a javascript rule

michaelhaydock
Participant
0 Kudos

I am looking to use the documented functionality for overriding actions in a javascript rule, in this case for a CreateEntity call. (I have it working fine for a DeleteEntity).
My question is: Can I only override the properties, or can I also override other sections of a CreateEntity action like Headers or CreateLinks ?

Thanks

View Entire Topic
bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

You can override everything if needed. The contents of the action file would be in the Properties block of the override. If you were also overriding properties those would be in a Properties block within the override properties block.

return context.executeAction({
  "Name": "/MDKDevApp/Actions/OData/UpdateServiceViaRule.action",
  "Properties": {
    "Target": {
      "ReadLink": readLink
    },  
    "Properties": {
      "OrderDescription": description
    },
  }
});

This is an update override but it shows how if you are overriding properties in you need the second property block,

Overrides should also support nested overrides but I wouldn't necessarily say it is easy to follow.

return context.executeAction({
  "Name": "/MDKDevApp/Actions/Messages/Message.action",
  "Properties": {
    "Message": "Message 1",
    "Title": "Title 1",
    "OnSuccess": {
      "Name": "/MDKDevApp/Actions/Messages/Message.action",
      "Properties": {
        "Message": "Message 2",
        "OnSuccess": {
          "Name": "/MDKDevApp/Actions/Messages/Message.action",
          "Properties": {
            "Message": "Message 3",
            "Title": "Title 3"
          }
        }
      }
    }
  }
})
michaelhaydock
Participant
0 Kudos

Thank you! That fixed it.