Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
Micro Focus Contributor
Micro Focus Contributor
550 views

Call javascript from format

Hello,

is it possible to call a javascript directly from form designer? I tried these steps:

1. fd -> myForm (for myTable)

2. go to myField use this as input: jscall("myJS.myFunc", contact.name) where contact.name is a field of myTable

No syntax error will be returned, but also no result. Could you please help? I only need it in format, not in formatctrl, not in display option etc.

Thanks,

Tianying

0 Likes
6 Replies
Acclaimed Contributor.. Vadim Gorda Acclaimed Contributor..
Acclaimed Contributor..

Re: Call javascript from format

Hello,

this wont work that way - so answer is no.

Use methods which you listed in the end (do , fc ... ). What is the reason of not using them? Specific requirement which makes them not fit for it?

0 Likes
Micro Focus Contributor
Micro Focus Contributor

Re: Call javascript from format

Hi Vadim,

thanks for your reply. Yes, it's a device table qbe list. Instead of the contact name the customer required to display the contact email. In their environment the only contact name is stored as a field in device. The email has to be retrieved via link record from contacts table. I wrote a script therefore, but I know it's not possible to call it from qbe, just hoped maybe it's possible to call a js from a regular format.  

0 Likes
Outstanding Contributor.. Tommy Jensen Outstanding Contributor..
Outstanding Contributor..

Re: Call javascript from format

On a form, the only way to call a javascript is in a html viewer.

0 Likes
Honored Contributor.. MarcusReinhardt Honored Contributor..
Honored Contributor..

Re: Call javascript from format

Hi,

just an idea: How about using a joindef for this to display the required information in the QBE.
Didn't tested it, but if you create your own joindef for device and contacts, you should be able to display the email in QBE.

0 Likes
Martin_E Trusted Contributor.
Trusted Contributor.

Re: Call javascript from format

not sure which version you are using. in SM9.41 there is already a "relatedObjectMap" record that joins the contact.name in device table with contact.name in contacts table.

so, when you update/define a view for device table, define which fields to display, and select contact.name and then "Email" from Contact. see attached screenshot for details

Micro Focus Contributor
Micro Focus Contributor

Re: Call javascript from format

The QBE will be poped up by clicking the fill button (realized in link). It's not in the view, therefore I cannot get the email cross table even a relatedObjectMap is available. I have SM9.41.

I'll try the joindef option.

Thank you all for giving me example and ideas!

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.