Highlighted
Valued Contributor.
Valued Contributor.
518 views

I need clean a field that comes from a link.

Jump to solution

Hello,

I have an array called 'ambitos'. Upon completion this field, the data of the 'name' and 'responsible' fields are filled with   link 'cm3r'.

The problem is that when I delete the data form the field 'ambitos', the data of the fields 'name' and 'responsible' are not cleaned, how can I make the data to be correct?

Thanks in advanced!

Regards,

0 Likes
1 Solution

Accepted Solutions
Highlighted
Knowledge Partner
Knowledge Partner
Hi Vvim,

This what you have looks a bad design. You should store only the code and show the name... you should redesign this for the future...

To solve your actual problem you need to "adjust" the ambitos based on ambitos name. I would create a JS function to iterate all ambitos.name and adjust/sync with ambitos and call on add, upd and del.
Regards,
Breno Abreu

If you feel this was helpful please click the KUDOS! thumb below!

View solution in original post

0 Likes
6 Replies
Highlighted
Honored Contributor.. Honored Contributor..
Honored Contributor..

I'm going to guess that in your cm3r link in the "Post Expresssions" tab you have something like:
if not null(ambitos in $File) then (name in $File="some value" and responsible in $File="some value")

Maybe try also adding to make the name and responsible values empty:
if null(ambitos in $File) then (name in $File="" and responsible in $File="")

0 Likes
Highlighted
Knowledge Partner
Knowledge Partner

If you need to delete immediately, you can create a DO with the code to clean the field and add the DO id to the Data Change Event property of the field that triggers this action. Make sure to write the proper code to clean the fields you want only when you want. So every change of data your DO will be called.

If your can wait for the next "save"/"refresh" you can set this at Format Control or Rule Sets, depends on your system.

Regards,
Breno Abreu

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

Yeah - HPSM is an event-driven system.  It expects you to click a button to perform a function.  Populating data in additional fields when you click Fill is easy - you set up the link record to populate whatever values you want, from whatever tables you want to grab them - but, setting it up so that, when a user just manipulates data on the screen by modifying a field, that's harder.

It can be done - you set up a display option and set the field as a Data Changed Event - but I'm not sure that will really work the way you're hoping it will.  On a Data Changed Event, when the focus of the cursor moves from a field, the system runs a display option, just like if a user clicks a button.  But, that can trigger even when you're not clearing out the value (like you want in this case).

So, first I'd drive back to the requirement.  What's the goal?  Why's it necessary for this data to clear immediately when they clear the primary value?  Would a Virtual Join make more sense (rather than a fill that copies the data, you make a link to the related table and display the data _from that table_ rather than copying it locally.  If the ask is about how the UI works, that's something that _can_ be done in HPSM, but goes outside of best practice of the event-driven system.

0 Likes
Highlighted
Valued Contributor.
Valued Contributor.

Hi,

Thank you very much for the comments of all.

I have in the cm3r link this: img

 

But if at some point in the life of the RFC, I change the value of 'ambito', the other fields are not modified correctly.

1. img

 

2. img

 

 

How could I make the date correct?

Thanks in advance

0 Likes
Highlighted
Knowledge Partner
Knowledge Partner
Hi Vvim,

This what you have looks a bad design. You should store only the code and show the name... you should redesign this for the future...

To solve your actual problem you need to "adjust" the ambitos based on ambitos name. I would create a JS function to iterate all ambitos.name and adjust/sync with ambitos and call on add, upd and del.
Regards,
Breno Abreu

If you feel this was helpful please click the KUDOS! thumb below!

View solution in original post

0 Likes
Highlighted
Valued Contributor.
Valued Contributor.

Hi!

Thanks for your comments.

Finally I created a JS function to update the data.

Greetings.

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.