1

Hi friends i got a requirement in cases.I have record type called VARMA. and we have a standard button called "Save & Edit" so, whenever support rep click this button we need to validate subject could not be null.

So, i am created a custom button and i am unable to hide the standard button from record edit page.

And My custom code will be.

{!requireScript("/soap/ajax/26.0/connection.js")}
var reason = "{!Case.Subject}";
if(Subject == null || Subject == ''){
alert("Please Enter Subject")
}
else {
window.open('/{!Case.Id}/s?retURL=%2{!Case.Id}');
}

But it will displaying error like

Subject is not defined

How to hide or replace standard Save & Close button with new custom button in record edit page.

2
  • That last addition is a completely separate question. You should ask it separately...
    – Adrian Larson
    Jan 9, 2017 at 16:09
  • Ok thanks.I am going close this question.@Adrian Larson
    – Pavan tej
    Jan 9, 2017 at 16:28

1 Answer 1

3

You didn't use your reason variable.

{!requireScript("/soap/ajax/26.0/connection.js")}
var reason = "{!Case.Subject}";
if(reason == null || reason == ''){
alert("Please Enter Subject")
}
else {
window.open('/{!Case.Id}/s?retURL=%2{!Case.Id}');
}
2
  • But is there any way to hide standard Save & close button in record edit page.
    – Pavan tej
    Jan 9, 2017 at 15:07
  • But i am bale to display only in detail page.Is there any way to replace standard one with custom.@Martin Lezer
    – Pavan tej
    Jan 9, 2017 at 15:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .