Highlighted
Super Contributor.. Super Contributor..
Super Contributor..
369 views

how to set value of text box using java function

Hello Experts 

is it possiable to set a value of an attributes of one of form control in FD by using Java function 

for example .

i need to change a text of a text filed by call a java function that will select some thing from table based the contact name in the this record 

it this possiable ?

 

thanks in advacnce 

 

Thanks and Best Regards
------------------------------
Amr Salah
0 Likes
5 Replies
Highlighted
Knowledge Partner
Knowledge Partner

Re: how to set value of text box using java function

Yes it's possible and maybe the best is add this logic on Link so you don't need to care about refresh the screen and it's also simpler...

system.vars.$File.fieldName="value you want...";

If you decide to add the logic somewhere else, you will need to refresh the screen after set the value.

Regards,
Breno Abreu

If you feel this was helpful please click the KUDOS! thumb below!
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: how to set value of text box using java function

When you say:

"will select some thing from table based the contact name in the this record "

You mean contact name of current operator wich opened the form

or

Contact name from field contact.name (for probsummary table, for example) wich filled in on form

0 Likes
Highlighted
Super Contributor.. Super Contributor..
Super Contributor..

Re: how to set value of text box using java function

thanks  BrenoAbreu  

this is a good idea , 

would you please guide me more , for example if i need to show a certain text in a text label based on selection of Area.

so following your idea, i will go to the incidents master link, and edit the line of product.type , go to the post script and type the java code . 

so say i set the caption of the label to be for example $x ? and what would be the java code here ? please note here i'm not setting a filed in the file , it is a variable on the form design 

any ideas please?

 

Thanks and Best Regards
------------------------------
Amr Salah
0 Likes
Highlighted
Super Contributor.. Super Contributor..
Super Contributor..

Re: how to set value of text box using java function

Hello ALARMus

here i mean the value on the form 

as you saied  "Contact name from field contact.name (for probsummary table, for example) wich filled in on form"

Thanks and Best Regards
------------------------------
Amr Salah
0 Likes
Highlighted
Knowledge Partner
Knowledge Partner

Re: how to set value of text box using java function

You can put in the target (don't need to be JS) ... 

$x="value here";

or in JS: system.vars.$x="value here";

Regards,
Breno Abreu

If you feel this was helpful please click the KUDOS! thumb below!
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.