Stay in the Child Record while creating it from Parent.
Hi Team,
I have added a button to create child custom section record from an opportunity. After saving the child record it is navigating back to Opportunity but I want to Stay back in the child since I have to do other actions in the child. Below is the button code. Please suggest if you have any idea on how to achieve my goal.
Thanks,
Venkat.
Button Code:
================================
methods: {
onNewQuoteClick: function() {
var now = new Date();
now.setMonth(now.getMonth() + 1);
this.openCardInChain({
schemaName: "UsrChildPage",
operation: Terrasoft.ConfigurationEnums.CardOperation.ADD,
moduleId: this.sandbox.id + "_CardModule",
defaultValues: [{
name: ["UsrOppLookup"],
value: [this.get("Id")]
},
{
name: ["UsrName"],
value: ["Child For " + this.get("Title")]
},
{
name: ["UsrAccount"],
value: [this.get("UsrQuoteAccount").value]
},
{
name: ["UsrExpiredate"],
value: [now]
}
]
});
this.save({ isSilent: true });
}
}
Like
Tetiana Markova,
Thanks a lot. That worked like a gem.. Thanks Again..
Hello,
I suppose, the same issue was discussed in this topic - https://community.bpmonline.com/questions/how-stop-redirection-new-orde…
You need to override 'onSaveButtonClick' method and set 'isSilent' parameter in order to stay on the page after save:
onSaveButtonClick: function() {
if (this.get("IsProcessMode")) {
this.save({ isSilent: true });
} else {
this.save();
}
}
Tetiana Markova,
Hi Tetiana,
Thanks for the response. I have override the Save button in my child page as shown below but not successful. Can you please check and let me know what mistake I am doing?
Thanks,
Venkat.
Code:
==================================
{
"operation": "insert",
"name": "Save",
"values": {
"itemType": 5,
"style": "green",
"caption": {
"bindTo": "Save"
},
"click": {
"bindTo": "onSaveButtonClick"
},
"enabled": {
"bindTo": "canEntityBeOperated"
},
"classes": {
"textClass": [
"actions-button-margin-right"
]
}
},
"parentName": "LeftContainer",
"propertyName": "items",
"index": 5
}
==============================
onSaveButtonClick: function() {
if (this.get("IsProcessMode")) {
this.save({ isSilent: true });
}
else{
this.save();
}
}
Let's try another approach by overriding save() method for your child edit page:
methods: {
save: function(config) {
if (config) {
config.isSilent = true;
}
else {
config = {
isSilent: true
};
}
this.callParent([config]);
}
},
Tetiana Markova,
Thanks a lot. That worked like a gem.. Thanks Again..