You need to sign in to do that
Don't have an account?
NTSdevelop
is it possible to hide the "save and new" button?
I know I can hide or show standard buttons that belong to the details page, customizing the page layout of the custom object, but I can't find the way to hide the "save and new" button that appears when I click the "new" button to create a new record of a determined object.
Therefore, I was triying to do it with an s-control and javascript code.
I thought I could do it from a "new record" s-control I wrote to override the url created when clicking the "new" button, but then I realized that in that point the "new record" page doesn't exist and so does not the button I wanted to hide.
Anyway, the code was:
<script language="javascript">
try
{
window.parent.location.href = "{!URLFOR($Action.MyObject__c.New , null , [saveURL=$SControl.MyNewObjectSave, retURL=URLFOR($Request.retURL, null,null,false)] ,true)}";
var elementArray = document.getElementsByName("save_new");
elementArray[0].style.display = "none";
}
catch(exception)
{
alert("Exception:" + exception);
}
</script>
An exception is thrown and says: Exception: TypeError: elementArray[0] has no properties
Is it possible to override the "new record" page, so that I can show or hide the buttons I want?
Maybe there's just a simpler way to do it or it is just impossible, because it is not suported.
Any comment would be appreciated.
Thanks,
new developer
Therefore, I was triying to do it with an s-control and javascript code.
I thought I could do it from a "new record" s-control I wrote to override the url created when clicking the "new" button, but then I realized that in that point the "new record" page doesn't exist and so does not the button I wanted to hide.
Anyway, the code was:
<script language="javascript">
try
{
window.parent.location.href = "{!URLFOR($Action.MyObject__c.New , null , [saveURL=$SControl.MyNewObjectSave, retURL=URLFOR($Request.retURL, null,null,false)] ,true)}";
var elementArray = document.getElementsByName("save_new");
elementArray[0].style.display = "none";
}
catch(exception)
{
alert("Exception:" + exception);
}
</script>
An exception is thrown and says: Exception: TypeError: elementArray[0] has no properties
Is it possible to override the "new record" page, so that I can show or hide the buttons I want?
Maybe there's just a simpler way to do it or it is just impossible, because it is not suported.
Any comment would be appreciated.
Thanks,
new developer
your only choice is to replicate the edit page using AJAX/DHTML form that you create from scratch, which is easy to say, but in reality is an advanced s-control.