Hi community,

I have a custom button in the product in order detail action menu.

When I click this custom button, I want it to save the parent order page before it continue to do other work.

How may I get the master record and save? Is it like this.parent.save() or something else?

Thank you!

Like 0

Like

2 comments
Best reply

Oleg Drobina,

Thank you Oscar, it works! I provide my codes below:

onButonClick2: function() {	  
  var config = {
	  sysProcessName: "UsrProcess_46b3b57Dynasafe11",
	  parameters: { 
		  ProcessSchemaRecordID: this.get("MasterRecordId")
	  },
	  callback: function() {
		  this.reloadEntity();
		  Terrasoft.showInformation("The process has completed.");
	  },
	  scope: this
  };			  
  var args = {
	  isSilent: true,
	  messageTags: [this.sandbox.id],
	  callback: function() {
		  ProcessModuleUtilities.executeProcess(config);
	  }
  };
  this.sandbox.publish("SaveRecord", args, [this.sandbox.id]);				  
},

 

Hi Andrew,

 

Probably this approach can save the master record of the detail, but it should be tested (taken from the examples in the BaseGridDetailV2):

const args = {
					isSilent: true,
					messageTags: [this.sandbox.id]
				};
				this.sandbox.publish("SaveRecord", args, [this.sandbox.id]);

 

Oleg Drobina,

Thank you Oscar, it works! I provide my codes below:

onButonClick2: function() {	  
  var config = {
	  sysProcessName: "UsrProcess_46b3b57Dynasafe11",
	  parameters: { 
		  ProcessSchemaRecordID: this.get("MasterRecordId")
	  },
	  callback: function() {
		  this.reloadEntity();
		  Terrasoft.showInformation("The process has completed.");
	  },
	  scope: this
  };			  
  var args = {
	  isSilent: true,
	  messageTags: [this.sandbox.id],
	  callback: function() {
		  ProcessModuleUtilities.executeProcess(config);
	  }
  };
  this.sandbox.publish("SaveRecord", args, [this.sandbox.id]);				  
},

 

Show all comments