adil_k_hussain Absent Member.
Absent Member.
7326 views

Actions on custom form


I have an Action on a custom form which is getting rather long and b/c of that I' running into a situation whereby it's making any changes to the form very time consuming. I tried to break up this action into several smaller actions but still changing or adding to this form is getting to be very time consuming process.

Basically I'm trying to set values to default, showing/hiding fields when item type changes on New Hire Form. There is quite a bit of detail that needs to be captured which entails lots of different fields. It seems changing all of them under same action causes form to become blotted. Any suggestions are welcome.
Tags (1)
0 Likes
7 Replies
Not applicable

Re: Actions on custom form


how about moving fields to section tabs and using the code to hide/show the tab sections instead of each field
0 Likes
pmthompson1954 Absent Member.
Absent Member.

Re: Actions on custom form


I would suggest re-implementing your form actions in JavaScript. Use one or more .JS files rather than an HTMLJavaScript widget. Add the JavaScript module(s) to the Process App, then include them for the form. The SBM JavaScript API functions map pretty closely to Form Actions.

This approach gives you the full power of JavaScript and allows you to tap into any JavaScript expertise. If there is none at your location you can ask for assistance here or try a Meetup group.

Just curious - when you say changes are "time consuming" do you mean that Composer is slow or not responsive?
0 Likes
adil_k_hussain Absent Member.
Absent Member.

Re: Actions on custom form


In regards to your question, Paul; On this form adding anything to Actions like 'show this field' takes about 30-50 sec. If I have to add this same Action line to 4 different scenario; it can easily take up to 4 min. If I have multiple Action lines, process is becoming longer and longer.

But on other forms within same process app; where Actions are relatively smaller, adding Action lines to Actions is instantaneous.
0 Likes
pmthompson1954 Absent Member.
Absent Member.

Re: Actions on custom form


Please contact Serena Support about the delays.

As I noted in my previous reply, a workaround would be to create a JavaScript that essentially does everything you are doing with Form Actions.
0 Likes
adil_k_hussain Absent Member.
Absent Member.

Re: Actions on custom form


I'm going to try something like this. I'll post any progress over here. Comments welcome.

function SetData ()

{

var a = GetFieldValue("Item type");

if (a== "Hire - Agency Temp")

{

MakeFieldRequired("Employee Name", true);

ShowField("End Date?");

...

}

else if (a =="Hire - Telecommuter")

{

MakeFieldRequired("Employee Name", true);

ShowField("Printer?");

HideField("End Date");

...

}

else if (a =="Hire - Full-time")

{

MakeFieldRequired("Employee Name", true);

ShowField("Printer?");

ShowField("This Account Needed")

HideField("End Date");

...

}

else

{

MakeFieldRequired("Employee Name", true);

ShowField("Printer?");

...

}

}

AddChangeCallback(SetData);
0 Likes
Highlighted
adil_k_hussain Absent Member.
Absent Member.

Re: Actions on custom form


If .js file is used; do I need to add following line. If not how will call to function work?

AddChangeCallback(SetData);

I was thinking to add an "execute a javascript" action on the form that includes the above code. I'm not sure how to make above code work using .js file.

Another thought was to use HTMLjavascript widget then I do use this line to make the call to the function.
0 Likes
pmthompson1954 Absent Member.
Absent Member.

Re: Actions on custom form


Unless you need some of the pre-defined constants that Actions allow (like "{State}" or "$TRANSITIONID()"), then I wouldn't use an Action or HTMLJS widget to launch the JavaScript.

Save your JS as a file. Create a JavaScript design element in Composer, give it a name, import your JS (from file), then in the Form attributes, Add that JavaScript.
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.