Hi community,

I'm trying to disable the columns of an editable detail to make them read only and I have read many articles about it, but I'm still having a problem that I can't fix.



I wrote this code in the GridDetail to disable the fields but I noticed that for some of the columns of the detail is not working.

getCellControlsConfig: function(entitySchemaColumn) {
    if (!entitySchemaColumn) {
        return;
    }
    var columnName = entitySchemaColumn.name;
    var enabled = (entitySchemaColumn.usageType !== this.Terrasoft.EntitySchemaColumnUsageType.None) &&
        !this.Ext.Array.contains(this.systemColumns, columnName);
    var config = {
        itemType: this.Terrasoft.ViewItemType.MODEL_ITEM,
        name: columnName,
        labelConfig: {visible: false},
        caption: entitySchemaColumn.caption,
        enabled: enabled
    };
    if (!this.values.IsEnabled) {
        config.enabled = false;
        //config.labelConfig.enabled = false;
        //this.set("Is"+columnName+"enabled", false);
    }
    if (entitySchemaColumn.dataValueType === this.Terrasoft.DataValueType.LOOKUP) {
        config.showValueAsLink = false;
    }
    if (entitySchemaColumn.dataValueType !== this.Terrasoft.DataValueType.DATE_TIME &&
        entitySchemaColumn.dataValueType !== this.Terrasoft.DataValueType.BOOLEAN) {
        config.focused = {"bindTo": "Is" + columnName + "Focused"};
    }
    console.log(config);
    return config;
},

Debugging I have discovered that the detail adds to the labelConfig the property "enabled" which is binded to an attribute ("isProductenabled").

I tried to force the property writing it in the method and I also tried to set the attribute manually, but it's not working... do you have any idea?



Let me know.

Thanks in advance.



Best regards,

Luca

Like 0

Like

5 comments
Best reply

Luca Tavasanis,

While I was debugging I have noticed that the properties of the labelConfig that enabled some of the fields where added in the method: "applyBusinessRulesForActiveRow: function(id, gridLayoutItems)" and to fix the issue I just added this method in the client module.

You can lock the fields in the editable detail using business rules on the page for the detail, rather than in code. On the page for the detail, add a business rule to make the field not editable. Something like 

Condition: Boolean true = Boolean false (something that is never true)

Then: Make field editable (the condition is never true, so field is never editable)

The business rule will apply to the detail list and the fields will not be editable in the detail list.

Ryan

Hi Ryan,

I'm actually working with the BaseGridDetail so I can't lock it with a business rule... do you have any other idea?

 

Thanks anyway.

Luca

Luca Tavasanis,

IIRC to do it in code I usually do it like this (but unable to verify if this is correct at the moment)

getCellControlsConfig: function(entitySchemaColumn) {
    // get config from base 
    var config = this.mixins.ConfigurationGridUtilities.getCellControlsConfig.apply(this, arguments);
    var columnName = entitySchemaColumn.name;
 
    // if this is the column I want to disable
    if (columnName === "UsrMyColumn") {
        Ext.apply(config, {
            enabled: false
        });
    }
 
    return config;
}

Hopefully that gets you closer, of course, if you're wanting to disable all, you could just remove the if to check the column it's for.

Ryan

Ryan Farley,

I just tried what you suggested but unfortunately it's not working... it returns an error when I use this.callParent(arguments);.

Thank you anyway.



Luca

Luca Tavasanis,

While I was debugging I have noticed that the properties of the labelConfig that enabled some of the fields where added in the method: "applyBusinessRulesForActiveRow: function(id, gridLayoutItems)" and to fix the issue I just added this method in the client module.

Show all comments

Hi Team,

 

There is an issue we are facing . In the below screen shot , we are opening the edit page via business process but in the normal detail when we add detail records it first saves the parent record which also provides an error if mandatory fields are not filled in . The same functionality is not working in GRID view . Any Idea?

Regards,

Sethuraghav N

Like 0

Like

3 comments

Hello,

 

This is the base logic of the application. You cannot add a record to a detail unless all of the required fields of the object are filled in. I would suggest filling in the required field first or making it not required.

 

Best regards,

Max.

Max,

Hi Max , The problem here is It allowed me to add the record . You can see it in the screenshot where i added the record without filling the mandatory. This is only in the case of editable list 

Sethu Raghav,

Sorry, I misunderstood your question. In this case it would need a deeper investigation. I can see that there is a case SR-01035273 created for this issue and our support team is already working on it!

Show all comments

Dear Community,

 

I have found multiple posts on how to remove the "+" button on the event audience detail in the event section.

We have created a process where people can add an audience but they're not supposed to use the + (add) button on the detail itself.

 

Does anyone have a solution/experience with removing the "+" from the event audience detail? I have succeeded in removing the "+" from other details, but this one seems to be different.

 

Any help or info will be appreciated!

 

Kind regards,

Yosef

Like 0

Like

2 comments
Best reply

Hello Yosef,

To remove the add button on the event audience detail, add the following to the diff in EventTargetDetailV2

diff: /**SCHEMA_DIFF*/[
	{
		"operation": "remove",
		"name": "AddTypedRecordButton"
	}
]/**SCHEMA_DIFF*/

Ryan

Hello Yosef,

To remove the add button on the event audience detail, add the following to the diff in EventTargetDetailV2

diff: /**SCHEMA_DIFF*/[
	{
		"operation": "remove",
		"name": "AddTypedRecordButton"
	}
]/**SCHEMA_DIFF*/

Ryan

Hello Ryan,

 

This seems to work perfectly, thank you!

Show all comments

Hi Team,



I would like to perform an operation on the change of a field in editable detail.

But the onchnage event doesn't trigger.

 

Step 1: Below  is the editable detail, when the value in document field is changed an operation has to be performed (custom logic)



Step 2: Updated the below code in this schema UsrCourierCertDetail (Title: Detail schema: "Acceptance certificates")

attributes:{
   "UsrDocument": {
				dependencies: [{
				  columns: ["UsrDocument"], //field to trigger change event for
				  methodName: "onDocumentchange" //method to execute
				}]
			}
}
 
 
	onDocumentchange :  function(){
            	this.console.log("document chnged")	;
            },
 

but, this Ondocumentchange() is not triggered when the value in document field (UsrDocument) is modified.



kindly guide me on this.





Regards,

Bhoobalan P.

Like 0

Like

4 comments
Best reply

Add the change events to the page for the detail, not in the detail - even though this is an editable detail. It should work if added there. 

Ryan

Add the change events to the page for the detail, not in the detail - even though this is an editable detail. It should work if added there. 

