Question

Saving the page before starting the business process

Hallo,

I need advice. I have button in page, who start business process. Befor start this process I need save edit page. I use this.save(); This function saves page, but asynchronic and my process start befor page saving. How can I waiting for page saving?

Thank you

Marcela

Like

2 comments

I would write something like 

define("ContactPageV2", [], function() {
	return {
		entitySchemaName: "Contact",
		attributes: {},
		modules: /**SCHEMA_MODULES*/{}/**SCHEMA_MODULES*/,
		details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,
		businessRules: /**SCHEMA_BUSINESS_RULES*/{}/**SCHEMA_BUSINESS_RULES*/,
		methods: {
			onTestButtonClick: function() {
				this.save({
					isSilent: true,
					callback: this.myOnAfterSaved
				});
				console.log("after onTestButtonClick");
			},
			myOnAfterSaved: function() {
				console.log("myOnAfterSaved");
			}
		},
		dataModels: /**SCHEMA_DATA_MODELS*/{}/**SCHEMA_DATA_MODELS*/,
		diff: /**SCHEMA_DIFF*/[
			{
				"operation": "insert",
				"parentName": "ContactGeneralInfoBlock",
				"propertyName": "items",
				"name": "TestButton",
				"values": {
					"layout": {"column": 0, "row": 3},
					"itemType": Terrasoft.ViewItemType.BUTTON,
					"style": Terrasoft.controls.ButtonEnums.style.BLUE,
					"click": {bindTo: "onTestButtonClick"},
					"caption": "TestButton"
				}
			}
		]/**SCHEMA_DIFF*/
	};
});

 

Perfect, thank you!
Log in or register to comment