How to reset Changecounter by an action ?

Hello Everyone ,

I want to reset the change counter column by an action definition. 
I have created a slice using a change counter column type. Whenever there is a change in 2 columns, I am setting a change counter for that particular row, and hence adding those record into a slice. This slice record will be referred later for some manual tasks and upon completion of manual task I need to reset the change counter so that, It will be moved out of the record until the value of those two columns change again.

I would appreciate if anyone can help here with any direct or indirect tricks to tackle this issue.

I was wondering why the simple option was not yet enabled ?

Thanks in advance 

Nithin 

Solved Solved
0 4 763
1 ACCEPTED SOLUTION

ChangeCounter columns cannot be manually updated to some specific value.  They can only be initialized to a beginning value.

You have 2 choices:

1) Create your own counter column defined as Number.    By adding an App Formula to increment it on each edit, it will more or less behave like a ChangeCounter.  Then you can update it however you wish.

2)  You can still reset a ChangeCounter with a button click by setting a flag column that the "Reset on edit" of the ChangeCounter can watch for.  For example, maybe you add a column to the table named "Reset Counter?" as a Yes/No.  Then create a GROUPED action as a button that sets the "Reset Counter?" to TRUE and then immediately back to FALSE.

You can then implement the "Reset on edit" expression like so:

AND(
[_THISROW_BEFORE].[Reset Counter?] <> [_THISROW_AFTER].[Reset Counter?]
[Reset Counter?] = TRUE
)

When the action button is clicked, the flag is set to TRUE and the ChangeCounter's "Reset on edit" kicks in due to the row edit.  Because the flag has changed and was changed to TRUE, ChangeCounter is reset and applies the Initial value expression.  The flag is set to FALSE immediately to prevent any other rows from re-triggering the reset unnecessarily.

View solution in original post

4 REPLIES 4

In the column definition there is a section named "Update Behavior".  In that section you will want to to use the "Reset on Edit" property and supply an appropriate expression to determine when to reset. 

Dear  WillowMobileSys, 

Appreciating your response. 
But my requirement is a little different. I want to reset the Change Counter value upon a manual action button. 
So, How to trigger this option by an action definition ?

thanks in advance

Nithin

ChangeCounter columns cannot be manually updated to some specific value.  They can only be initialized to a beginning value.

You have 2 choices:

1) Create your own counter column defined as Number.    By adding an App Formula to increment it on each edit, it will more or less behave like a ChangeCounter.  Then you can update it however you wish.

2)  You can still reset a ChangeCounter with a button click by setting a flag column that the "Reset on edit" of the ChangeCounter can watch for.  For example, maybe you add a column to the table named "Reset Counter?" as a Yes/No.  Then create a GROUPED action as a button that sets the "Reset Counter?" to TRUE and then immediately back to FALSE.

You can then implement the "Reset on edit" expression like so:

AND(
[_THISROW_BEFORE].[Reset Counter?] <> [_THISROW_AFTER].[Reset Counter?]
[Reset Counter?] = TRUE
)

When the action button is clicked, the flag is set to TRUE and the ChangeCounter's "Reset on edit" kicks in due to the row edit.  Because the flag has changed and was changed to TRUE, ChangeCounter is reset and applies the Initial value expression.  The flag is set to FALSE immediately to prevent any other rows from re-triggering the reset unnecessarily.

Dear  WillowMobileSys, 

Appreciating your response.
It worked !!  
GROUPED action definition made my road really easy. Thank you very much for your suggestion. 
Hope we will meet again later ๐Ÿ™‚ 

Best Regards

Nithin

Top Labels in this Space