Custom Action requires selected entries + “Leave Page?” prompt when using Asset field in Action (solved) #12945
-
|
I’ve run into two issues with a custom Action I’m building. First issue;: Custom Action requires selected entriesThe Action isn’t supposed to depend on selected entries — it triggers a global process that deletes all entries in a collection and replaces them with newly imported ones. It’s only meant to be available in one specific collection, so I restricted it to that. Before restricting it, the Action showed up in the general menu (the three-dot dropdown, where you can also edit Collections and Blueprints), and I could trigger it without selecting anything. But now, after limiting it to a specific collection, it only shows up if at least one entry is selected — even though it doesn’t operate on selected entries at all. Is there any way to make a collection-specific Action available without requiring a selection? Action code pls. see bottom. Second issue: “Leave Page?” prompt when using Asset field in ActionThis Action uses an Asset field to pick the file to import. That part works fine, but when I confirm the Action I always get the question after execution: “Leave page or stay?” It’s the same message you get when there are unsaved changes in an entry. Claude Sonnet 4.5 claims this happens because using an Asset field sets a “dirty flag”. Sounds plausible, but I couldn’t find any official info on that. Does anyone know if that’s actually the case — and more importantly, is there any way to prevent that while still using an Asset field? That prompt would definitely confuse normal users. Thanks in advance! Action Code: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
A bit later: Answering my own questions ... I understand now that actions are always entry-dependent in terms of concept. The action is now available in every entry menu, even when not selected (check-boxed). I was also able to get rid of the Leave Page dialog by adding a bypass for the dirty flag. |
Beta Was this translation helpful? Give feedback.
A bit later: Answering my own questions ...
I understand now that actions are always entry-dependent in terms of concept. The action is now available in every entry menu, even when not selected (check-boxed).
I was also able to get rid of the Leave Page dialog by adding a bypass for the dirty flag.