cancel
Showing results for 
Search instead for 
Did you mean: 

Customization of code generated in workflow apps - SUP 2.1.3

Former Member
0 Kudos

Hi All,

I am working on workflow apps SUP 2.1.3 and I want to save one variable's value and the variable is in global scope of Util.js and then I want to use that variable in my Custom.js. I tried localStorage for saving the variable but it is not working. Some things which I am doubtful about are listed below

1. Is it  ok If I edit Util.js file? (File is not getting regenerated while deployment).

2. Local storage works fine in Android Emulator?

Please reply and suggest what things could have gone wrong.

Thanks in Advance.

Accepted Solutions (1)

Accepted Solutions (1)

former_member186566
Active Participant
0 Kudos

Hi Anupriya

Please disable the "Update generated code" when you generate, Also see the sequence of java script importing in "workflow_jQueryMobileLookAndFeel.html" (or other html file if you are using). If you have declared variable declaration in Utils.js, it should be initialized before Custom.js. Please refer the screenshot attached.

By default, Custom.js will be initialized before Util.js. So if you declare some variable in Util.js, the same variable will not able to find value in custom.js. So reorder the js importing.

I would suggest not to edit framework js files generated by SUP. You have a workaround for this, declare the variable in "workflow_jQueryMobileLookAndFeel.html" file itself.

Ex.

If you do this way, "variable" can be accessed all over the project.

Regards

Yokesvaran Kumarasamy

Answers (2)

Answers (2)

midhun_vp
Active Contributor
0 Kudos

As in the file written since the file is not regenerated you can edit it and there is no need to uncheck "update generated code" since it is not being affected. So the question is why you want to edit this file. What you are trying to do ?

- Midhun VP

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Anu,

I never tried this actually but for one of queries:

1. Is it  ok If I edit Util.js file? (File is not getting regenerated while deployment).

Generally it is not advisable to edit any js file except custom.js but if you want to edit other than this then to reflect the changes to your app you can uncheck Update Generated code under Generate package while assigning to any registered user(s).

Rgrds,

Jitendra

Former Member
0 Kudos

Thanks a lot for reply ..  I will try to do that