I have a button on a detail that I want to use to filter the records in the said detail upon clicking it. The Apply filter option doesn't seem to be there. Quick filters seem to be working for a section but not on a detail. 

 

Anyone knows a possible solution ?

 

Regards,

Abilash

Like 0

Like

2 comments

hi Abilash,



Have you checked by refreshing the page?

Did you debug to see the execution of the Detail button event?



If the execution of the event is successful, then Grid data must be refreshed and published by applying the latest filter data.

(OR)

It is possible to implement the quick filter module following this article https://academy.creatio.com/documents/technic-sdk/7-13/adding-quick-filter-block-section





BR,

Bhoobalan Palanivelu

Hi Bhoobalan Palanivelu,

 

Thanks for your reply.

 

First part of your question, applying the filter on the detail upon clicking the button is the issue for me.  As for the second part, I've tried implementing the quick filter on the detail but to no avail. It's not throwing an error but nor am I getting the required output.

 

Regards,

Abilash.S

 

Show all comments

Hi all,

 

I need to filter a lookup like this : 

Select "Id", *
from "UsrMatieresDesMarches" root
where
exists
(
    Select "Id" from "UsrMarchesEtActivitesDuCompte" account_market_activity
    where exists
    (
        Select "Id" 
        from "UsrActivitesDesMarches" param_market_activity
        where 
            param_market_activity."UsrMarcheId" = root."UsrMarcheId"
            and param_market_activity."Id" = account_market_activity."UsrActiviteDuMarcheId"
    )
    and account_market_activity."UsrAccountId" = '60687534-82ca-446d-bd62-010e032fe52d'
)

I struggle on what reverse path I can take. Anyone sees it ?

 

 

Like 0

Like

1 comments
Best reply

Hello Jerome,

To filter your lookup values you need to write an attribute on the object page schema, for example:

