Clarity PPM

CA PPM Tuesday Tip - Auto refresh an object instance once process runs

By Andrew Mowlam posted 06-23-2016 08:45 AM

  

Following on from Dave_3.0's legendary tip, we can use this to auto refresh a object instance

One of CA PPM's annoyances to users is refreshing the object instance once a process has run.

This method can take care of where a user changes a value and you need a refresh to see the results of the process.

 

Video pre and post

 

How to replicate - basic example

  • Create a new object

  • create a few attributes, one boolean and one string

  • create a new dynamic lookup - this will execute the refresh script when we want it to

<meta http-equiv="refresh" content="1">  won't work for all browsers, this is just for example!

t.refresh = 1 is the condition to refresh, but it can be anything

 

Unfortunately <script> will be removed by Clarity, so javascript approach to refresh won't work.

Update: It's possible to call javascript if you want, i'm sure you can figure out the way

SELECT
@SELECT:1:DUMMY_ID@,
@SELECT:x.refresh:refresh@
FROM
(
SELECT
CASE WHEN t.refresh = 1 THEN '<meta http-equiv="refresh" content="1">' ELSE ' ' END refresh
FROM odf_ca_test_refresh t
WHERE t.code = @WHERE:PARAM:USER_DEF:STRING:code@
UNION
SELECT to_char(' ') refresh from DUAL
WHERE @WHERE:PARAM:USER_DEF:STRING:code@ is NULL
) x
WHERE @FILTER@
  • create a lookup on the object as detailed in the tip and add it to the object

I have the refresh lookup text hidden in case you wonder where it is!

  • create a simple process that is triggered when refresh boolean attribute = 1

  • updates the string value to "hello world" and resets the refresh flag (to stop the refreshing!)
27 comments
11 views

Comments

25 days ago

I dont see any screenshot. Also looking for working java script.

Thanks,
NP

10-10-2017 04:04 AM

matej256 makes a good point. The fact that it's a customization should normally not be a showstopper. There are tons of customizations here on this forum. It's for us (and the client) to decide if a customization is a go or not. Especially when it's one where the customization does not involve code change and would work on SAAS.

10-09-2017 08:17 AM

Aaah, if only customization is the "stopper" why you can't share, I think it's ok for us - means, we have customized Clarity....  
I tried to send you a message but was not successful - Could you please try you? As I said, I was able to implement it in the past, but nowadays I can't find the source and it would be really helpful for us now...

 

Thanks,

Matej

10-09-2017 07:33 AM

As i mentioned earlier, it requires javascript to be executed. 

Whilst not requiring any product code change, how we do it falls under customisation as it bypasses the "scriptReplace" function

I'd love to share it, but we need to refrain from posting customisations here.

 

Sorry!

10-09-2017 03:34 AM

Hi Anthony, 

 

Thanks, however I don't understand why he is mentioning it when he doesn't want to share it...

 

Nevertheless when I find it, I'll share. I was able to do this trick in the past, but really don't remember how and where I found it....

 

Matej

10-09-2017 03:25 AM

matej256 I don't think Andrew will share this information freely.

10-05-2017 09:33 AM

Hi Andrew, am1

 

great tip, but as Anthony said, could you please share the version with the JavaScript for others? Thanks so much!

 

Matej

05-19-2017 01:46 AM

Hi Andrew,

 

Do you have any example for this? I tried using Js inside the lookup query. But it is getting wiped out when you save. Do you have any examples?

05-18-2017 10:56 AM

execute javascript to refresh the frame

05-18-2017 10:31 AM

Hi Andrew,

 

Thanks for the great tip. It works fine in chrome. But it doesn't work in IE or firefox. Is there any way to make it work in IE or firefox? 

05-10-2017 06:30 AM

Hi Andrew,

 

Can you please post the Java script to refresh the page. Thanks !!

 

Regards,

Raj

05-09-2017 05:05 AM

Hi Andrew am1,

 

great tip, but as Anthony said, could you please share the version with the JavaScript for others? Thanks so much!

 

Matej

12-16-2016 03:55 AM

You can't skip the refresh part, but we can make it seemless without user interaction though.

12-15-2016 03:10 AM

Yes I’m interested. I sent you an email but didn’t get a reply yet. Have you received it? Thanks

 

Anthony

12-14-2016 03:21 PM

Thanks.

Yes, but then you have to Save + Refresh.

I was just wondering if you can skip the Refresh.

12-14-2016 11:58 AM

Would just refresh the page so that attribute you set would then show text.

12-14-2016 11:56 AM

Hi Anthony, 

 

meta refresh is sometimes blocked by the browser, hence my warning. The JavaScript method works on all browsers, get in touch if you want it!

 

Andrew

12-14-2016 11:45 AM

How would you apply this to an autostart on create process which set a value to a field as soon as an instance is created?

12-14-2016 11:24 AM

Small update.. I managed to make it work in Chrome. But it doesn't seem to work in IE & Firefox. Did you try it in other browsers than Chrome?

 

Thanks,

 

Anthony

12-14-2016 10:34 AM

Hi there,

 

I tried this in IE and Firefox and can't seem to make it work. I understand it's hard to debug from where you are, but any idea what could be wrong? (i set the attribute as read-only). See pic..

 

 

Thanks

 

Anthony

08-05-2016 03:53 AM

Have a process triggered when a value is changed, then use this tip to auto refresh.

The new value (as written by the process) would appear on both the list view and object.

This would only help that we are able to force the browser to refresh, thus displaying the new value of the field.

08-05-2016 02:54 AM

Just wondering again...

When you say we can use this to auto refresh a object instance

can that be extended so that the process will overcome the little shortcoming in Dave's method:

That is can a process used to populate the field or another field so that the value is displayed also in a list view?

If so, please elaborate for us non-techies.

08-03-2016 11:08 AM

You hit the bull's-eye! After setting the attribute to read-only, it's working properly.
That's one of the most useful tips I've ever seen in the community.

 

Thanks a lot, Andrew!

08-03-2016 10:44 AM

Yes it works in chrome, difficult to debug from here!

I'd suggest following the steps Dave details in setting up the lookup, appears to not be read-only.

08-02-2016 04:03 PM

Hi, Andrew.

 

Have you tried it for Google Chrome and IE11?

Take a look what is happening in my environment (Clarity 14.3.0.298)

 

 

Dynamic lookup:

 

SELECT

@SELECT:1:DUMMY_ID@,

@SELECT:x.refresh:refresh@

FROM

(

SELECT

CASE WHEN t.refresh = 1 THEN '' ELSE ' ' END refresh

FROM odf_ca_test_refresh t 

WHERE t.code = @WHERE:PARAM:USER_DEF:STRING:code@

UNION

SELECT to_char(' ') refresh from DUAL

WHERE @WHERE:PARAM:USER_DEF:STRING:code@ is NULL

) x

WHERE @FILTER@

08-02-2016 04:06 AM

Yes you'll need to map the lookup attribute to code

07-28-2016 03:29 PM

Hi, Andrew.

 

I tried creating your own scenario, even the same IDs... but it is not working.

Isn't there any hidden step on your tip? Do I need to map the lookup parameter?

 

Thanks in advance.