Disable Record Add On Detail In Specific Stage

Hello community,

 

Is it possible to remove records adding in a specific detail when the main object is in a specific stage?

Like 0

Like

1 comments

Hello,

 

Add the following code in the page schema of main object under methods:

isDetailEnabled: function(detailName) {
        var DCMStage = this.get("UsrDCMLookup").displayValue;   
	if (detailName === "ExampleDetail") {
		if(DCMStage === "Approved"){
                    return false;       //Disable the "+" button
                }
                else{
                    return true;        //Enable the "+" button
                }
	}
	return this.callParent(arguments);
}

 

Regards,

Sourav

Show all comments