How to Show Records in Message Box

Hi Team,

 

My task is  : 

When Registration Status = Approved and Duplicate Records Exist then I have to show the Duplicate Records to the User On Some MessageBox and Take input from him/her wether he want to save the record or not 

 

Please see this image below : 

 

I want to show the records(in the detail highlighted in red) in message box and ask user whether to save the record on not ?

 

Please help me, How can I achieve this ?

 

Many thanks.

 

Like 0

Like

1 comments

Hello,

 



Here is code example of two methods that can be added on the edit page schema for your reference:

 

onCardAction: function(){

    this.callParent(arguments);

    var actionId = arguments[0];

    if (actionId=="save"){

        this.onSaveButton();

    }

},

onSaveButton: function() {

    var recordStatus = this.get("LookupCommunicationChannels").displayValue;

    var message="";

    var currentContactId = this.get("Id");

    if (recordStatus == "Email") {

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

            rootSchemaName: "UsrDetailTest"

        });

        esq.addColumn("UsrLsOurAccount", "OurAccount");

        esq.addColumn("Name", "Name");

        esq.addColumn("UsrContact");

        esq.filters.addItem(esq.createColumnFilterWithParameter(this.Terrasoft.ComparisonType.EQUAL, "UsrContact", currentContactId));

        esq.getEntityCollection(function(result) {

            if (!result.success) {

                this.showInformationDialog("Data query error");

                return;

            }

            result.collection.each(function (item) {

                message += "Detail name: " + item.get("Name") +

                " OurAccount: " + item.get("OurAccount") + "\n";

            });

            this.showInformationDialog(message);

        }, this);

    }

}

 

Once you click "Save" button after filling the Registration Status, you will get message in the dialog window that contains the records from the detail. 

 



Best Regards,

Tetiana Bakai 

Show all comments