Using custom scripts in custom links #7956
-
We would like to be able to call custom scripts from custom links, but there seems to be a complication: while the custom script is accessible as an API call, the example suggest to use a POST call, constructing all data, token, etc which might not even be feasible in GET, that I assume I could use from custom links. Is there a way to still achieve this somehow? Thanks for the answers in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I'm not sure about directly executing a script via GET, but you can pre-populate a custom script form by specifying the field values in the URI. For example, if your script had an ObjectVar called |
Beta Was this translation helpful? Give feedback.
I'm not sure about directly executing a script via GET, but you can pre-populate a custom script form by specifying the field values in the URI. For example, if your script had an ObjectVar called
mydev
and the link was on a device, you could provide the pk by appending?mydev={{ obj.id }}
to the script URI when building the link. This would pre-select that object, but the user would still have to click the Run button to execute it.