Ryan

Hi Bhoobalan, 



Please follow Ryan's answer, we tested this implementation and it actually works.

 

Best Regards, 

 

Bogdan L.

Ryan Farley,

Thanks for the response and it worked.

Bogdan Lesyk,

Thanks, I followed the implementation on the page for the detail. It worked.

Show all comments

Dear Community,

 

This article shows us how to create a detail with an editable list.

The next step for us is to add an option to open this record like how you can open a page in the City lookup: https://prnt.sc/x79h2l

How do we add this functionality? 

 

Thank you in advance!

 

Kind regards,

Yosef

Like 0

Like

3 comments
Best reply

Hello Yosef,

I have an article outlining how to do this here https://customerfx.com/article/adding-an-edit-button-to-the-selected-ro…

Hope this helps. 

Ryan

Hello Yosef,

I have an article outlining how to do this here https://customerfx.com/article/adding-an-edit-button-to-the-selected-ro…

Hope this helps. 

Ryan

Ryan Farley,

Works like a charm!

I do however recommend adding the following for consistency:

{
  "className": "Terrasoft.Button",
  "style": this.Terrasoft.controls.ButtonEnums.style.TRANSPARENT,
  "tag": "edit",
  "markerValue": "edit",
  "imageConfig": {"bindTo": "Resources.Images.CardIcon"}
},

This way you get the same icon as the other details.

 

Kind regards,

Yosef

Yosef,

