getSectionActions: function() { // Calling of the parent method implementation, // returning the initialized section action collection. var actionMenuItems = this.callParent(arguments); // Adding separator line. actionMenuItems.addItem(this.getButtonMenuItem({ Type: "Terrasoft.MenuSeparator", Caption: "" })); // Adding a menu option to the section action list. actionMenuItems.addItem(this.getButtonMenuItem({ // Binding the menu option title to the localized schema string. "Caption": { bindTo: "Resources.Strings.SetFieldSalesRepCaption" }, // Binding of the action handler method. "Click": { bindTo: "showDateInfo1" }, // Binding the menu option enable property to the value that returns the isCustomActionEnabled method. "Enabled": { bindTo: "isCustomActionEnabled" }, // Multiselection mode enabling. "IsEnabledForSelectedAll": true })); actionMenuItems.addItem(this.getButtonMenuItem({ "Caption": {bindTo: "Resources.Strings.MultiplyChangeAction"}, "Click": {bindTo: "showDateInfo"}, "Enabled": {bindTo: "isCustomActionEnabled"}, "IsEnabledForSelectedAll": true })); // Returni // Returning of the added section action collection. return actionMenuItems; }, showDateInfo1: function() { /* var config = { // The [Employee] Schema. entitySchemaName: "Employee", // Multiple selection is disabled. multiSelect: false, // The displayed column — [Name]. columns: ["Name"] }; this.openLookup(config, this.lookupCallback, this); */ Terrasoft.utils.inputBox("Set Field Sales Rep and Visit Date: ", function(result, arg) { if (result === Terrasoft.MessageBoxButtons.YES.returnCode) { var date = arg.date.value; var FieldSalesRep = arg.FieldSalesRep.value; var autoIds = this.getSelectedItems(); this.updateDate1(function(context, result) { }, autoIds, date,FieldSalesRep); } }, [{ className: "Terrasoft.Button", caption: "OK", returnCode: "yes" }, "cancel"], this, { date : { dataValueType : Terrasoft. DataValueType . DATE_TIME , caption : "Visit date" , value : new Date ( ) , customConfig : { className : "Terrasoft.Container" , getValue : function ( ) { // debugger; var dateValue = this . items . items [ 0 ] . value ; var timeValue = this . items . items [ 1 ] . value ; dateValue. setHours ( timeValue. getHours ( ) ) ; dateValue. setMinutes ( timeValue. getMinutes () ) ; return dateValue ; } , items : [ { className : "Terrasoft.DateEdit" , id : "newStartDateEdit" , value : new Date ( ) , width : "50%" } , { className : "Terrasoft.TimeEdit" , id : "newStartTimeEdit" , value : new Date ( ) , width : "50%" } ] } }, FieldSalesRep:{ dataValueType: Terrasoft.DataValueType.LOOKUP, type: Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN, hideActions: true, value: { value: "", displayValue: "" }, referenceSchema: { name: "Employee", primaryColumnName: "Id", primaryDisplayColumnName: "Name" }, referenceSchemaName: "Employee", caption: "Field Sales Rep", customConfig: { className: "Terrasoft.LookupEdit", entitySchemaName: "Employee", multiSelect: false, // The displayed column — [Name]. columns: ["Name"], height: "17px", } } }, { defaultButton: 0, style: { borderStyle: "ts-messagebox-border-style-blue ts-messagebox-border-no-header", buttonStyle: "blue" } } ); }, updateDate1: function(callback, autoIds, date,FieldSalesRep) { var update = Ext.create("Terrasoft.UpdateQuery", { rootSchemaName: "JFLFieldSales" }); var filters = Terrasoft.createFilterGroup(); filters.logicalOperation = Terrasoft.LogicalOperatorType.OR; autoIds.forEach(function(item) { var productIdFilter = update.createColumnFilterWithParameter(Terrasoft.ComparisonType.EQUAL,"Id", item); filters.add("ProductIdFilter" + item, productIdFilter); }, this); update.filters.add(filters); if (date) { update.setParameterValue("JFLAssignmentDate", date, Terrasoft.DataValueType.DATE_TIME); update.setParameterValue("JFLFieldSalesRep", FieldSalesRep, Terrasoft.DataValueType.LOOKUP); } update.execute(function(result) { callback.call(this, result); }, this); }