Open User section from freedom page

Hello community,

I'm trying to open from a freedom UI page the UserSection page using the following snippet

the entity SysAdminUnit has not assigned the UsersSectionV2 page

How can I solve this problem?

"clicked": {
	"request": "crt.UpdateRecordRequest",
	"params": {
		"entityName": "SysAdminUnit",
		"recordId": "$UserId"
	}
},
Like 0

Like

2 comments

Hi,

You can do it in the following manner:

...
					"clicked": {
						"request": "usr.OpenCurrentUserPage",
					},
 
...
handlers: /**SCHEMA_HANDLERS*/[
			{
				request: "usr.OpenCurrentUserPage",
				handler: async (request, next) => {
					const userId = Terrasoft.SysValue.CURRENT_USER.value; //some logic here to retrieve user id
					await request.$context.executeRequest({
						type: "crt.OpenPageRequest",
						$context: request.$context,
						schemaName: "UserPageV2",
						modelInitConfigs: [{
                            recordId: userId,
                            action: "edit"
                        }],
					});
					return await next?.handle(request);
				}
			},

Oleg Drobina,

Thank you Oleg, it works

Show all comments