That is true, I do have that in the article as well (it's at the end of the article), however at the time I was doing this for a system where they wanted the "edit" action more obvious to users. However, for consistency with the rest of Creatio, I'd go the route of using the icon as well.

Glad it worked for you.

Ryan

Show all comments

Hi Team,

 

I have implemented the Multiselect lookup detail and Editable detail list from the following Articles to the same detail.

MultiSelect Lookup - https://academy.creatio.com/documents/technic-sdk/7-16/creating-detail-…

Editable Detail List - https://academy.creatio.com/documents/technic-sdk/7-15/adding-detail-ed…

 

Step 1 : I'm selecting a record from Multiselct and it adds to the detail.

Step 2 : I'm clicking on the added row but it becomes empty as shown in the attachment.

 

Note:

It is working when i refreshed the page,.

 

Thanks in advance!

 

Regards,

Bhoobalan P.

 

Image 1 : Before adding data from multiselct lookup.

 

Image 2 : After adding data from Multiselct lookup.

 

Image 3 :  After clicking on the added record.

Like 0

Like

12 comments
Best reply

Bhoobalan Palanivelu,

Please use the following updated code that will perfectly work and won;t return an error upon record adding:

// Defining schema and setting its dependencies from other modules.
define("UsrCourierServiceDetail", ["BusinessRulesApplierV2","ConfigurationGrid", "ConfigurationGridGenerator",
    "ConfigurationEnums","ConfigurationGridUtilities",
    "css!UsrCourierServiceDetailCSS"],function(configurationEnums) {
        return {
            // Name of the detail object schema.
            entitySchemaName: "UsrCourierService",
             attributes: {
            // Determines whether the editing is enabled.
            "IsEditable": {
                // Data type — logic.
                dataValueType: Terrasoft.DataValueType.BOOLEAN,
                // Attribute type — virtual column of the view model.
                type: Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN,
                // Set value.
                value: true
            }
        },
 
 
        // Used mixins.
        mixins: {
            ConfigurationGridUtilities: "Terrasoft.ConfigurationGridUtilities"
        },
            // Detail schema methods.
            methods: {
 
              //Returns columns selected by query.
                getGridDataColumns: function() {
                    return {
                        "Id": {path: "Id"},
                        "Document": {path: "UsrDocument"},
                        "Document.Number": {path: "UsrDocument.Number"}
                    };
                },
 
                //Configures and displays modal lookup window.
                openDocumentLookup: function() {
                    //Configuration object
                    var config = {
                        // Name of the object schema whose records will be displayed in the lookup.
                        entitySchemaName: "Document",
                        // Multiple selection option.
                        multiSelect: true,
                        // Columns used in the lookup, e.g., for sorting.
                        columns: ["Number", "Date", "Type"]
                    };
                    var OrderId = this.get("MasterRecordId");
                    if (this.Ext.isEmpty(OrderId)) {
                        return;
                    }
                    // The [EntitySchemaQuery] class instance.
                    var esq = this.Ext.create("Terrasoft.EntitySchemaQuery", {
                        // Setting up the root schema.
                        rootSchemaName: this.entitySchemaName
                    });
                    // Adding the [Id] column.
                    esq.addColumn("Id");
                    // Adding the [Id] column for the [Document] schema.
                    esq.addColumn("Document.Id", "DocumentId");
                    // Creating and adding filters to query collection.
                    esq.filters.add("filterOrder", this.Terrasoft.createColumnFilterWithParameter(
                        this.Terrasoft.ComparisonType.EQUAL, "UsrOrder", OrderId));
                    // Receiving the whole record collection and its display in the modal lookup window.
                    esq.getEntityCollection(function(result) {
                        var existsDocumentsCollection = [];
                        if (result.success) {
                            result.collection.each(function(item) {
                                existsDocumentsCollection.push(item.get("DocumentId"));
                            });
                        }
                        // Adding filter to the configuration object.
                        if (existsDocumentsCollection.length > 0) {
                            var existsFilter = this.Terrasoft.createColumnInFilterWithParameters("Id",
                                existsDocumentsCollection);
                            existsFilter.comparisonType = this.Terrasoft.ComparisonType.NOT_EQUAL;
                            existsFilter.Name = "existsFilter";
                            config.filters = existsFilter;
                        }
                        // Call of the modal lookup window
                        this.openLookup(config, this.addCallBack, this);
                    }, this);
                },
 
                // Event handler of saving the edit page.
                onCardSaved: function() {
                    this.openDocumentLookup();
                },
 
                //Opens the document lookup if the order edit page has been saved.
                addRecord: function() {
                    var masterCardState = this.sandbox.publish("GetCardState", null, [this.sandbox.id]);
                    var isNewRecord = (masterCardState.state === Terrasoft.ConfigurationEnums.CardOperation.ADD ||
                    masterCardState.state === Terrasoft.ConfigurationEnums.CardOperation.COPY);
                    if (isNewRecord === true) {
                        var args = {
                            isSilent: true,
                            messageTags: [this.sandbox.id]
                        };
                        this.sandbox.publish("SaveRecord", args, [this.sandbox.id]);
                        return;
                    }
                    this.openDocumentLookup();
                },
 
                // Adding the selected products.
                addCallBack: function(args) {
                    // Class instance of the BatchQuery package query.
                    var bq = this.Ext.create("Terrasoft.BatchQuery");
                    var OrderId = this.get("MasterRecordId");
                    // Collection of the selected documents from the lookup.
                    this.selectedRows = args.selectedRows.getItems();
                    // Collection passed over to query.
                    this.selectedItems = [];
                    // Copying the necessary data.
                    this.selectedRows.forEach(function(item) {
                        item.OrderId = OrderId;
                        item.DocumentId = item.value;
                        bq.add(this.getDocumentInsertQuery(item));
                        this.selectedItems.push(item.value);
                    }, this);
                    // Executing the package query if it is not empty.
                    if (bq.queries.length) {
                        this.showBodyMask.call(this);
                        bq.execute(this.onDocumentInsert, this);
                    }
                },
 
                //Returns query for adding the current object.
                getDocumentInsertQuery: function(item) {
                    var insert = Ext.create("Terrasoft.InsertQuery", {
                        rootSchemaName: this.entitySchemaName
                    });
                    insert.setParameterValue("UsrOrder", item.OrderId, this.Terrasoft.DataValueType.GUID);
                    insert.setParameterValue("UsrDocument", item.DocumentId, this.Terrasoft.DataValueType.GUID);
                    return insert;
                },
 
                //Method called when adding records to the detail record list.
                onDocumentInsert: function(response) {
                    this.hideBodyMask.call(this);
                    this.beforeLoadGridData();
                    var filterCollection = [];
                    response.queryResults.forEach(function(item) {
                        filterCollection.push(item.id);
                    });
                    var esq = Ext.create("Terrasoft.EntitySchemaQuery", {
                        rootSchemaName: this.entitySchemaName
                    });
                    this.initQueryColumns(esq);
                    esq.filters.add("recordId", Terrasoft.createColumnInFilterWithParameters("Id", filterCollection));
                    // Create viewmodel for new items
                    esq.on("createviewmodel", this.createViewModel, this);
                    esq.getEntityCollection(function(response) {
                        this.afterLoadGridData();
                        if (response.success) {
                            var responseCollection = response.collection;
                            this.prepareResponseCollection(responseCollection);
                            this.getGridData().loadAll(responseCollection);
                        }
                    }, this);
 
                },
 
                // Method called when deleting records from the detail record list.
                deleteRecords: function() {
                    var selectedRows = this.getSelectedItems();
                    if (selectedRows.length > 0) {
                        this.set("SelectedRows", selectedRows);
                        this.callParent(arguments);
                    }
                },
 
                // Hide the [Copy] menu option.
                getCopyRecordMenuItem: Terrasoft.emptyFn,
                 // Hide the [Edit] menu option.
                getEditRecordMenuItem: Terrasoft.emptyFn,
                // Returns the default filter column name.
                getFilterDefaultColumnName: function() {
                    return "UsrDocument";
                }
            },
            // Modification array.
            diff: /**SCHEMA_DIFF*/[
                {
                // Operation type — merging.
                "operation": "merge",
                // Name of the schema element, with which the action is performed.
                "name": "DataGrid",
                // Object, whose properties will be joined with the schema element properties.
                "values": {
                    // Class name
                    "className": "Terrasoft.ConfigurationGrid",
                    // View generator must generate only part of view.
                    "generator": "ConfigurationGridGenerator.generatePartial",
                    // Binding the edit elements configuration obtaining event
                    // of the active page to handler method.
                    "generateControlsConfig": {"bindTo": "generateActiveRowControlsConfig"},
                    // Binding the active record changing event to handler method.
                    "changeRow": {"bindTo": "changeRow"},
                    // Binding the record selection cancellation event to handler method.
                    "unSelectRow": {"bindTo": "unSelectRow"},
                    // Binding of the list click event to handler method.
                    "onGridClick": {"bindTo": "onGridClick"},
                    // Actions performed with active record.
                    "activeRowActions": [
                        // [Save] action setup.
                        {
                            // Class name of the control element, with which the action is connected.
                            "className": "Terrasoft.Button",
                            // Display style — transparent button.
                            "style": this.Terrasoft.controls.ButtonEnums.style.TRANSPARENT,
                            // Tag.
                            "tag": "save",
                            // Marker value.
                            "markerValue": "save",
                            // Binding button image.
                            "imageConfig": {"bindTo": "Resources.Images.SaveIcon"}
                        },
                        // [Cancel] action setup.
                        {
                            "className": "Terrasoft.Button",
                            "style": this.Terrasoft.controls.ButtonEnums.style.TRANSPARENT,
                            "tag": "cancel",
                            "markerValue": "cancel",
                            "imageConfig": {"bindTo": "Resources.Images.CancelIcon"}
                        },
                        // [Delete] action setup.
                        {
                            "className": "Terrasoft.Button",
                            "style": this.Terrasoft.controls.ButtonEnums.style.TRANSPARENT,
                            "tag": "remove",
                            "markerValue": "remove",
                            "imageConfig": {"bindTo": "Resources.Images.RemoveIcon"}
                        }
                    ],
                    // Binding to method that initializes subscription to events
                    // of clicking buttons in the active row.
                    "initActiveRowKeyMap": {"bindTo": "initActiveRowKeyMap"},
                    // Binding the active record action completion event to handler method.
                    "activeRowAction": {"bindTo": "onActiveRowAction"},
                    // Identifies whether multiple records can be selected.
                    "multiSelect": {"bindTo": "MultiSelect"}
                }
            },
                {
                    // Operation type - merging.
                    "operation": "merge",
                    // Name of the schema element under operation.
                    "name": "DataGrid",
                    // The object, whose properties will be combined with the schema element properties.
                    "values": {
                        "rowDataItemMarkerColumnName": "UsrDocument"
                    }
                },
                {
                    // Operation type - merging.
                    "operation": "merge",
                    // Name of the schema element under operation.
                    "name": "AddRecordButton",
                    // The object, whose properties will be combined with the schema element properties.
                    "values": {
                    	"click":{"bindTo":"addRecord"},
                        "visible": {"bindTo": "getToolsVisible"}
                    }
                }
            ]/**SCHEMA_DIFF*/
        };
    }
);

The trick is in the esq.on("createviewmodel", this.createViewModel, this); string in the onDocumentInsert method.

 

Best regards,

Oscar

Hi,

 

Please provide us with the error message that you receive upon clicking the record, the screenshot of the detail configuration (name, title, parent object) and also with the code of the detail itself.

 

Best regards,

Oscar

Oscar Dylan,

Thanks for the response!



I have provided the code of deatil itself where both muliselect and editable list is implemented and the error screenshot attachment.

 



 

define("UsrCourierCertDetail", ["ConfigurationEnums","ConfigurationGrid", "ConfigurationGridGenerator",

    "ConfigurationGridUtilities"],

    function(configurationEnums) {

        return {

            // Name of the detail object schema.

            entitySchemaName: "UsrCourierCertInOrder",

             attributes: {

            // Determines whether the editing is enabled.

            "IsEditable": {

                // Data type — logic.

                dataValueType: Terrasoft.DataValueType.BOOLEAN,

                // Attribute type — virtual column of the view model.

                type: Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN,

                // Set value.

                value: true

            }

        },

       

        

        // Used mixins.

        mixins: {

            ConfigurationGridUtilities: "Terrasoft.ConfigurationGridUtilities"

        },

            // Detail schema methods.

            methods: {

                        

              //Returns columns selected by query.

                getGridDataColumns: function() {

                    return {

                        "Id": {path: "Id"},

                        "Document": {path: "UsrDocument"},

                        "Document.Number": {path: "UsrDocument.Number"}

                    };

                },

                //Configures and displays modal lookup window.

                openDocumentLookup: function() {

                    //Configuration object

                    var config = {

                        // Name of the object schema whose records will be displayed in the lookup.

                        entitySchemaName: "Document",

                        // Multiple selection option.

                        multiSelect: true,

                        // Columns used in the lookup, e.g., for sorting.

                        columns: ["Number", "Date", "Type"]

                    };

                    var OrderId = this.get("MasterRecordId");

                    if (this.Ext.isEmpty(OrderId)) {

                        return;

                    }

                    // The [EntitySchemaQuery] class instance.

                    var esq = this.Ext.create("Terrasoft.EntitySchemaQuery", {

                        // Setting up the root schema.

                        rootSchemaName: this.entitySchemaName

                    });

                    // Adding the [Id] column.

                    esq.addColumn("Id");

                    // Adding the [Id] column for the [Document] schema.

                    esq.addColumn("Document.Id", "DocumentId");

                    // Creating and adding filters to query collection.

                    esq.filters.add("filterOrder", this.Terrasoft.createColumnFilterWithParameter(

                        this.Terrasoft.ComparisonType.EQUAL, "UsrOrder", OrderId));

                    // Receiving the whole record collection and its display in the modal lookup window.

                    esq.getEntityCollection(function(result) {

                        var existsDocumentsCollection = [];

                        if (result.success) {

                            result.collection.each(function(item) {

                                existsDocumentsCollection.push(item.get("DocumentId"));

                            });

                        }

                        // Adding filter to the configuration object.

                        if (existsDocumentsCollection.length > 0) {

                            var existsFilter = this.Terrasoft.createColumnInFilterWithParameters("Id",

                                existsDocumentsCollection);

                            existsFilter.comparisonType = this.Terrasoft.ComparisonType.NOT_EQUAL;

                            existsFilter.Name = "existsFilter";

                            config.filters = existsFilter;

                        }

                        // Call of the modal lookup window

                        this.openLookup(config, this.addCallBack, this);

                    }, this);

                },

                // Event handler of saving the edit page.

                onCardSaved: function() {

                    this.openDocumentLookup();

                },

                //Opens the document lookup if the order edit page has been saved.

                addRecord: function() {

                    var masterCardState = this.sandbox.publish("GetCardState", null, [this.sandbox.id]);

                    var isNewRecord = (masterCardState.state === configurationEnums.CardStateV2.ADD ||

                    masterCardState.state === configurationEnums.CardStateV2.COPY);

                    if (isNewRecord === true) {

                        var args = {

                            isSilent: true,

                            messageTags: [this.sandbox.id]

                        };

                        this.sandbox.publish("SaveRecord", args, [this.sandbox.id]);

                        return;

                    }

                    this.openDocumentLookup();

                },

                // Adding the selected products.

                addCallBack: function(args) {

                    // Class instance of the BatchQuery package query.

                    var bq = this.Ext.create("Terrasoft.BatchQuery");

                    var OrderId = this.get("MasterRecordId");

                    // Collection of the selected documents from the lookup.

                    this.selectedRows = args.selectedRows.getItems();

                    // Collection passed over to query.

                    this.selectedItems = [];

                    // Copying the necessary data.

                    this.selectedRows.forEach(function(item) {

                        item.OrderId = OrderId;

                        item.DocumentId = item.value;

                        bq.add(this.getDocumentInsertQuery(item));

                        this.selectedItems.push(item.value);

                    }, this);

                    // Executing the package query if it is not empty.

                    if (bq.queries.length) {

                        this.showBodyMask.call(this);

                        bq.execute(this.onDocumentInsert, this);

                    }

                },

                //Returns query for adding the current object.

                getDocumentInsertQuery: function(item) {

                    var insert = Ext.create("Terrasoft.InsertQuery", {

                        rootSchemaName: this.entitySchemaName

                    });

                    insert.setParameterValue("UsrOrder", item.OrderId, this.Terrasoft.DataValueType.GUID);

                    insert.setParameterValue("UsrDocument", item.DocumentId, this.Terrasoft.DataValueType.GUID);

                    return insert;

                },

                //Method called when adding records to the detail record list.

                onDocumentInsert: function(response) {

                    this.hideBodyMask.call(this);

                    this.beforeLoadGridData();

                    var filterCollection = [];

                    response.queryResults.forEach(function(item) {

                        filterCollection.push(item.id);

                    });

                    var esq = Ext.create("Terrasoft.EntitySchemaQuery", {

                        rootSchemaName: this.entitySchemaName

                    });

                    this.initQueryColumns(esq);

                    esq.filters.add("recordId", Terrasoft.createColumnInFilterWithParameters("Id", filterCollection));

                    esq.getEntityCollection(function(response) {

                        this.afterLoadGridData();

                        if (response.success) {

                            var responseCollection = response.collection;

                            this.prepareResponseCollection(responseCollection);

                            this.getGridData().loadAll(responseCollection);

                        }

                    }, this);

                   

                },

                // Method called when deleting records from the detail record list.

                deleteRecords: function() {

                    var selectedRows = this.getSelectedItems();

                    if (selectedRows.length > 0) {

                        this.set("SelectedRows", selectedRows);

                        this.callParent(arguments);

                    }

                },

                // Hide the [Copy] menu option.

                getCopyRecordMenuItem: Terrasoft.emptyFn,

                 // Hide the [Edit] menu option.

                getEditRecordMenuItem: Terrasoft.emptyFn,

                // Returns the default filter column name.

                getFilterDefaultColumnName: function() {

                    return "UsrDocument";

                }

            },

            // Modification array.

            diff: /**SCHEMA_DIFF*/[

                {

                // Operation type — merging.

                "operation": "merge",

                // Name of the schema element, with which the action is performed.

                "name": "DataGrid",

                // Object, whose properties will be joined with the schema element properties.

                "values": {

                    // Class name

                    "className": "Terrasoft.ConfigurationGrid",

                    // View generator must generate only part of view.

                    "generator": "ConfigurationGridGenerator.generatePartial",

                    // Binding the edit elements configuration obtaining event

                    // of the active page to handler method.

                    "generateControlsConfig": {"bindTo": "generateActiveRowControlsConfig"},

                    // Binding the active record changing event to handler method.

                    "changeRow": {"bindTo": "changeRow"},

                    // Binding the record selection cancellation event to handler method.

                    "unSelectRow": {"bindTo": "unSelectRow"},

                    // Binding of the list click event to handler method.

                    "onGridClick": {"bindTo": "onGridClick"},

                    // Actions performed with active record.

                    "activeRowActions": [

                        // [Save] action setup.

                        {

                            // Class name of the control element, with which the action is connected.

                            "className": "Terrasoft.Button",

                            // Display style — transparent button.

                            "style": this.Terrasoft.controls.ButtonEnums.style.TRANSPARENT,

                            // Tag.

                            "tag": "save",

                            // Marker value.

                            "markerValue": "save",

                            // Binding button image.

                            "imageConfig": {"bindTo": "Resources.Images.SaveIcon"}

                        },

                        // [Cancel] action setup.

                        {

                            "className": "Terrasoft.Button",

                            "style": this.Terrasoft.controls.ButtonEnums.style.TRANSPARENT,

                            "tag": "cancel",

                            "markerValue": "cancel",

                            "imageConfig": {"bindTo": "Resources.Images.CancelIcon"}

                        },

                        // [Delete] action setup.

                        {

                            "className": "Terrasoft.Button",

                            "style": this.Terrasoft.controls.ButtonEnums.style.TRANSPARENT,

                            "tag": "remove",

                            "markerValue": "remove",

                            "imageConfig": {"bindTo": "Resources.Images.RemoveIcon"}

                        }

                    ],

                    // Binding to method that initializes subscription to events

                    // of clicking buttons in the active row.

                    "initActiveRowKeyMap": {"bindTo": "initActiveRowKeyMap"},

                    // Binding the active record action completion event to handler method.

                    "activeRowAction": {"bindTo": "onActiveRowAction"},

                    // Identifies whether multiple records can be selected.

                    "multiSelect": {"bindTo": "MultiSelect"}

                }

            },

                {

                    // Operation type - merging.

                    "operation": "merge",

                    // Name of the schema element under operation.

                    "name": "DataGrid",

                    // The object, whose properties will be combined with the schema element properties.

                    "values": {

                        "rowDataItemMarkerColumnName": "UsrDocument"

                    }

                },

                {

                    // Operation type - merging.

                    "operation": "merge",

                    // Name of the schema element under operation.

                    "name": "AddRecordButton",

                    // The object, whose properties will be combined with the schema element properties.

                    "values": {

                        "visible": {"bindTo": "getToolsVisible"}

                    }

                }

            ]/**SCHEMA_DIFF*/

        };

    }

);

Bhoobalan Palanivelu,

and can you please provide us with the screenshot of the parent object for the detail? Like this one:

Thank you!

 

Best regards,

Oscar

Oscar Dylan,

 

Please find the attached screenshot!

 

Bhoobalan Palanivelu,

 

Thank you! I've deployed the same code and object on my end and the detail works (also I modified the code a little bit since it returned an error on my end because of this part

 var isNewRecord = (masterCardState.state === configurationEnums.CardStateV2.ADD ||
                    masterCardState.state === configurationEnums.CardStateV2.COPY);

):

