Hi Community,

I am facing an issue which is related to SectionActions Button for sending multiple records. I need to send some records (out of all selected records) to a business process in an array after filtering with esq inside section edit page.

Issue: The filtered Id's are not being pushed into array correctly. Means when we explore the array, the values are there but when we try to print or send we get initial value of that array (i.e. empty string or null).

 

getSectionActions: function() {

                var actionMenuItems = this.callParent(arguments);

                actionMenuItems.addItem(this.getButtonMenuItem({

                    Type: "Terrasoft.MenuSeparator",

                    Caption: ""

                }));

                actionMenuItems.addItem(this.getButtonMenuItem({

                    "Caption": {bindTo: "Resources.Strings.AMDAssignMultipleRecords"},

                    "Click": {bindTo:"runCustomProcess"},

                    "IsEnabledForSelectedAll": true

                }));

                return actionMenuItems;

            },

            runCustomProcess: function(){

                if(this.get("SelectedRows") == "" || this.get("SelectedRows") == undefined){

                    this.showInformationDialog("Please select records for batch process!");

                }

                else{  

                    var selectedRows = this.get("SelectedRows");

                    console.log("Selected records : ", selectedRows);

                    var recordsnumber = selectedRows.length;

                    var resIdRows=[];

                    var resIdForArray="";

                    selectedRows.forEach(fnProgramABCArray);

                    console.log("Selected ABC records : ", resIdRows);

                    var selectedOrder = resIdRows.toString();

                    console.log("selectedOrder: ", selectedOrder);

                    var args = {

                        sysProcessName: "AMDProcess_BatchAssignments",

                        parameters: {

                            SelectedRowsCol: selectedOrder,

                            NoOfRes: recordsnumber

                        },

                    };

                    ProcessModuleUtilities.executeProcess(args);

                }



                function fnProgramABCArray(item){

                    var esq = Ext.create("Terrasoft.EntitySchemaQuery", { rootSchemaName: "AMDTestPlans" });

                    esq.addColumn("AMDStatus");

                    esq.addColumn("AMDProgram");

                    esq.filters.addItem(esq.createColumnFilterWithParameter(

                        Terrasoft.ComparisonType.EQUAL, "Id", item));

                    esq.getEntityCollection(function (result) {

                        let status = result.collection.getByIndex(0).get("AMDStatus").displayValue;

                        let program = result.collection.getByIndex(0).get("AMDProgram").displayValue;

                        if(status === "In Progress" && program === "ABC"){

                            resIdRows.push(item);

                        }

                    });

                }

            }

 

Please find attached screenshot below with an array of selected records vs another array of selected ABC records and string output as Selected order (empty string).

 

Like 0

Like

1 comments

Hi,

 

The issue here is that ESQ is asynchronous and as a result once the:

 

selectedRows.forEach(fnProgramABCArray);

 

is called, the browser continues executing the main runCustomProcess, but in addition executes the fnProgramABCArray in the background and when the

 

console.log("Selected ABC records : ", resIdRows);

 

and 

 

console.log("selectedOrder: ", selectedOrder);

 

are executed they won't show anything, these will be an empty array and an empty string.

 

You need to modify this logic and perform the filtration of records in the business process directly where you can check all the records passed using either the read data element and the conditional flow or a script task that uses the SelectQuery class to check data consistency.

 

Best regards,

Oscar

Show all comments

Hi,

 

I want to override the onClick of Complete/Published button in Action Dashboard. Kindly suggest suitable links or method that need to be overridden.

 

#SectionActionsDashboard

Like 0

Like

1 comments

Hello,

By clicking this button you run the onPublishButtonClick method from the BaseMessagePublisherPage schema. So you need to override the logic of this method in case additional logic should be triggered upon clicking this button.

Show all comments

We are running out of space for buttons in the usual places.  We have removed the icons in the communications panel at the top of the Actions Dashboard (see this article).  Is there any way to add buttons back in?

I have tried adding a button setting 'parentName' to "CaseSectionActionsDashboardMainContainerContainer" without success.

Thanks,

Like 0

Like

3 comments

Please clarify your task: do you need to return the buttons that were removed from the Actions Dashboard or do you need to add some new buttons there? Maybe you could share some image of what it should look like?

