Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

User Actions for selecting routes.

Avatar

Level 4

Hi,

I need to validate some fields in the PDF form depends on the Action the user has selected. On selecting One action I have to validate one field on another action it should validate other. How can I achieve it ? How to see which Action the user has selected ?

uAct1.jpg

Thanks.

-

Abhinav

1 Accepted Solution

Avatar

Correct answer by
Level 10

Do not place your own submit field because the Process Fields collection will hold a submit button for you.

I hope removing your submit button will solve the current problem.

Nith

Nithiyanandam Dharmadass

Ministry of Finance

Tel. +973 17575809

nith@mof.gov.bh

www.mof.gov.bh

P.O Box 333, Manama, Kingdom of Bahrain

Please consider the environment before printing this email

View solution in original post

9 Replies

Avatar

Former Community Member

I don't believe this is possible in 8.2.

I thought this issue had been fixed in 9.X.

What version are you using?

Avatar

Level 10

This is definitely possible.

Write a validation script on preSubmit event of the form.

AWS_ACTION will have the selected status.

you can prevent submission (if some validation fails) by the following expression:

xfa.event.cancelAction = true;

Nith

Avatar

Level 4

Hi Nith, Thanks for your reply.


I am having a problem in applying your approach. I havn't use AWS_ACTION till now. So don't know how to use it.


I created a new form (xdp), Workspace enabled, put a submit button (named it 'AWS_ACTION'). On Button's preSubmit event I try to check the AWS_ACTION value.

app.alert("AWS Value: " + AWS_ACTION.rawValue );

xfa.event.cancelAction = true;

In workspace, I have 2 routes. I am getting the null value when selecting anyone of the route. I have tried it on form's preSubmit event. Still same result.

Pls tell where I am doing it wrong.

Thanks.

-

Abhinav

Avatar

Level 10

put a submit button (named it 'AWS_ACTION').

The above action is wrong. You must drag the "Process Fields" item from Custom Component category (from Object Library)

Once you drag it into the form, you will notice several fields added to the form including the AWS_ACTION field.

Hope that helps!

Nith

Nithiyanandam Dharmadass

Ministry of Finance

Tel. +973 17575809

nith@mof.gov.bh

www.mof.gov.bh

P.O Box 333, Manama, Kingdom of Bahrain

Please consider the environment before printing this email

Avatar

Level 4

Thanks.

I am now trying with Process Fields but getting some error while initiating process in workspace. Compete button is not showing when the form is first opened, with the below error:

' The form associated with task 1510 has multiple submit buttons so the Workspace Complete button will be disabled.  Click the appropriate button on the form to submit it. '

I am looking into it. Will update you.

-

Abhinav

Avatar

Correct answer by
Level 10

Do not place your own submit field because the Process Fields collection will hold a submit button for you.

I hope removing your submit button will solve the current problem.

Nith

Nithiyanandam Dharmadass

Ministry of Finance

Tel. +973 17575809

nith@mof.gov.bh

www.mof.gov.bh

P.O Box 333, Manama, Kingdom of Bahrain

Please consider the environment before printing this email

Avatar

Level 4

I was checking the issue. I found that there are 3 Buttons in process fields:

  • AWS_SUBMIT : Control Type - Regular, Visible
  • FSSUBMIT_    : Control Type - Submit, Hidden
  • PDF_SUBMIT  : Control Type - Submit, Hidden

So I think the problem is due to later two buttons (FSSUBMIT_ & PDF_SUBMIT). Both are of Submit type. So workspace not able to recognize which one to use to submit.

I changed the above to: (not using my submit button)

  • AWS_SUBMIT : Control Type - Submit, Visible
  • FSSUBMIT_    : Control Type - Regular, Hidden
  • PDF_SUBMIT  : Control Type - Regular, Hidden

Trying this COMPLETE Button now become visible. Now it is able to recognize the routes.

Thanks a lot.

-

Abhinav

Message was edited by: Abhinav Sharma

Avatar

Level 1

I am using version 9.0 really well

Thank