Время создания
Filters

Hi Community,

 

We are using the case section with 4 different pages based on the case types. We are required to disable the creation permission for different page types based on the user roles.

The OOTB Operation permission functionality in the object permission allows the Restriction at the object level. However, according to the requirement, we require this permission at the page level. Is there any workaround for us to achieve this?

 

I also tried the code attached below to achieve this requirement. But seems like I am missing something and the code is not working as expected.

 

initEditPages: function () {
    var roleName = "System administrators";
 
    var esq = Ext.create("Terrasoft.EntitySchemaQuery", {
        rootSchemaName: "SysUserInRole"
    });
    esq.addColumn("SysRole");
 
    esq.filters.add("UserFilter", Terrasoft.createColumnFilterWithParameter(
        Terrasoft.ComparisonType.EQUAL, "SysUser", Terrasoft.SysValue.CURRENT_USER.value
    ));
 
    esq.filters.add("RoleFilter", Terrasoft.createColumnFilterWithParameter(
        Terrasoft.ComparisonType.EQUAL, "SysRole.Name", roleName
    ));
 
    esq.getEntityCollection(function(result) {
        if (!result.success || result.collection.getItems().length === 0) {
            // the user is *not* in the role 
            // do something here if needed
        }
        else {
            // the user *is* in the role
            var scope = this;
            var Ext = this.Ext;
            var Terrasoft = this.Terrasoft;
            var collection = Ext.create("Terrasoft.BaseViewModelCollection");
            var entityStructure = this.getEntityStructure(this.entitySchemaName);
            if (entityStructure) {
                Terrasoft.each(entityStructure.pages, function(editPage) {
                    var typeUId = editPage.UId || Terrasoft.GUID_EMPTY;
                    if (editPage.cardSchema === "BEACRCase2Page") {
                        collection.add(typeUId, Ext.create("Terrasoft.BaseViewModel", {
                            values: {
                                Id: typeUId,
                                Caption: editPage.caption,
                                Click: {bindTo: "addRecord"},
                                Tag: typeUId,
                                SchemaName: editPage.cardSchema
                            }
                        }));
                    }
                    else if (editPage.cardSchema === "BEACRCase1Page") {
                        collection.add(typeUId, Ext.create("Terrasoft.BaseViewModel", {
                            values: {
                                Id: typeUId,
                                Caption: editPage.caption,
                                //Click: {bindTo: "addRecord"},
                                Tag: typeUId,
                                SchemaName: editPage.cardSchema
                            }
                        }));
                    } else if (editPage.cardSchema === "BEACCCase1Page") {
                        collection.add(typeUId, Ext.create("Terrasoft.BaseViewModel", {
                            values: {
                                Id: typeUId,
                                Caption: editPage.caption,
                                //Click: {bindTo: "addRecord"},
                                Tag: typeUId,
                                SchemaName: editPage.cardSchema
                            }
                        }));
                    } else if (editPage.cardSchema === "BEAKRCase1Page") {
                        collection.add(typeUId, Ext.create("Terrasoft.BaseViewModel", {
                            values: {
                                Id: typeUId,
                                Caption: editPage.caption,
                                //Click: {bindTo: "addRecord"},
                                Tag: typeUId,
                                SchemaName: editPage.cardSchema
                            }
                        }));
                    }
                }, scope);
            }
            this.set("EditPages", collection);
        }
    }, this);
},

 

Kindly assist me in resolving this issue, please.

Like 0

Like

0 comments
Show all comments

Can anyone knows HOW TO ADD POP CONFIRMATION MESSAGE for selecting Yes or No in Freedom UI

Like 0

Like

2 comments

Hello,

I have an article showing how to do this for Freedom UI here:

https://customerfx.com/article/showing-a-message-dialog-or-confirmation…

Ryan

Thank you Ryan

Show all comments

Hello team, 

 

Does anybody know how to add a button in the row for Freedom UI details? Otherwise, how add an action in the 3 dots? The idea is to perform an option over that row and not need to do 2 clicks for that.

Thanks,

Like 0

Like

1 comments
Best reply
Show all comments

Is it possible to change the colours/colour progression used for subsequent sections of a donut chart widget? We currently want to define that one value of a boolean on a lookup should be displayed in green, and the other red, but a generalised way of doing this would be very helpful for future reference - e.g. to specify the set and order of colours used in some way. We're currently on 8.1.0.6820 Any help would be greatly appreciated!

Like 0

Like

0 comments
Show all comments

Can anyone tell how I can Navigate to a Page by clicking on button in Freedom UI  by using (customcode)

Like 0

Like

2 comments

You can do that with no code using the actions: 

  • Open new record (to open a page in add mode)
  • Open existing record (to open a page in edit mode)
  • Open specific page (to choose a specific page. This could be a section list page, or a specific page for a record if a record has multiple pages defined for it)

If you want to do this in code, these articles will help: 

Ryan

Thank you @Ryan for answering my question ,Do you have exact example where we are Navigating to Page by clicking on button.

Show all comments