Question

The Process Name Is Not Getting Displayed in the Edit Page Below the Run Process Button

Hi Team,

 

The Process Name Is Not Getting Displayed in the Edit Page Below the Run Process Button. Please find screenshot for the same

Like 0

Like

13 comments

Hi Saranya,

 

Please provide us with the screenshot of the process itself and a screenshot of this process connection to the section in the section wizard.

 

Thank you!

 

Best regards,

Oscar

Oscar Dylan,

Hi Oscar ,

 

Please find the screenshots for the same

 

 

 

Sri Saranya,

 

And can you please send a complete source code where the business process call is developed?

 

Thank you!

 

Best regards,

Oscar

Oscar Dylan,

 

define("UsrStandardPriceFlow1Section", ["ProcessModuleUtilities"], function(ProcessModuleUtilities) {
	return {
		entitySchemaName: "UsrStandardPriceFlow",
		attributes: {
		"IsButtonEnabled": {
          "type": Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN,
          "dataValueType": Terrasoft.DataValueType.BOOLEAN,
          "value": false
        }
		},
		messages: {
            "requestStage": {
                mode: this.Terrasoft.MessageMode.BROADCAST,
                direction: this.Terrasoft.MessageDirectionType.SUBSCRIBE
            },
            "responseStage": {
                mode: this.Terrasoft.MessageMode.BROADCAST,
                direction: this.Terrasoft.MessageDirectionType.PUBLISH
            }
        },
		details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,
		diff: /**SCHEMA_DIFF*/[
			{
                // Indicates that an operation of adding an item to the page is being executed.
                "operation": "insert",
                // Meta-name of the parent control item where the button is added.
                "parentName": "CombinedModeActionButtonsCardLeftContainer",
                // Indicates that the button is added to the control items collection
                // of the parent item (which name is specified in the parentName).
                "propertyName": "items",
                // Meta-name of the added button. .
                "name": "MainContactButton",
                // Supplementary properties of the item.
                "values": {
                    // Type of the added item is button.
                    itemType: Terrasoft.ViewItemType.BUTTON,
                    // Binding the button title to a localizable string of the schema.
                    caption: { bindTo: "Resources.Strings.SubmitForApprovalButtonCaption" },
                    // Binding the button press handler method.
                    click: { bindTo: "onCardAction" },
                    // Binding the property of the button availability.
                    enabled: { bindTo: "isSubmitForApprovalButtonEnabled" },
                    visible: { bindTo:"IsButtonEnabled"},
                    "tag": "onSubmitForApprovalButtonClick",
                    "style": "green",
                    // Setting the field location.
                    "layout": {
                        "column": 1,
                        "row": 6,
                        "colSpan": 1
                    }
                }
            }]/**SCHEMA_DIFF*/,
		methods: {
			            init: function () {
                this.callParent(arguments);
                this.sandbox.registerMessages(this.messages);
                this.processMessages();
            },
            processMessages: function () {
                this.sandbox.subscribe("requestStage", this.requestStage,
                    this, ["StandardPriceDetail"]);
            },
            requestConcessionStage: function () {
                var activeRow = this.get("ActiveRow");
                var stage = this.get("GridData").get(activeRow).get("UsrStage").displayValue;
                this.sandbox.publish("responseStage", stage, ["StandardPriceSection"]);
            },
				addRecord: function() {
				this.callCustomProcess();
			},
 
			callCustomProcess: function() {
                 //var id = this.getActiveRow().get("Id");
                 var args = {
                 sysProcessName: "UsrStandardPriceFlowProcess",
                     //parameters: {
                           //ConcessionID: id
                        //}
                };
                ProcessModuleUtilities.executeProcess(args);
            },
            initQueryColumns: function (esq) {
                this.callParent(arguments);
                esq.addColumn("UsrStage");
                esq.addColumn("IsButtonEnabled");
                 this.getUserRights();
 
 
            },
            isSubmitForApprovalButtonEnabled: function () {
                var activeRow = this.get("ActiveRow");
                if (activeRow) {
                    var stage = this.get("GridData").get(activeRow).get("UsrStage");
                    var stageName = stage ? stage.displayValue : "";
                    window.console.log(stageName);
                    return (stageName === "Rejected" ? true : false);
                }
                return false;
            },
                 getUserRights: function() {
				 var scope = this;
				 var isbuttonenabled = this.get("IsButtonEnabled");
 				var currentUser = Terrasoft.SysValue.CURRENT_USER.value;
 				var role = "Standard Price";
				var esq = Ext.create("Terrasoft.EntitySchemaQuery", { rootSchemaName: "SysUserInRole" });
 				esq.addColumn("[SysFuncRoleInOrgRole:OrgRole:SysRole].FuncRole.Name","SysRole");
 				esq.addColumn("SysUser");
 				esq.filters.add("SysUser", Terrasoft.createColumnFilterWithParameter(
  				Terrasoft.ComparisonType.EQUAL, "SysUser", currentUser));
 				esq.filters.add("SysRole", Terrasoft.createColumnFilterWithParameter(
  				Terrasoft.ComparisonType.EQUAL, "[SysFuncRoleInOrgRole:OrgRole:SysRole].FuncRole.Name", role));
 				esq.getEntityCollection(function(response) {
 					window.console.log(response);
  				if (response.success) {
   				var result = response.collection;
   				if(result.collection.length !== 0){
   					window.console.log("Is Stanadard Price Requester");
   				isbuttonenabled = true;
   				scope.set("IsButtonEnabled", isbuttonenabled);
   				window.console.log(isbuttonenabled);
  					}
  					if(result.collection.length === 0){
  						window.console.log("Not Stanadard Price Requester");
   				isbuttonenabled = false;
   				scope.set("IsButtonEnabled", isbuttonenabled);
  					}
  				}
  				//scope.loadMenu();
 				}, this);
				}
		}
	};
});

