Important Update: Community URLs redirect issues are partially resolved. Learn More. .

cancel
Showing results for 
Search instead for 
Did you mean: 

Looking for a Custom Object to Hide the Save Button

AmandaWeis
Contributor III

I am in search of a custom object that will hide both the Save and Save and Close buttons. This is for use in an application using Advanced Workflow; we want to drive users to use the Advanced Workflow button to move the record to the next node rather than the Save button which leaves the record in the current node.

 

We had a custom object that did this in version 6.1 but after upgrading to 6.3 P3 it no longer works: 

<Script type="text/javascript">
Sys.Application.add_load(function(){$("#master_btnSave").hide(); });
</script>

 

Any help would be greatly appreciated!

11 REPLIES 11

mikewirth@DFS
Contributor II

Amanda -

 

It looks like there was a rename of Save to master_btnApply in 6.3.  I was able to get the following to work in 6.3 P5HF1

 

<script type="text/javascript">
  Sys.Application.add_load(function() {
    $("#master_btnApply").hide(); // Hide Save button
    $("#master_btnSave").hide(); // Hide Save and Close button
  });
</script>

AndrewStull1
Contributor

Amanda, try this code out:

 

<script type="text/javascript">
   Sys.Application.add_load(function() {
      if($('#master_btnApply')){
         $('#master_btnApply').hide();
      }
   });
</script>

 

This worked for me on the default layout of an advanced workflow app, so hopefully it will work for you too.

AmandaWeis
Contributor III

Thank you so much! These worked great for me in 6.3 P3. 

LaurenBrodt
Advocate III

Replying here rather than starting a new thread because I borrowed the code from here.

 

I'm trying to hide a workflow button.  I could have sworn I had it working yesterday, but maybe not.  The Allocated Controls workflow button will only hide with $("#master_commandsDiv").hide();. Neither $("#master_3840:CUST").hide(); // Hide Allocated controls nor $("#wftran3840:CUST").hide();  are working.  Hiding the Save button works, as well as hiding the audit info for the key field.  As I mentioned, I could have sworn it worked yesterday, but maybe I was in view mode and didn't realize it.  

 

Any thoughts or anything obviously I missed?  I'm dabbling in js for the first time since college.

 

<script type="text/javascript">
Sys.Application.add_load(function() {
$("#master_3840:CUST").hide(); // Hide Allocated controls
$("#master_btnApply").hide(); // Hide Save button

$("#20767auditInfo").hide(); // hide key auditing info
$("#wftran3840:CUST").hide();
$("#master_commandsDiv").hide();

});
</script>

pastedImage_1.png

Why hide an advanced workflow button with JS (jquery)?  Use permissions and rules in the workflow designer. 

If the button is "permissioned" then only certain users will see it and if you add an a rule, it'll only appear when those conditions are met.

That makes much more sense. We used to use ACLs for hiding the buttons and this is the most extensive AFW modifications I’ve made since we’ve upgraded so I didn’t realize I could do that. Thanks!

Mike - can this code be dynamic?  For example, disable the buttons until a certain value is selected in a values list?

 

 

Robert

Robert, I personally haven't made the button hiding code dynamic based on a click, but I have done something similar and there are a few options. 1) Use advanced workflow to transition between layouts that have or don't have the javascript code above. 2) Try to add an on click method to the HTML object to call a function. 3) When a record is opened or saved you can create a function to check the value in a values list using an API call or the DOM, then you can hide or not hide the buttons based on the value you found. 1 is by far the easiest, 3 can be a bit tricky with error handling because the Edit/View modes treat values differently, 2 is something I haven't tried yet but I think it might be able to work.

Anonymous
Not applicable

Hi All,

 

I have upgraded to 6.8 P3, HF1 and now this code of hiding Save button is not working for me. Any idea if the ID got changed. It would be great to get some assistance on this.