"StTransport": {
                "dataValueType": Terrasoft.DataValueType.LOOKUP,
                "lookupListConfig": {
                    "filters": [
                        function() {
                            var filterGroup = Ext.create("Terrasoft.FilterGroup");
                            filterGroup.add("MaxWeightFilter",
                                Terrasoft.createColumnFilterWithParameter(
                                    Terrasoft.ComparisonType.GREATER,
                                    "[StTransport:Id].StMaxWeight",
                                    this.get("StWeight")));
                            return filterGroup;
                        }
                    ]
                }

Take a look at a construction [StTransport:Id] it's an example of reverse connections and I believe that in your situation you should use it.

You can see another small example with it in this article.

To add another condition to the filter just wright another filterGroup.add.

Hello Jerome,

To filter your lookup values you need to write an attribute on the object page schema, for example:

"StTransport": {
                "dataValueType": Terrasoft.DataValueType.LOOKUP,
                "lookupListConfig": {
                    "filters": [
                        function() {
                            var filterGroup = Ext.create("Terrasoft.FilterGroup");
                            filterGroup.add("MaxWeightFilter",
                                Terrasoft.createColumnFilterWithParameter(
                                    Terrasoft.ComparisonType.GREATER,
                                    "[StTransport:Id].StMaxWeight",
                                    this.get("StWeight")));
                            return filterGroup;
                        }
                    ]
                }

Take a look at a construction [StTransport:Id] it's an example of reverse connections and I believe that in your situation you should use it.

You can see another small example with it in this article.

To add another condition to the filter just wright another filterGroup.add.

Show all comments

Hi Community,

I am facing an issue which is related to SectionActions Button for sending multiple records. I need to send some records (out of all selected records) to a business process in an array after filtering with esq inside section edit page.

Issue: The filtered Id's are not being pushed into array correctly. Means when we explore the array, the values are there but when we try to print or send we get initial value of that array (i.e. empty string or null).

 

getSectionActions: function() {

                var actionMenuItems = this.callParent(arguments);

                actionMenuItems.addItem(this.getButtonMenuItem({

                    Type: "Terrasoft.MenuSeparator",

                    Caption: ""

                }));

                actionMenuItems.addItem(this.getButtonMenuItem({

                    "Caption": {bindTo: "Resources.Strings.AMDAssignMultipleRecords"},

                    "Click": {bindTo:"runCustomProcess"},

                    "IsEnabledForSelectedAll": true

                }));

                return actionMenuItems;

            },

            runCustomProcess: function(){

                if(this.get("SelectedRows") == "" || this.get("SelectedRows") == undefined){

                    this.showInformationDialog("Please select records for batch process!");

                }

                else{  

                    var selectedRows = this.get("SelectedRows");

                    console.log("Selected records : ", selectedRows);

                    var recordsnumber = selectedRows.length;

                    var resIdRows=[];

                    var resIdForArray="";

                    selectedRows.forEach(fnProgramABCArray);

                    console.log("Selected ABC records : ", resIdRows);

                    var selectedOrder = resIdRows.toString();

                    console.log("selectedOrder: ", selectedOrder);

                    var args = {

                        sysProcessName: "AMDProcess_BatchAssignments",

                        parameters: {

                            SelectedRowsCol: selectedOrder,

                            NoOfRes: recordsnumber

                        },

                    };

                    ProcessModuleUtilities.executeProcess(args);

                }



                function fnProgramABCArray(item){

                    var esq = Ext.create("Terrasoft.EntitySchemaQuery", { rootSchemaName: "AMDTestPlans" });

                    esq.addColumn("AMDStatus");

                    esq.addColumn("AMDProgram");

                    esq.filters.addItem(esq.createColumnFilterWithParameter(

                        Terrasoft.ComparisonType.EQUAL, "Id", item));

                    esq.getEntityCollection(function (result) {

                        let status = result.collection.getByIndex(0).get("AMDStatus").displayValue;

                        let program = result.collection.getByIndex(0).get("AMDProgram").displayValue;

                        if(status === "In Progress" && program === "ABC"){

                            resIdRows.push(item);

                        }

                    });

                }

            }

 

Please find attached screenshot below with an array of selected records vs another array of selected ABC records and string output as Selected order (empty string).

 

Like 0

Like

1 comments

Hi,

 

The issue here is that ESQ is asynchronous and as a result once the:

 

selectedRows.forEach(fnProgramABCArray);

 

is called, the browser continues executing the main runCustomProcess, but in addition executes the fnProgramABCArray in the background and when the

 

console.log("Selected ABC records : ", resIdRows);

 

and 

 

console.log("selectedOrder: ", selectedOrder);

 

are executed they won't show anything, these will be an empty array and an empty string.

 

You need to modify this logic and perform the filtration of records in the business process directly where you can check all the records passed using either the read data element and the conditional flow or a script task that uses the SelectQuery class to check data consistency.

 

Best regards,

Oscar

Show all comments

Hi Team,

 

Have a query regarding widget we design in the dashboard can be read filter from the dashboard to modify our output on the widget.

If it is possible please share a scenario with implementation 

This will be really useful to meet some business requirement 

 

Thank You in Advance 

Like 1

Like

4 comments

Hello Braj,

 

Unfortunately, I was not able to find an example you requested but you can always check all the needed parameters in the Academy Article that is related to Dashboard widgets and their customizations.

 

Best regards,

Bogdan S.

Hi Bogdan,

 

we need to calculate the loss ratio from some data sets 

 

ex. we have 100 records out of which 70 has profit field filled and 30 has loss field filled.

Based on filtration we performed on the dashboard/pivot report we get  records (N can be  10,20,30 or any number 

 

Now I want a loss ratio (loss/profit) of those N records only.

 

in this case loss ratio = sum of loss from filtered records /sum of profits from filtered records.

 

Hope you got the requirement if case any query please contact me.

 

Thank You

Braj Raj singh Kushwaha,

 

Your business task is quite clear but still, there is no existing example of code that you can use. Please, check the article that I sent before and do all the required development.

 

Best regards,

Bogdan S.

Bogdan Spasibov,

Thank You so much 

 

your article was very useful It helped me to do some other requirement.

Even fund some app that was free to use and my task was completed using them.

 

Once again thank you so much

Show all comments