CA Service Management

 View Only

SPEL: Dynamic filling of related fields in edit mode 

May 04, 2017 06:05 AM

Disclaimer

This customization is presented as is and was not tested well. Use it at your own risk.

Please remember! Any kind of SPEL customization can cause performance/stability issue which is not responded by CA Support: https://communities.ca.com/docs/DOC-231156196#comment-233917142 

 

Demonstration video

 

What is this

This method is seeking for lookup and hier fields, then determine all related fields. Once parent field being changed, script performing ajax query to fetch all related values (exception: nr associated fields).

 

Installation steps

1. Register new WebEngine OP (more info about Webengine OPs: SPEL: Register custom webengine OP)

- Open $NX_ROOT\site\mods\www\op_custom.cfg;

- Add followed string to end (before footer message) of the config file:

Z_BACKFILL z_backfill MODIFY UPDATE

- Save file;

- Copy z_backfill.spl as: $NX_ROOT\site\mods\www\z_backfill.spl;

- Recycle WebEngine to apply changes.

 

2. Register HTMPL file

- Copy z_backfill.htmpl as $NX_ROOT\site\mods\www\htmpl\web\analyst\z_backfill.htmpl;

- Add followed line to enable backfilling on selected form (such as detail_cr.htmpl, detail_iss.htmpl, etc):

<PDM_INCLUDE FILE=z_backfill.htmpl>

Line should be inserted between <head></head> and <script></script> HTML tags;

- Reset Webcache;

 

Changelog

2017-05-10:

   - jQuery alias fixed;

Statistics
0 Favorited
23 Views
3 Files
0 Shares
20 Downloads
Attachment(s)
zip file
z_backfill.spl.zip   1 KB   1 version
Uploaded - May 29, 2019
zip file
detail_cr.htmpl.zip   7 KB   1 version
Uploaded - May 29, 2019
zip file
z_backfill.htmpl.zip   1 KB   1 version
Uploaded - May 29, 2019

Tags and Keywords

Comments

Mar 07, 2018 09:30 AM

Very cool this customization.

Congratulations cdtj!

Mar 07, 2018 06:15 AM

Thanks for your input Michael!

 

Yeah, I saw it but I try to do not mess with ootb js functions  due to possible migration problems.

I think that correct way is to call jQuery .trigger() (or .change() if you're still on 12.x and using old jquery) method as part of backfill, this will make event listeners work even on hidden inputs: event handling - jQuery - Detect value change on hidden input field - Stack Overflow 

 

Regards,

Timur Alimov

Mar 07, 2018 05:37 AM

Hi cdtj.

Thanks a lot for all your great contributions !!

regarding this backfill approach:

Yes, one of the challenges is, to recognize when the GUI changes the content of some input fields.

In your approach, as far as understand it, you periodically check if the field in interest has changed inbetween.

Have you ever took a look at js function backfill_event .

This function seems to get called by the js sdm framework whenever there is some kind of a hidden lookup and an srel lookup field gets set.

That means adopting this function might be more efficient than constantly looking for changes.

This function seems to work well for autocomplete, autosuggest and selection list backfills in 17.0. it handles all factories except cnt's ( there is a special backfill_cnt_event function) and pcat's( I was able to get similar results with adopting function reset_vals).

 

Just a comment and idea sharing.

Best regards

.........Michael

Related Entries and Links

No Related Resource entered.