Oscar Dylan,

We need to add some new buttons.  We have removed the facebook, telegram, message and other buttons (which are actually tabs I think) from the Actions Dashboard, is it at all possible though to put a 'Terrasoft.ViewItemType.BUTTON' in their place?

Gareth Osler,

 

It's not possible exactly in the tabs (you are right, Email, Call, Activity etc. on the actions dashobard are tabs), but there are elements like ActualDcmSchemaInformationButton button and PlaybookButton button that are inserted to the RightHeaderActionContainer element of the SectionActionsDashboard and you can use those as an example. Additionally to it, if you ran out of space on the page you can always add additional buttons to the "Actions" button (override the getActions method on the edit page schema) and call the logic needed from these buttons.

Show all comments

Hi Team,



I would like to hide/close the section action dashboard tab container in a DCM, when there is no activity/task.



please guide me the development activity required to achieve this scenario.



Also, i have attached the screenshot for the reference.

 

Step 1 : With Activity



 

Step 2 : Without Activity

Step 3: No activity Automatic close/hide

 

I need to achieve the step 3 without clicking on the arrow icon.





Regards,

Bhoobalan P.

 

Like 2

Like

3 comments

Dear Bhoobalan,

 

Try this code:

define("OpportunityActionsDashboard", [], function() {
	return {
		messages: {
			"InitVisibilityByRights": {
				mode: this.Terrasoft.MessageMode.BROADCAST,
				direction: this.Terrasoft.MessageDirectionType.SUBSCRIBE
			},
			"GetInitVisibilityByRights": {
				mode: this.Terrasoft.MessageMode.BROADCAST,
				direction: this.Terrasoft.MessageDirectionType.PUBLISH
			}
		},
		methods: {
			/**
			 * @inheritdoc Terrasoft.BaseActionsDashboard#subscribeSandboxEvents
			 * @overridden
			 */
			subscribeSandboxEvents: function() {
				this.callParent(arguments);
				var sandbox = this.sandbox;
				var tags = [sandbox.id];
				sandbox.subscribe("InitVisibilityByRights", this.initVisibilityByRights, this, tags);
				sandbox.publish("GetInitVisibilityByRights");
			},
 
			/**
			 * Initializes the visibility of the panel content
			 */
			initVisibilityByRights: function(value) {
				this.set("ContentVisible", value);
			}
		},
		diff: /**SCHEMA_DIFF*/[]/**SCHEMA_DIFF*/
	};
});

and then modify edit page: 

messages: {
			"InitVisibilityByRights": {
				mode: this.Terrasoft.MessageMode.BROADCAST,
				direction: this.Terrasoft.MessageDirectionType.PUBLISH
			},
			"GetInitVisibilityByRights": {
				mode: this.Terrasoft.MessageMode.BROADCAST,
				direction: this.Terrasoft.MessageDirectionType.SUBSCRIBE
			}
		},
 
		attributes: {
			//this is the attribute that determines the visibility
			"IsColumnVisibleByOwnerOrFuncRole": {
				dependencies: [{
					columns: ["IsColumnVisibleByOwnerOrFuncRole"],
					methodName: "publishVisibilityByRights"
				}]
			}
		},
		methods: {
 
			subscribeSandboxEvents: function() {
				this.callParent(arguments);
				this.sandbox.subscribe("GetInitVisibilityByRights", this.publishVisibilityByRights, this);
			},
 
			/**
			 * Publishes the visibility tag to other modules
			 */
			publishVisibilityByRights: function() {
				var moduleIds = this.getModuleIds();
				moduleIds.push(this.sandbox.id);
				var value = this.get("IsColumnVisibleByOwnerOrFuncRole");
				this.sandbox.publish("InitVisibilityByRights", value, moduleIds);
			}
 
		},

Best regards,

Angela

Angela Reyes,

 



I tried this but it is not working for me. Is browser a factor for this? I am using Firefox.



Best Regards,

Lem A.

Hello Solem Khan Abdusalam,



We kindly ask you to elaborate more on this issue. Could you please specify which error did you get?



Best regards,

Bogdan

Show all comments