How to block editing of the master form but allow inserts in the detail in Jam.py?

52 views
Skip to first unread message

Lucas Lopes

unread,
Jun 26, 2025, 10:55:38 AM6/26/25
to Jam.py Users Mailing List
Hi everyone,
I’m working on a Jam.py application and need help implementing a permission rule. Here's what I want to achieve:

Scenario:

I have a master form with one or more detail sections (child tabs). For a specific group of users (e.g., those with the PMO role), I want to:

  • Prevent editing of any fields in the master form (such as name, client, status, etc.)

  • Allow them to insert records normally into the detail section (e.g., a “Project - Event” tab)


Screenshot from 2025-06-26 11-46-55.png

Danijel Kaurin

unread,
Jun 26, 2025, 3:43:53 PM6/26/25
to Lucas Lopes, Jam.py Users Mailing List
Hi Lucas.

To prevent editing master form, try with this code on master form:

function on_edit_form_created(item) {
let role_restrict = task.user_info.role_id;

if (task.user_info.role_id == role_restrict) {
item.name.read_only = true:
item.client.read_only = true;
item.status.read_only = true;
} else {
item.name.read_only = false:
item.client.read_only =  false;
item.status.read_only =  false;
}
}

Please try Jam.py version 7: pip install jam.py-v7. In V7 you can easily manage permissions on field level, no need to write code:

Screenshot 2025-06-26 214047.png


--
You received this message because you are subscribed to the Google Groups "Jam.py Users Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jam-py+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/jam-py/aacdc147-8efd-4690-90ee-b8ce2aa69849n%40googlegroups.com.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages