In beanshell how to check edit vs add mode?

Confluence User - 14 Mar, 2023

Hi,

I need to do post form submission processing and will be using beanshell. The script will run on both an "add" and an "edit". However I need to differentiate between the two as the processing will be different based on whether I am creating a new record or editing an existing one. How can I check whether we are in an "add" mode versus an "edit" mode in beanshell?

forms

2


14 Mar, 2023
confluenceUser
1
confluenceUser

Are you using the CRUD for this? if so, there's a URL parameter being sent to the form to distinguish add/edit mode. i.e _mode=add or _mode=edit. You can use request parameter hash variable to get that value.

Hash Variable - Knowledge Base for DX 7 - Joget | COMMUNITY

14 Mar, 2023
confluenceUser
confluenceUser

Thank you Ian. I was not using CRUD but your answer pointed me in the right direction. I added a custom parameter and was able to read it from the hash variable.

RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print