// Defining schema and setting its dependencies from other modules.
define("UsrCourierServiceDetail", ["BusinessRulesApplierV2","ConfigurationGrid", "ConfigurationGridGenerator",
    "ConfigurationEnums","ConfigurationGridUtilities",
    "css!UsrCourierServiceDetailCSS"],function(configurationEnums) {
        return {
            // Name of the detail object schema.
            entitySchemaName: "UsrCourierService",
             attributes: {
            // Determines whether the editing is enabled.
            "IsEditable": {
                // Data type — logic.
                dataValueType: Terrasoft.DataValueType.BOOLEAN,
                // Attribute type — virtual column of the view model.
                type: Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN,
                // Set value.
                value: true
            }
        },
 
 
        // Used mixins.
        mixins: {
            ConfigurationGridUtilities: "Terrasoft.ConfigurationGridUtilities"
        },
            // Detail schema methods.
            methods: {
 
              //Returns columns selected by query.
                getGridDataColumns: function() {
                    return {
                        "Id": {path: "Id"},
                        "Document": {path: "UsrDocument"},
                        "Document.Number": {path: "UsrDocument.Number"}
                    };
                },
 
                //Configures and displays modal lookup window.
                openDocumentLookup: function() {
                    //Configuration object
                    var config = {
                        // Name of the object schema whose records will be displayed in the lookup.
                        entitySchemaName: "Document",
                        // Multiple selection option.
                        multiSelect: true,
                        // Columns used in the lookup, e.g., for sorting.
                        columns: ["Number", "Date", "Type"]
                    };
                    var OrderId = this.get("MasterRecordId");
                    if (this.Ext.isEmpty(OrderId)) {
                        return;
                    }
                    // The [EntitySchemaQuery] class instance.
                    var esq = this.Ext.create("Terrasoft.EntitySchemaQuery", {
                        // Setting up the root schema.
                        rootSchemaName: this.entitySchemaName
                    });
                    // Adding the [Id] column.
                    esq.addColumn("Id");
                    // Adding the [Id] column for the [Document] schema.
                    esq.addColumn("Document.Id", "DocumentId");
                    // Creating and adding filters to query collection.
                    esq.filters.add("filterOrder", this.Terrasoft.createColumnFilterWithParameter(
                        this.Terrasoft.ComparisonType.EQUAL, "UsrOrder", OrderId));
                    // Receiving the whole record collection and its display in the modal lookup window.
                    esq.getEntityCollection(function(result) {
                        var existsDocumentsCollection = [];
                        if (result.success) {
                            result.collection.each(function(item) {
                                existsDocumentsCollection.push(item.get("DocumentId"));
                            });
                        }
                        // Adding filter to the configuration object.
                        if (existsDocumentsCollection.length > 0) {
                            var existsFilter = this.Terrasoft.createColumnInFilterWithParameters("Id",
                                existsDocumentsCollection);
                            existsFilter.comparisonType = this.Terrasoft.ComparisonType.NOT_EQUAL;
                            existsFilter.Name = "existsFilter";
                            config.filters = existsFilter;
                        }
                        // Call of the modal lookup window
                        this.openLookup(config, this.addCallBack, this);
                    }, this);
                },
 
                // Event handler of saving the edit page.
                onCardSaved: function() {
                    this.openDocumentLookup();
                },
 
                //Opens the document lookup if the order edit page has been saved.
                addRecord: function() {
                    var masterCardState = this.sandbox.publish("GetCardState", null, [this.sandbox.id]);
                    var isNewRecord = (masterCardState.state === Terrasoft.ConfigurationEnums.CardOperation.ADD ||
                    masterCardState.state === Terrasoft.ConfigurationEnums.CardOperation.COPY);
                    if (isNewRecord === true) {
                        var args = {
                            isSilent: true,
                            messageTags: [this.sandbox.id]
                        };
                        this.sandbox.publish("SaveRecord", args, [this.sandbox.id]);
                        return;
                    }
                    this.openDocumentLookup();
                },
 
                // Adding the selected products.
                addCallBack: function(args) {
                    // Class instance of the BatchQuery package query.
                    var bq = this.Ext.create("Terrasoft.BatchQuery");
                    var OrderId = this.get("MasterRecordId");
                    // Collection of the selected documents from the lookup.
                    this.selectedRows = args.selectedRows.getItems();
                    // Collection passed over to query.
                    this.selectedItems = [];
                    // Copying the necessary data.
                    this.selectedRows.forEach(function(item) {
                        item.OrderId = OrderId;
                        item.DocumentId = item.value;
                        bq.add(this.getDocumentInsertQuery(item));
                        this.selectedItems.push(item.value);
                    }, this);
                    // Executing the package query if it is not empty.
                    if (bq.queries.length) {
                        this.showBodyMask.call(this);
                        bq.execute(this.onDocumentInsert, this);
                    }
                },
 
                //Returns query for adding the current object.
                getDocumentInsertQuery: function(item) {
                    var insert = Ext.create("Terrasoft.InsertQuery", {
                        rootSchemaName: this.entitySchemaName
                    });
                    insert.setParameterValue("UsrOrder", item.OrderId, this.Terrasoft.DataValueType.GUID);
                    insert.setParameterValue("UsrDocument", item.DocumentId, this.Terrasoft.DataValueType.GUID);
                    return insert;
                },
 
                //Method called when adding records to the detail record list.
                onDocumentInsert: function(response) {
                    this.hideBodyMask.call(this);
                    this.beforeLoadGridData();
                    var filterCollection = [];
                    response.queryResults.forEach(function(item) {
                        filterCollection.push(item.id);
                    });
                    var esq = Ext.create("Terrasoft.EntitySchemaQuery", {
                        rootSchemaName: this.entitySchemaName
                    });
                    this.initQueryColumns(esq);
                    esq.filters.add("recordId", Terrasoft.createColumnInFilterWithParameters("Id", filterCollection));
                    esq.getEntityCollection(function(response) {
                        this.afterLoadGridData();
                        if (response.success) {
                            var responseCollection = response.collection;
                            this.prepareResponseCollection(responseCollection);
                            this.getGridData().loadAll(responseCollection);
                        }
                    }, this);
 
                },
 
                // Method called when deleting records from the detail record list.
                deleteRecords: function() {
                    var selectedRows = this.getSelectedItems();
                    if (selectedRows.length > 0) {
                        this.set("SelectedRows", selectedRows);
                        this.callParent(arguments);
                    }
                },
 
                // Hide the [Copy] menu option.
                getCopyRecordMenuItem: Terrasoft.emptyFn,
                 // Hide the [Edit] menu option.
                getEditRecordMenuItem: Terrasoft.emptyFn,
                // Returns the default filter column name.
                getFilterDefaultColumnName: function() {
                    return "UsrDocument";
                }
            },
            // Modification array.
            diff: /**SCHEMA_DIFF*/[
                {
                // Operation type — merging.
                "operation": "merge",
                // Name of the schema element, with which the action is performed.
                "name": "DataGrid",
                // Object, whose properties will be joined with the schema element properties.
                "values": {
                    // Class name
                    "className": "Terrasoft.ConfigurationGrid",
                    // View generator must generate only part of view.
                    "generator": "ConfigurationGridGenerator.generatePartial",
                    // Binding the edit elements configuration obtaining event
                    // of the active page to handler method.
                    "generateControlsConfig": {"bindTo": "generateActiveRowControlsConfig"},
                    // Binding the active record changing event to handler method.
                    "changeRow": {"bindTo": "changeRow"},
                    // Binding the record selection cancellation event to handler method.
                    "unSelectRow": {"bindTo": "unSelectRow"},
                    // Binding of the list click event to handler method.
                    "onGridClick": {"bindTo": "onGridClick"},
                    // Actions performed with active record.
                    "activeRowActions": [
                        // [Save] action setup.
                        {
                            // Class name of the control element, with which the action is connected.
                            "className": "Terrasoft.Button",
                            // Display style — transparent button.
                            "style": this.Terrasoft.controls.ButtonEnums.style.TRANSPARENT,
                            // Tag.
                            "tag": "save",
                            // Marker value.
                            "markerValue": "save",
                            // Binding button image.
                            "imageConfig": {"bindTo": "Resources.Images.SaveIcon"}
                        },
                        // [Cancel] action setup.
                        {
                            "className": "Terrasoft.Button",
                            "style": this.Terrasoft.controls.ButtonEnums.style.TRANSPARENT,
                            "tag": "cancel",
                            "markerValue": "cancel",
                            "imageConfig": {"bindTo": "Resources.Images.CancelIcon"}
                        },
                        // [Delete] action setup.
                        {
                            "className": "Terrasoft.Button",
                            "style": this.Terrasoft.controls.ButtonEnums.style.TRANSPARENT,
                            "tag": "remove",
                            "markerValue": "remove",
                            "imageConfig": {"bindTo": "Resources.Images.RemoveIcon"}
                        }
                    ],
                    // Binding to method that initializes subscription to events
                    // of clicking buttons in the active row.
                    "initActiveRowKeyMap": {"bindTo": "initActiveRowKeyMap"},
                    // Binding the active record action completion event to handler method.
                    "activeRowAction": {"bindTo": "onActiveRowAction"},
                    // Identifies whether multiple records can be selected.
                    "multiSelect": {"bindTo": "MultiSelect"}
                }
            },
                {
                    // Operation type - merging.
                    "operation": "merge",
                    // Name of the schema element under operation.
                    "name": "DataGrid",
                    // The object, whose properties will be combined with the schema element properties.
                    "values": {
                        "rowDataItemMarkerColumnName": "UsrDocument"
                    }
                },
                {
                    // Operation type - merging.
                    "operation": "merge",
                    // Name of the schema element under operation.
                    "name": "AddRecordButton",
                    // The object, whose properties will be combined with the schema element properties.
                    "values": {
                    	"click":{"bindTo":"addRecord"},
                        "visible": {"bindTo": "getToolsVisible"}
                    }
                }
            ]/**SCHEMA_DIFF*/
        };
    }
);

