How to assign task to group

erp next how to assign task to specific group or only show users in group not all users in system

anyone

@Abdrouf_Elshebanix

For assigning tasks to specific users in a group, you can create a role/group for task assignment and grant appropriate permissions to the group.

If you want to customize the field for selecting users during task assignment, you can write a client script like the following:

frappe.ui.form.on('YourDoctype', {
    onload: function(frm) {
        // Filter users in a specific field based on a group
        frappe.call({
            method: "your_app.your_module.get_users_in_group",
            args: {
                group: "Your Group Name"
            },
            callback: function(r) {
                if (r.message) {
                    var users = r.message;
                    // Set options for user selection field
                    frm.set_df_property("user_fieldname", "options", users);
                }
            }
        });
    }
});

thnx plz where Where can I put this code?

@Abdrouf_Elshebanix

Search client script → Add new client script → Now you can select your doctype details and then place this in the script space with appropriate naming related to your doctype.


like this ?

ithink like this?

@Abdrouf_Elshebanix

Yes, you are right. Now you only need to configure these details, such as selecting the doctype and configuring it in the script.


not working, this is my setting can u check for me plz?

.not working, this is my setting can u check for me plz?

error How can I know the name of the application

.aby one

Hello All,
I have done a PR for above feature

Thanks,
Ashish
GreyCube

can you explain steps?

can you explain steps??

Please check the code:

1 Like