please find below the source code of the process

 

namespace Terrasoft.Core.Process
{
 
	using Newtonsoft.Json;
	using Newtonsoft.Json.Linq;
	using System;
	using System.Collections.Generic;
	using System.Collections.ObjectModel;
	using System.Drawing;
	using System.Globalization;
	using System.Text;
	using Terrasoft.Common;
	using Terrasoft.Core;
	using Terrasoft.Core.Configuration;
	using Terrasoft.Core.DB;
	using Terrasoft.Core.Entities;
	using Terrasoft.Core.Process;
	using Terrasoft.Core.Process.Configuration;
 
	#region Class: UsrStandardPriceFlowProcessMethodsWrapper
 
	/// <exclude/>
	public class UsrStandardPriceFlowProcessMethodsWrapper : ProcessModel
	{
 
		public UsrStandardPriceFlowProcessMethodsWrapper(Process process)
			: base(process) {
			AddScriptTaskMethod("ScriptTask1Execute", ScriptTask1Execute);
		}
 
		#region Methods: Private
 
		private bool ScriptTask1Execute(ProcessExecutingContext context) {
			string spId = Get<string>("OldCodeStandardPriceFlow");
			string subStr = spId.Substring(3);
			        int i = Convert.ToInt32(subStr);
			        int newid = i + 1;
			        string prefix = string.Empty;
			        if(newid<10){
			            prefix="00000";
			        }
			        else if (newid<100)
			        {
			            prefix="0000";
			        }
			        else if (newid<1000)
			        {
			            prefix="000";
			        }
			        else if (newid<10000)
			        {
			            prefix="00";
			        }
			        else if (newid<100000)
			        {
			        	prefix="0";
			        }
 
 
			        string intstringid = newid.ToString();
			        string name = prefix + intstringid;
			        string newspId = "SP_" + name;
			        Set("NewCodeStandardPriceFlow", newspId);
 
			return true;
		}
 
		#endregion
 
	}
 
	#endregion
 
}

 

Sri Saranya,

 

Thank you!

 

Please add the localizable string to the UsrStandardPriceFlow edit page with "CallProcessCaption" name and specify the process name as a value there. As a result, once changes are saved and the page is reloaded the process name will appear.

 

Best regards,

Oscar

Oscar Dylan,

Hi Oscar,

 

I tried implementing the above. Still facing the same issue

 

 

 

 

Hi Saranya,

 

This was done on our side as well and it was also specified in this academy article https://academy.creatio.com/documents/technic-sdk/7-16/process-launch-client-module. Before adding the localizable value to the edit page the process name was empty and once the localizable value was specified the issue was fixed. Please refresh the page with a hard reload and also try generating the source code and compiling the app.

 

Best regards,

Oscar

Oscar Dylan,

Even after generating source code, compilation and hard reload, still facing the same issue

 

Sri Saranya,

 

Just to clarify - you open the edit page, there is no button, then refresh the page and does the process caption appear after that?

 

Best regards,

Oscar

Oscar Dylan,

Hi  Oscar,

 

Yes Even after refreshing multiple times, the process name is not showing

Sri Saranya,

 

Please send us the link to the app and provide us with external access to it with access to data and configurations in terms of the support ticket registered to support@creatio.com.

 

Best regards,

Oscar

Oscar Dylan,

Hi Oscar,

 

This is in my local instance. I can share the .bak file so that you can validate

Sri Saranya,

 

Yes, please, you can send the backup and we will check it.

 

Thank you!

 

Best regards,

Oscar

Show all comments