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;
}
}
};
});