And also the parent object is "Base schema - Detail with list ( NUI )". Records can be added on my end and please copy the code that I used on my end and use it on your side. Also try recreating the detail from scratch. Also don't forget to check if your object (that is specified in the "entitySchemaName" part of the code).

 

Best regards,

Oscar

Oscar Dylan,

 

Thanks for the response.

 

I can add the records, but when i click on the added record, the record values get disappearing as shown in the image.

 

Thanks in advance!

 

After Adding the record:

 

After Clicking the Added Record:



 

Bhoobalan Palanivelu,

 

Please perform all the steps that I've mentioned in the previous email. The record doesn't disappear on our end when clicking on the detail record. Also you may need to recreate the detail from scratch. Please see the screenshot of the detail from our end:

Best regards,

Oscar

Oscar Dylan,

Yes, I tried the same as you suggested.

 

This happens for the recently added record.

when recently added record is selected this issue persists.

Step 1 : Click on + sign

Step 2 : Choose a record from multi select and click on select.

Step 3: The record is added in courier service detail.

Step 4 : click on the same record that is selected during + sign click and selected one. (The values disapperaing in this case).



After refresh it is fine.

Bhoobalan Palanivelu,

 

Yes indeed, using this scenario the issue can be reproduced. Looking into it now.

 

Best regards,

