Access system defined functions

How to access default system defined functions for user interfaces?

Please elaborate what are you talking about?

My requirement is to do some background operations when access group is created. in other words that to fire a function when ‘OK’ button is pressed in access group UI.

Are you sure you want handle a button click and not, say, the event of creating a new entity of access group type? UI is definitely not the best place for such extensions. You’d better just add a custom entity or transaction listener to accomplish your goal.

I would like to know whether it is possible to do such requirement with UI click event. i am trying with a listener and here is the code but it does not work basically. Can you see any error there?

@Override
public void onAfterInsert(Group entity, Connection connection) {
	SessionAttribute sessionAttribute =new SessionAttribute();
	sessionAttribute.setName("anushka");
	sessionAttribute.setDatatype("String");
	sessionAttribute.setStringValue("Annual Report");
	sessionAttribute.setGroup(entity);
	
	Set<SessionAttribute> sessionAttributes = new HashSet<SessionAttribute>();
	entity.setSessionAttributes(sessionAttributes);
}

This is tried with onAfterInsert as well.

Sorry, I don’t get the idea of that piece of code. What’s entity.setSessionAttributes? What are you trying to do?

If you want to override screen behavior you could extend an screen, see docs, but I don’t really think it will help you.

When access group is created constraint and session attributes must be assigned automatically according to the group. I tried with a listener with some hard coded values. I have post a screen shot below.

qu1

Assigned to whom? A new group is empty.

When creating the group,entity name should be filtered.

Ex.automatically data come to the project via tenat id in multitenancy project.there are not use of session attribute and constrain in multitenancy project. (multitenancy Project)

I want to do the same thing that happen in multitenancy project, when creating the group

Without going into details of your problem, I think the entity listener should work if it is a Before-listener, and you persist all created entities using the provided EntityManager.
After-listener cannot change persistence context, it is stated in the docs. That’s why it accepts not EntityListener but Connection.

thank you for your support and advice