Hi Team

 

I need to perform some calculations based on data in the dashboard we did some implementation in the pivot table. we are able to get sum 2 fields based on all filter but further using that calculation to display the ratio of that 2 calculation is where I am stuck.

 

I am using https://academy.creatio.com/documents/technic-sdk/7-16/adding-custom-da…

To come up with some approach but didn't succeed anyone please suggest a solution to this requirement

Any workaround will be appreciated

 

 

Thank You 

 

Like 0

Like

3 comments

Hello Braj,

 

Can you please provide more information on what task do you want to cover? We need some practical examples to think about the solution.

 

Also have you tried to use this marketplace addon and does it fit your business task?

 

Best regards,

Oscar

Hi Oscar ,

 

we need to calculate 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 dashboard/pivot report we gets  records (N can be  10,20,30 or any number 

 

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

innthis 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.

 

Thank You

Braj Raj singh Kushwaha,

 

Hello,

 

Unfortunately it's not quite clear what task do you want to achieve. Can you please add some screenshots of what is the desired result? Also can you please specify why the formula column type is not an option in our case?

 

Thank you in advance!

 

Best regards,

Oscar

Show all comments

Hi Team,

 

https://academy.creatio.com/docs/node/1433

I used the above article to get access to communication panel schema and made changes to 

 

diff: /**SCHEMA_DIFF*/[

                {

                    "operation": "insert",

                    "name": "communicationPanelAll",

                    "propertyName": "items",

                    "values": {

                        "id": "communicationPanelAll",

                        "selectors": {"wrapEl": "#communicationPanelAll"},

                        "itemType": Terrasoft.ViewItemType.CONTAINER,

                        "wrapClass": ["all"],

                        "items": [],

                        "tips": [],

                        "markerValue": {"bindTo": "CommunicationPanelMarkerValue"}

                    }

                },

 

used  "operation": "remove" instead of  "operation": "insert",

 

Was able to hide the communication panel but when tried to revert back changes unable to do so 

Some please suggest a way to revert back changes or hide this communication panel in an easy way so reverting changes is easy 

 

 

Thank You

 

Like 0

Like

8 comments

Dear Braj,

 

If removing the code does not restore the panel try to clear your profile data by going into the profile and choosing the "Restore default settings" option. 

 

Best regards,

Angela

Angela Reyes,

 Thank You for this info but as i tried it on my local instance and my client asked us to hide the communication panel so please suggest any work around to do and an easy way to restore it

 

Braj Raj singh Kushwaha,

It is now not clear what your task is. The panel must be hidden forever or on specific conditions?

Angela Reyes,

The panel should be hidden forever.

In case we need it again then we should be able to make it visible as it was before.

 

And by using the above article I was able to hide it but when I tried to make it visible it was still hidden

 

Braj Raj singh Kushwaha,

Can you send here the code you used to make it visible? 

Angela Reyes,

diff: /**SCHEMA_DIFF*/[

                {

                    "operation": "remove",

                    "name": "communicationPanelAll",

                    "propertyName": "items",

                    "values": {

                        "id": "communicationPanelAll",

                        "selectors": {"wrapEl": "#communicationPanelAll"},

                        "itemType": Terrasoft.ViewItemType.CONTAINER,

                        "wrapClass": ["all"],

                        "items": [],

                        "tips": [],

                        "markerValue": {"bindTo": "CommunicationPanelMarkerValue"}

                    }

                },

Above code to hide

 

This code to unhide it or make it visible

 

diff: /**SCHEMA_DIFF*/[

                {

                    "operation": "insert",

                    "name": "communicationPanelAll",

                    "propertyName": "items",

                    "values": {

                        "id": "communicationPanelAll",

                        "selectors": {"wrapEl": "#communicationPanelAll"},

                        "itemType": Terrasoft.ViewItemType.CONTAINER,

                        "wrapClass": ["all"],

                        "items": [],

                        "tips": [],

                        "markerValue": {"bindTo": "CommunicationPanelMarkerValue"}

                    }

                },

 

 

Just made changes to this part only

 

Braj Raj singh Kushwaha,

There is an easier way to hide the CTI panel. Please create a replacing view model for "Communication panel schema":

with the medhod like this one:

init: function() {
					return false;
					}

As a result once the changes are saved and the page is refreshed the communication panel won't be initialized:

To restore the panel please remove all your customizations related to CommunicationPanel and add them according to my instruction.

 

Best regards,

Oscar

Oscar Dylan,

Hi Oscar,

 

As I tried your approach it is working fine thank you very much 

But to restore the panel I removed all customization and refreshed the whole site, Restored the default setting from the user profile still panel was not restored.

 

Please let me know how to restore it.

 

Thank You

 

Show all comments

Hi Team,

 

I added a custom date filter to the base schema so that the changes will be reflected in all sections.

Able to see the functionality but it takes minutes to reflect results.

This is the link I followed to apply the Date Filter and I made changes to the base section schema so changes must be visible in all sections all at once.

 

https://academy.creatio.com/docs/developer/front-end_development/creatio_development_cases/section_business_logic/adding_quick_filter_block_to_a_section

The filter is visible in all sections but functionality is really slow as it takes minutes to reflect the result.

 

Please help to optimize this solution or any other workaround to make it work faster.

 

Thank You

 

Like 0

Like

1 comments

Hi,

 

You need to take a look at the SELECT query that is sent to the database when specifying a filter using this custom filtration by dates and see the SELECT query text. Try adding indexes (see the "Adding indexes to the object" paragraph) for the StartDate column and also for other columns that are used in the ESQ:

Also try parsing queries themeselves using SQL-server profiler and add indexes to the columns that are mentioned in the WHERE and OrderBy clauses. Indexes should help in optimizing SQL-queries (since the problem is definitely in them).

 

Best regards,

Oscar

Show all comments

HI team,

 

I want to filter the Action option based on 3 conditions and I implemented it on the trial instance, it was working as expected using the below code.

 

But when we moved it to the Local Development environment then we are not getting the desired output 

when I checked we are getting Activerowid only on local development instance

 

var status=selectedOrder.get("UsrPOStatusNew");

              var statusordertype=selectedOrder.get("UsrOrderType");

              var vendorcode=selectedOrder.get("UsrVendorGSTStateCode");

               var statecode=selectedOrder.get("UsrBillToGSTStateCode");

 

these fields return an empty or undefined value 

Someone please suggest a solution or workaround

 

Thanks a lot 

 

 

define("UsrCondition631066a3Section", ["ProcessModuleUtilities"], function(ProcessModuleUtilities) {

    return {

        entitySchemaName: "UsrCondition",

        details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,

        diff: /**SCHEMA_DIFF*/[]/**SCHEMA_DIFF*/,

        methods: {

          

           isRunning: function(activeRowId) {

                // Getting the section list view data collection. 

                var gridData = this.get("GridData");

             var selectedOrder = gridData.get(activeRowId);

                // Getting the selected order model accroding to the indicated primary column value. 

                var status=selectedOrder.get("UsrPOStatusNew");

              var statusordertype=selectedOrder.get("UsrOrderType");

              var vendorcode=selectedOrder.get("UsrVendorGSTStateCode");

               var statecode=selectedOrder.get("UsrBillToGSTStateCode");

             //this.showInformationDialog(status.displayValue);

             //this.showInformationDialog(statecode);

             this.showInformationDialog(status.displayValue);

             if(status.displayValue === "Approved" && statusordertype.displayValue==="Purchase Order" && vendorcode===statecode)

               {

                 return true;

               }

             else

               

                return false;

            },

          

           isRunning1: function(activeRowId) {

                // Getting the section list view data collection. 

                var gridData = this.get("GridData");

             var selectedOrder = gridData.get(activeRowId);

                // Getting the selected order model accroding to the indicated primary column value. 

                var status=selectedOrder.get("UsrPOStatusNew");

              var statusordertype=selectedOrder.get("UsrOrderType");

              var vendorcode=selectedOrder.get("UsrVendorGSTStateCode");

               var statecode=selectedOrder.get("UsrBillToGSTStateCode");

             //this.showInformationDialog(status.displayValue);

             //this.showInformationDialog(statecode);

             if(status.displayValue === "Approved" && statusordertype.displayValue==="Purchase Order" && vendorcode!==statecode)

               {

                 return true;

               }

             else

               

                return false;

            },

          isRunning2: function(activeRowId) {

                // Getting the section list view data collection. 

                var gridData = this.get("GridData");

             var selectedOrder = gridData.get(activeRowId);

                // Getting the selected order model accroding to the indicated primary column value. 

                var status=selectedOrder.get("UsrPOStatusNew");

              var statusordertype=selectedOrder.get("UsrOrderType");

              var vendorcode=selectedOrder.get("UsrVendorGSTStateCode");

               var statecode=selectedOrder.get("UsrBillToGSTStateCode");

             //this.showInformationDialog(status.displayValue);

             //this.showInformationDialog(statecode);

             if(status.displayValue === "Approved" && statusordertype.displayValue==="Work Order" && vendorcode!==statecode)

               {

                 return true;

               }

             else

               

                return false;

            },

          isRunning3: function(activeRowId) {

                // Getting the section list view data collection. 

                var gridData = this.get("GridData");

             var selectedOrder = gridData.get(activeRowId);

                // Getting the selected order model accroding to the indicated primary column value. 

                var status=selectedOrder.get("UsrPOStatusNew");

              var statusordertype=selectedOrder.get("UsrOrderType");

              var vendorcode=selectedOrder.get("UsrVendorGSTStateCode");

               var statecode=selectedOrder.get("UsrBillToGSTStateCode");

             //this.showInformationDialog(status.displayValue);

             //this.showInformationDialog(statecode);

             if(status.displayValue === "Approved" && statusordertype.displayValue==="Work Order" && vendorcode===statecode)

               {

                 return true;

               }

             else

               

                return false;

            },

          

            // Determines if the menu option is enabled. 

            isCustomActionEnabled: function() {

                // Attempt of getting the active (list selected) record identifier. 

                var activeRowId = this.get("ActiveRow");

              

                // If the identifier is determined and the order status is 

                // [In Progress], it gets true, otherwise - it gets false.

                return activeRowId ? this.isRunning(activeRowId) : false;

            },

             isCustomActionEnabled1: function() {

                // Attempt of getting the active (list selected) record identifier. 

                var activeRowId = this.get("ActiveRow");

              

                // If the identifier is determined and the order status is 

                // [In Progress], it gets true, otherwise - it gets false.

                return activeRowId ? this.isRunning1(activeRowId) : false;

            },

          isCustomActionEnabled2: function() {

                // Attempt of getting the active (list selected) record identifier. 

                var activeRowId = this.get("ActiveRow");

              

                // If the identifier is determined and the order status is 

                // [In Progress], it gets true, otherwise - it gets false.

                return activeRowId ? this.isRunning2(activeRowId) : false;

            },

          isCustomActionEnabled3: function() {

                // Attempt of getting the active (list selected) record identifier. 

                var activeRowId = this.get("ActiveRow");

              

                // If the identifier is determined and the order status is 

                // [In Progress], it gets true, otherwise - it gets false.

                return activeRowId ? this.isRunning3(activeRowId) : false;

            },

            // Action handler method. Displays the order creation date in the message window. 

            showOrderInfo: function() {

                var activeRowId = this.get("ActiveRow");

                var gridData = this.get("GridData");

                // Getting the order creation date. The column must be added to the list. 

               // var dueDate = gridData.get(activeRowId).get("Date");

                // Message window display.

                //this.showInformationDialog("hello");

              

                var args = {

        // Name of the process that should be run.

                 sysProcessName: "UsrProcess_44f0ffe",

                parameters:

                {

                  ProcessSchemaParameter1 : activeRowId

                 }

        // Object with the value of ContractParameter input parameter for CustomProcess parameter.

               };

              //this.showInformationDialog("hello1");

        // Running of user business process.

             ProcessModuleUtilities.executeProcess(args);

              //this.showInformationDialog("hello2");

              

              

            },

            // Overriding the base virtual method that gets the section action collection. 

            getSectionActions: function() {

                // Calling of the method parent implementation for getting the 

                //  initiated action collection of the section. 

                var actionMenuItems = this.callParent(arguments);

                // Adding a separator line.

                actionMenuItems.addItem(this.getButtonMenuItem({

                    Type: "Terrasoft.MenuSeparator",

                    Caption: ""

                }));

                // Adding a menu option to the section action list. 

                actionMenuItems.addItem(this.getButtonMenuItem({

                    // Linking the menu option title to the schema localized string.

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

                    // Action handler method linking. 

                    "Click": {bindTo: "showOrderInfo"},

                    // Linking of the menu option enabling property to the value that gets the isCustomActionEnabled method.

                    "Enabled": {bindTo: "isCustomActionEnabled"},

                   "Visible": {bindTo: "isCustomActionEnabled"}

                }));

               actionMenuItems.addItem(this.getButtonMenuItem({

                    // Linking the menu option title to the schema localized string.

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

                    // Action handler method linking. 

                    "Click": {bindTo: "showOrderInfo"},

                    // Linking of the menu option enabling property to the value that gets the isCustomActionEnabled method.

                    "Enabled": {bindTo: "isCustomActionEnabled1"},

                 "Visible": {bindTo: "isCustomActionEnabled1"}

                }));

               actionMenuItems.addItem(this.getButtonMenuItem({

                    // Linking the menu option title to the schema localized string.

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

                    // Action handler method linking. 

                    "Click": {bindTo: "showOrderInfo"},

                    // Linking of the menu option enabling property to the value that gets the isCustomActionEnabled method.

                    "Enabled": {bindTo: "isCustomActionEnabled2"},

                 "Visible": {bindTo: "isCustomActionEnabled2"}

                }));

               actionMenuItems.addItem(this.getButtonMenuItem({

                    // Linking the menu option title to the schema localized string.

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

                    // Action handler method linking. 

                    "Click": {bindTo: "showOrderInfo"},

                    // Linking of the menu option enabling property to the value that gets the isCustomActionEnabled method.

                    "Enabled": {bindTo: "isCustomActionEnabled3"},

                     "Visible": {bindTo: "isCustomActionEnabled3"}

                }));

                // Getting the appended section action collection.

                return actionMenuItems;

            }

          

        }

    };

});

 

Like 1

Like

2 comments
Best reply

The difference between your trial and your local instance (and why it isn't working in your local instance) is likely because of a difference in the section list layout (the columns added to the list). In order for a field you're using to be available as a part of GridData, it needs to exist in the ESQ behind the list, meaning it needs to be in the column layout - or you need to add the column to the list ESQ. For example, you're using the column "UsrPOStatusNew" from the GridData. If the UsrPOStatusNew column doesn't exist in the list ESQ (which it only will if it's in the column layout for the list), it won't be available. You can add this column and any other column you'll need to access in the section code by adding it to the list ESQ like this:

initQueryColumns: function(esq) {
    this.callParent(arguments);
 
    if (!esq.columns.contains("UsrPOStatusNew")) {
        esq.addColumn("UsrPOStatusNew");
    }
}

Now, when you need to access the UsrPOStatusNew column, it will be available in the GridData. I picked UsrPOStatusNew out of your code as an example, add any other fields you'll need to access in the section code using the same as above.

Ryan

The difference between your trial and your local instance (and why it isn't working in your local instance) is likely because of a difference in the section list layout (the columns added to the list). In order for a field you're using to be available as a part of GridData, it needs to exist in the ESQ behind the list, meaning it needs to be in the column layout - or you need to add the column to the list ESQ. For example, you're using the column "UsrPOStatusNew" from the GridData. If the UsrPOStatusNew column doesn't exist in the list ESQ (which it only will if it's in the column layout for the list), it won't be available. You can add this column and any other column you'll need to access in the section code by adding it to the list ESQ like this:

initQueryColumns: function(esq) {
    this.callParent(arguments);
 
    if (!esq.columns.contains("UsrPOStatusNew")) {
        esq.addColumn("UsrPOStatusNew");
    }
}

Now, when you need to access the UsrPOStatusNew column, it will be available in the GridData. I picked UsrPOStatusNew out of your code as an example, add any other fields you'll need to access in the section code using the same as above.

Ryan

Ryan Farley,

 

Thank You very Much ?

Show all comments

Hi Team,

 

I have a requirement to get data of details attached with a record into fast report designer to generate PDF.

we referred academy but data only from the section was fetched can some please help me to achieve this functionality any other workaround will appreciated.

https://academy.creatio.com/documents/technic-sdk/7-15/setting-reports-…

 

Above article that I used to achieve this funtionality

 

Thank you

Like 1

Like

3 comments

Hello,

 

I've attached the example of provider schema as a .md file as well as the raw text file with code and report template. In the example the report takes ContactAnniversary detail in Contacts. Here is the report setup:

 

http://ftp.creatio.com/support/downloads/SR-0937017/Files.rar

{
    "ProviderName": "ContactAnniversariesReportDataProvider",
    "Schemas": {
        "Contact": {
            "Id": {
                "DataValueType": 0
            },
            "Name": {
                "DataValueType": 1
            },
            "Phone": {
                "DataValueType": 1
            },
            "HomePhone": {
                "DataValueType": 1
            },
            "MobilePhone": {
                "DataValueType": 1
            },
            "OwnerName": {
                "DataValueType": 1
            }
        },
        "ContactAnniversary": {
            "ContactId": {
                "DataValueType": 10,
                "ReferenceSchemaName": "Contact",
                "ReferenceColumnName": "Id"
            },
            "TypeName": {
                "DataValueType": 1
            },
            "Date": {
                "DataValueType": 8
            }
        }
    }
}

 

Best regards,

Oscar

Hi Oscar, I cannot import the md file, I'm getting an error regarding the package: "Unable to save changes for item "Custom". It is either created by third-party publisher or installed from the file archive", how can I import it?

Julio.Falcon_Nodos,

Hello,

 

It's because starting from 7.16.1 this schema was added out-of-the-box and can be found in the "FastReport" package:

So that's why there is no need to add this schema to the system anymore.

 

Best regards,

Oscar

Show all comments