Oscar

Oscar Dylan,

Thanks much for taking this into consideration. 

 

Bhoobalan Palanivelu,

Please use the following updated code that will perfectly work and won;t return an error upon record adding:

// Defining schema and setting its dependencies from other modules.
define("UsrCourierServiceDetail", ["BusinessRulesApplierV2","ConfigurationGrid", "ConfigurationGridGenerator",
    "ConfigurationEnums","ConfigurationGridUtilities",
    "css!UsrCourierServiceDetailCSS"],function(configurationEnums) {
        return {
            // Name of the detail object schema.
            entitySchemaName: "UsrCourierService",
             attributes: {
            // Determines whether the editing is enabled.
            "IsEditable": {
                // Data type — logic.
                dataValueType: Terrasoft.DataValueType.BOOLEAN,
                // Attribute type — virtual column of the view model.
                type: Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN,
                // Set value.
                value: true
            }
        },
 
 
        // Used mixins.
        mixins: {
            ConfigurationGridUtilities: "Terrasoft.ConfigurationGridUtilities"
        },
            // Detail schema methods.
            methods: {
 
              //Returns columns selected by query.
                getGridDataColumns: function() {
                    return {
                        "Id": {path: "Id"},
                        "Document": {path: "UsrDocument"},
                        "Document.Number": {path: "UsrDocument.Number"}
                    };
                },
 
                //Configures and displays modal lookup window.
                openDocumentLookup: function() {
                    //Configuration object
                    var config = {
                        // Name of the object schema whose records will be displayed in the lookup.
                        entitySchemaName: "Document",
                        // Multiple selection option.
                        multiSelect: true,
                        // Columns used in the lookup, e.g., for sorting.
                        columns: ["Number", "Date", "Type"]
                    };
                    var OrderId = this.get("MasterRecordId");
                    if (this.Ext.isEmpty(OrderId)) {
                        return;
                    }
                    // The [EntitySchemaQuery] class instance.
                    var esq = this.Ext.create("Terrasoft.EntitySchemaQuery", {
                        // Setting up the root schema.
                        rootSchemaName: this.entitySchemaName
                    });
                    // Adding the [Id] column.
                    esq.addColumn("Id");
                    // Adding the [Id] column for the [Document] schema.
                    esq.addColumn("Document.Id", "DocumentId");
                    // Creating and adding filters to query collection.
                    esq.filters.add("filterOrder", this.Terrasoft.createColumnFilterWithParameter(
                        this.Terrasoft.ComparisonType.EQUAL, "UsrOrder", OrderId));
                    // Receiving the whole record collection and its display in the modal lookup window.
                    esq.getEntityCollection(function(result) {
                        var existsDocumentsCollection = [];
                        if (result.success) {
                            result.collection.each(function(item) {
                                existsDocumentsCollection.push(item.get("DocumentId"));
                            });
                        }
                        // Adding filter to the configuration object.
                        if (existsDocumentsCollection.length > 0) {
                            var existsFilter = this.Terrasoft.createColumnInFilterWithParameters("Id",
                                existsDocumentsCollection);
                            existsFilter.comparisonType = this.Terrasoft.ComparisonType.NOT_EQUAL;
                            existsFilter.Name = "existsFilter";
                            config.filters = existsFilter;
                        }
                        // Call of the modal lookup window
                        this.openLookup(config, this.addCallBack, this);
                    }, this);
                },
 
                // Event handler of saving the edit page.
                onCardSaved: function() {
                    this.openDocumentLookup();
                },
 
                //Opens the document lookup if the order edit page has been saved.
                addRecord: function() {
                    var masterCardState = this.sandbox.publish("GetCardState", null, [this.sandbox.id]);
                    var isNewRecord = (masterCardState.state === Terrasoft.ConfigurationEnums.CardOperation.ADD ||
                    masterCardState.state === Terrasoft.ConfigurationEnums.CardOperation.COPY);
                    if (isNewRecord === true) {
                        var args = {
                            isSilent: true,
                            messageTags: [this.sandbox.id]
                        };
                        this.sandbox.publish("SaveRecord", args, [this.sandbox.id]);
                        return;
                    }
                    this.openDocumentLookup();
                },
 
                // Adding the selected products.
                addCallBack: function(args) {
                    // Class instance of the BatchQuery package query.
                    var bq = this.Ext.create("Terrasoft.BatchQuery");
                    var OrderId = this.get("MasterRecordId");
                    // Collection of the selected documents from the lookup.
                    this.selectedRows = args.selectedRows.getItems();
                    // Collection passed over to query.
                    this.selectedItems = [];
                    // Copying the necessary data.
                    this.selectedRows.forEach(function(item) {
                        item.OrderId = OrderId;
                        item.DocumentId = item.value;
                        bq.add(this.getDocumentInsertQuery(item));
                        this.selectedItems.push(item.value);
                    }, this);
                    // Executing the package query if it is not empty.
                    if (bq.queries.length) {
                        this.showBodyMask.call(this);
                        bq.execute(this.onDocumentInsert, this);
                    }
                },
 
                //Returns query for adding the current object.
                getDocumentInsertQuery: function(item) {
                    var insert = Ext.create("Terrasoft.InsertQuery", {
                        rootSchemaName: this.entitySchemaName
                    });
                    insert.setParameterValue("UsrOrder", item.OrderId, this.Terrasoft.DataValueType.GUID);
                    insert.setParameterValue("UsrDocument", item.DocumentId, this.Terrasoft.DataValueType.GUID);
                    return insert;
                },
 
                //Method called when adding records to the detail record list.
                onDocumentInsert: function(response) {
                    this.hideBodyMask.call(this);
                    this.beforeLoadGridData();
                    var filterCollection = [];
                    response.queryResults.forEach(function(item) {
                        filterCollection.push(item.id);
                    });
                    var esq = Ext.create("Terrasoft.EntitySchemaQuery", {
                        rootSchemaName: this.entitySchemaName
                    });
                    this.initQueryColumns(esq);
                    esq.filters.add("recordId", Terrasoft.createColumnInFilterWithParameters("Id", filterCollection));
                    // Create viewmodel for new items
                    esq.on("createviewmodel", this.createViewModel, this);
                    esq.getEntityCollection(function(response) {
                        this.afterLoadGridData();
                        if (response.success) {
                            var responseCollection = response.collection;
                            this.prepareResponseCollection(responseCollection);
                            this.getGridData().loadAll(responseCollection);
                        }
                    }, this);
 
                },
 
                // Method called when deleting records from the detail record list.
                deleteRecords: function() {
                    var selectedRows = this.getSelectedItems();
                    if (selectedRows.length > 0) {
                        this.set("SelectedRows", selectedRows);
                        this.callParent(arguments);
                    }
                },
 
                // Hide the [Copy] menu option.
                getCopyRecordMenuItem: Terrasoft.emptyFn,
                 // Hide the [Edit] menu option.
                getEditRecordMenuItem: Terrasoft.emptyFn,
                // Returns the default filter column name.
                getFilterDefaultColumnName: function() {
                    return "UsrDocument";
                }
            },
            // Modification array.
            diff: /**SCHEMA_DIFF*/[
                {
                // Operation type — merging.
                "operation": "merge",
                // Name of the schema element, with which the action is performed.
                "name": "DataGrid",
                // Object, whose properties will be joined with the schema element properties.
                "values": {
                    // Class name
                    "className": "Terrasoft.ConfigurationGrid",
                    // View generator must generate only part of view.
                    "generator": "ConfigurationGridGenerator.generatePartial",
                    // Binding the edit elements configuration obtaining event
                    // of the active page to handler method.
                    "generateControlsConfig": {"bindTo": "generateActiveRowControlsConfig"},
                    // Binding the active record changing event to handler method.
                    "changeRow": {"bindTo": "changeRow"},
                    // Binding the record selection cancellation event to handler method.
                    "unSelectRow": {"bindTo": "unSelectRow"},
                    // Binding of the list click event to handler method.
                    "onGridClick": {"bindTo": "onGridClick"},
                    // Actions performed with active record.
                    "activeRowActions": [
                        // [Save] action setup.
                        {
                            // Class name of the control element, with which the action is connected.
                            "className": "Terrasoft.Button",
                            // Display style — transparent button.
                            "style": this.Terrasoft.controls.ButtonEnums.style.TRANSPARENT,
                            // Tag.
                            "tag": "save",
                            // Marker value.
                            "markerValue": "save",
                            // Binding button image.
                            "imageConfig": {"bindTo": "Resources.Images.SaveIcon"}
                        },
                        // [Cancel] action setup.
                        {
                            "className": "Terrasoft.Button",
                            "style": this.Terrasoft.controls.ButtonEnums.style.TRANSPARENT,
                            "tag": "cancel",
                            "markerValue": "cancel",
                            "imageConfig": {"bindTo": "Resources.Images.CancelIcon"}
                        },
                        // [Delete] action setup.
                        {
                            "className": "Terrasoft.Button",
                            "style": this.Terrasoft.controls.ButtonEnums.style.TRANSPARENT,
                            "tag": "remove",
                            "markerValue": "remove",
                            "imageConfig": {"bindTo": "Resources.Images.RemoveIcon"}
                        }
                    ],
                    // Binding to method that initializes subscription to events
                    // of clicking buttons in the active row.
                    "initActiveRowKeyMap": {"bindTo": "initActiveRowKeyMap"},
                    // Binding the active record action completion event to handler method.
                    "activeRowAction": {"bindTo": "onActiveRowAction"},
                    // Identifies whether multiple records can be selected.
                    "multiSelect": {"bindTo": "MultiSelect"}
                }
            },
                {
                    // Operation type - merging.
                    "operation": "merge",
                    // Name of the schema element under operation.
                    "name": "DataGrid",
                    // The object, whose properties will be combined with the schema element properties.
                    "values": {
                        "rowDataItemMarkerColumnName": "UsrDocument"
                    }
                },
                {
                    // Operation type - merging.
                    "operation": "merge",
                    // Name of the schema element under operation.
                    "name": "AddRecordButton",
                    // The object, whose properties will be combined with the schema element properties.
                    "values": {
                    	"click":{"bindTo":"addRecord"},
                        "visible": {"bindTo": "getToolsVisible"}
                    }
                }
            ]/**SCHEMA_DIFF*/
        };
    }
);

The trick is in the esq.on("createviewmodel", this.createViewModel, this); string in the onDocumentInsert method.

 

Best regards,

Oscar

Oscar Dylan,

 

It works.

Thanks very much!

Show all comments