cancel
Showing results for 
Search instead for 
Did you mean: 

Set form fields values using javascript interactive form

Former Member
0 Kudos

Hi Experts,

I have create process and form ,In the initialize event of the form filed I tried to set two fields value depend on other value in the form , it take the value

and its appear on the form , but the probelm when I clcik next , I got error message that the values is missed , if I try to eneter manually it'sworking fine

Please help me to solve these issu

Regards

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Ghadeer Zahalqa,

Agree with Chris, best practice is to implement generic service for those fields; and you will have more control(initialize value, do validation, populate dropdown content) on these fields.

You may try the method as Chris suggested.

But it is very depending on your requirement; for the logic is simple and direct to populate another 2 fields value, you can use hardcode and if-else using Formcalc/Javascript without involving GS.

To understand your problem correctly and help you further

- Can you please provide your code in initialize event.

- Is there any binding for  your another 2 fields?

- May i know what is the exact error message you get?

Thanks.

regards,

Xiang Li

Former Member
0 Kudos

Hi Xiang Li,

thanks alot , could you please share me auseful link how to make operation using generic services,

this my javascript code:

var typ = this.parent.I0002_NATIO.rawValue;

this.parent.I0185_ICNUM1.rawValue = this.parent.I0002_PERID.rawValue;

if(typ == "SA")

this.rawValue = "NI";

else

this.rawValue = "IQ";

moreover am using standard infotype,and yes there is binding for the fileds from infotype 185

the error message I got:

IC Type - No entry in table T5R05 for key 24.

I want to add one more thing , if I clcik anyplace  in the form , every thing going fine ,I have got the error only if I click next without hitting the form .

thank in advance

ChrisSolomon
Active Contributor
0 Kudos

Ok...I am assuming you are using HCM Processes and Forms from the way you are talking....correct?

First off....you say in INITIALIZE event, you want to fill two values depending on another value on the form.

It sounds like you are trying to do this in the Adobe Form's initialize event....correct? If so, I would suggest NOT going this route. I would do this on the BACKEND using a generic service and not on the front end in script. However, if you want to do it in the form, you need to understand how the Adobe form's "lifetime" chain of events happens. This will help you determine WHEN the data is actually available to the form to then compare and set in your other fields. This will depend on your field bindings and when those actually get bound to an actual value that you can then script to retrieve.

However, of you choose to do this using a generic service (the more common way)....simply make an "operation"...map your 3 fields to it....and then those fields will be "available" in your INITIALIZE method of your generic service to compare and set as you like. It will be cleaner this way as your BUSINESS LOGIC will be separate from your UI LOGIC (ie. the form).

Former Member
0 Kudos

Hi Chris,

ya am using HCM Processes and Forms ,am just start using it ,and yes am using initialize event ,

but sorry I dont how can I make operation using generic servic , could you please share me with useful link, moreover am using standard infotype 0002 (personal  data) and 185(Identification)

,so can I use generic  service with standard infotype?

I want to add one more thing , if I clcik anyplace  in the form , every thing going fine ,I have got the error only if I click next without hitting the form .

Thanks in advance