cancel
Showing results for 
Search instead for 
Did you mean: 

How to Disable Save Button in interactive form via sfp

0 Kudos

Dear,experts

My requirement is that Disable Save Button in interactive form via sfp .Is there any options to do this or write Javascript/Formcalc.Please help!

Thanks

Vince.

Accepted Solutions (1)

Accepted Solutions (1)

SandySingh
Active Contributor
0 Kudos

Hello Vince

Use the following javascript code in "preSave"method


if (do_not_save_condition == 1) then  

xfa.event.cancelAction = 1 endif

Regards

sandy

0 Kudos

Hello Sandy,

    

     Thanks for your reply,but it does not work.Look the follow picture. Is any error?

Regards

Vince

SandySingh
Active Contributor
0 Kudos

Hello ,

You have added it as FORMCALC . You need to add this as Javascript code. It should work.

Regards

Sandy

0 Kudos

Hello,Sandy

    

     I have changed it to JAVASCRIPT,buit it also not work.I want to disable the "SAVE BUTTON" in

the TOOLBAR.

Regards

Vince

SandySingh
Active Contributor
0 Kudos

Can you try Javascript

app.hideToolbarButton("SaveFileAs");

app.hideToolbarButton("Save");

0 Kudos

Hello,

    

     It also not work.My Adobe Livecycle Designer version is 8.0,is any problem?

Regards

Vince

0 Kudos

Hello,

     I check the app "hideToolbarButton"  not support in Livecycle Designer.See the follow article,

page 19:

http://partners.adobe.com/public/developer/en/acrobat/sdk/AcroJS_DesignerJS.pdf

Regards

Vince

SandySingh
Active Contributor
0 Kudos

I found a adobe documentation that says that If you want to disable some toolbar buttons, you will have to use application-level Javascript. Looks like it is not possible from ADLC

Place the following Javascript code inside a .js file in

%ProgramFiles%\Adobe\Reader 9.0\Reader\JavaScripts   to disable the toolbar buttons:

// [File - Create Adobe PDF Using Acrobat.com], plus toolbar button

app.hideMenuItem("WebServices:CreatePDF");

app.hideToolbarButton("Weblink:CreatePDF");

// [File - Collaborate], plus toolbar button

app.hideMenuItem("Annots:FileCollaboration");

app.hideToolbarButton("Annots:CollabToolButton");

app.hideToolbarButton("CommentTask");

app.hideToolbarButton("SigTaskButton");

app.hideToolbarButton("SaveFileAs");

app.hideToolbarButton("Save");

Regards

Sandy

0 Kudos

Thank,Sandy.I have tried it.

It works when i download file to pc.But it does not work when I preview it on sapgui.

SandySingh
Active Contributor
0 Kudos

This message was moderated.

danni_hardanni
Participant
0 Kudos

Hi Sandy,

As I know, there's no cancel action for presave method in PDF.

Specifies whether to cancel a forthcoming action. This property applies only to the following scripting events:

prePrint, preSubmit, preExecute,preOpen, and preSign only.See This link:LiveCycle ES2 * Adobe LiveCycle Designer ES2 Cheers,

Hardanni.

Answers (2)

Answers (2)

danni_hardanni
Participant
0 Kudos

Hi Wang,

As I know, there's no cancel action for presave method in PDF.

Specifies whether to cancel a forthcoming action. This property applies only to the following scripting events:

prePrint, preSubmit, preExecute,preOpen, and preSign only.See This link: LiveCycle ES2 * Adobe LiveCycle Designer ES2 Cheers,

Hardanni.

diego_santos
Employee
Employee
0 Kudos

Hi Wang,

Please read my KBA.
https://service.sap.com/sap/support/notes/1798411

The available options are:

  1. ABAP Code

From NW70SP14 onwards, SAP delivered the report FP_PDF_TEST_20, which uses the method SET_INITIAL_VIEW (see our documentation). This is an example to disable the toolbar, menu and window control.
You can either use the report FP_PDF_TEST_20 as example to disable the undesired menus or implement the same method for your code. This will work with Adobe Reader 9.x and lower versions.

  1. Adobe Template code

Add the below JavaScript to your Adobe template in SFP, use the initialize event:

app.toolbar = false;

Although it will hide the toolbar, users will be able to see it again by pressing F8. This works as of Adobe Reader version 10.x.

Keep in mind that users can revert this setting by pressing F8. As explained in the KBA 1798411.

Regards,
Diego

Former Member
0 Kudos

note 1798411 is not yet released, could you please send details?

thanks