Hi all,
I have to admit that I've never once used the TR. construct, and I've been
working with this system a long time. I guess I've always assumed it had a
reasonable usage but, since I was always able to accomplish everything I
needed to do with the 'Field' and 'DB.Field' constructs, I never looked
that closely at TR or given it as much thought as I have reading this
conversation.
I think the ONLY important question here is: is there anything at all that
you can do with TR that can't be done without it? Is there any question
that it and it alone can uniquely answer? And I think the answer is no, in
which case the mechanism is at best redundant and superfluous. Worse
though, it's pretty clear from this conversation that it's easily
misunderstood and misused.
To clarify a point, many people have mentioned, as Misi did, that a "'Save'
by the user" will set the TR values for only those values that have been
changed (and, of course, not to NULL). More generally, every client (like
the WUT or the mid-tier) using the ARSetEntry API (or ARCreateEntry or
ARMergeEntry, which the mid-tier and WUT do) must assemble the set of
field/value pairs that it wants to update into a record. This does not
necessarily include all of the fields on the form. Similarly, when you
create a PushFields action, you choose and assemble the list of field/value
pairs you want to "send" to the foreign form, and it does not necessarily
include all of the fields on the form.
It is the fields in this list that will have TR values (if, again, they're
not NULL). Even if a particular field/value pair in the list contains a
value that is NOT new, the TR value will be set, but in this case
'TR.Field' = 'DB.Field'.
The WUT and mid-tier are "smart" about it in that they only include in the
field/value pair list those fields with values that they think have
changed, which is why it appears that TR only gets set if the field has
changed. Other clients using the API might not be as selective and send
values that are not changed. A PushFields is similar in that it might send
unchanged values. So the fact that TR contains a value does NOT mean the
value is being changed. And of course as many have mentioned, the fact that
TR is NULL does not mean that the value is not being changed.
I got curious about all this and did some testing. One thing I found (that
I haven't seen mentioned yet) is that a SetFields in workflow WILL set the
TR value of a field, so the TR value being set does not even mean that the
new value is external (i.e. came from a client or Push Fields). I was
really hoping to find otherwise, so that ('TR.Field' != 'Field' AND 'Field'
!= 'DB.Field') would uniquely mean that 'Field' was set by local workflow
(a SetFields). Of course, this isn't something I've ever actually needed to
test for, but at least it'd be interesting.
I also got curious about how TR and DB affect values being sent into
Display fields, but nothing really surprising turned up (the 'DB.Field'
value is always NULL as you might expect ).
So in conclusion:
1) 'TR.Field' having a value does not necessarily mean that the field has
changed since it could be that 'TR.Field' = 'DB.Field'
2) 'TR.Field' having a value does not necessarily mean that the field has
been sent a value from an external source, since a SetFields in local
workflow will set the TR value.
3) "TR.Field' having a value of NULL does not necessarily mean that the
field is not being changed - it might be being changed to NULL (which we
can detect with 'Field' != 'DB.Field' AND 'Field' = $NULL$)
4) 'TR.Field' != 'Field': For a moment I was hopeful that this *might*
uniquely tell us that a field is NOT being updated by the external source
(not sure why it'd ever be important to know this), but if 'DB.Field' is
already NULL, then we won't know if the field IS in fact being updated, but
to NULL. Presumably if you DO find a use case where it's important to know
if the field is in the field/value list, you'd probably want to know it
even if it's being set to NULL.
5) 'TR.Field' != 'DB.Field': Does tell us if the field is being assigned a
new value, but as we all know this can always be reliably done with just
'Field' != 'DB.Field'.
So, I just don't see any need for the TR construct. It doesn't reliably
tell us anything we can't determine with the other two constructs.
I've attached a .def with the form & workflow of my tests for anyone who
might want to play around with it. In it I define a regular form with a
regular field 'Regular' and a display field 'Display'. I then have filter
workflow that checks each for each of the following conditions:
* 'TR.Field' != 'DB.Field'
* 'TR.Field' != 'Field'
* 'Field' != 'DB.Field'
I then have workflow that performs a SetFields into each field, then test
these conditions again (this to show that a SetFields does change the TR
value). Everything works pretty much as expected.
-charlie
On Sat, May 10, 2014 at 2:57 AM, Misi Mladoniczky <[email protected]> wrote:
> Hi,
>
> The TR values are pretty useless.
>
> The reason is that a TR value can be set to NULL either by a change to
> NULL or
> by not changing the field at all. In the latter case the field will retain
> the
> value in the database after the transaction, but in the first case the NULL
> will be written to the database.
>
> This is how you check for a field data change:
> ('Field' != 'DB.Field')
>
> Sometimes you want to trigger things only on a non-null-change on an
> optional
> field in which case you write:
> ('Field' != 'DB.Field' AND 'Field' != $NULL$)
>
> The TR values can be used as a lazy, and non exact, way to trigger a few
> things:
> ('TR.Assigned To' != $NULL$) => Send notification to "new" assignee
>
> It is sometimes possible that the notification will be sent without the
> data
> actually being changed, in which case you can extend the qualification.
> But in
> that case it is as easy to use 'Field' as 'TR.Field'.
>
> These are equivalent:
> ('Field' != 'DB.Field' AND 'Field' != $NULL$)
> ('TR.Field' != 'DB.Field' AND 'TR.Field' != $NULL$)
>
> Note that Push-Fields typically sends transactional values even without a
> change, but a normal 'Save' by the user will send TR-values only for those
> fields which has been changed.
>
> Best Regards - Misi, RRR AB, http://www.rrr.se (ARSList MVP 2011)
>
> Ask the Remedy Licensing Experts (Best R.O.I. Award at WWRUG10/11/12/13):
> * RRR|License - Not enough Remedy licenses? Save money by optimizing.
> * RRR|Log - Performance issues or elusive bugs? Analyze your Remedy logs.
> Find these products, and many free tools and utilities, at http://rrr.se.
>
> > Some wonder why TR was built others say it works fine. I thought I had
> a good
> > handle on TR but now reading the differing opinions I am questing my
> > understanding of TR.
> >
> > Some posts indicate it is completely useless and can't be trusted. Some
> other
> > indicate like a weapon as long as you treat it with respect and know how
> to
> > you it you'll be fine.
> >
> > So off the the archives I went:
> >
> http://ars-action-request-system.1.n7.nabble.com/TR-vs-DB-sanity-check-please-tp99981p99993.html
> >
> > Doug set it straight in 2010. After rereading his post I am questioning
> the
> > purpose of TR.
> >
> > QUOTE: 'A' != 'DB.A' is all the testing you need to see if the value
> has
> > changed
> >
> > If DB all that is needed what is a valid use case for having TR. Not
> one that
> > can be down with TR or DB but what is that TR provides that cannot be
> done
> > otherwise?
> >
> > Jason
> >
> >
> _______________________________________________________________________________
> > UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
> > "Where the Answers Are, and have been for 20 years"
> >
>
>
> _______________________________________________________________________________
> UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
> "Where the Answers Are, and have been for 20 years"
>
_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
"Where the Answers Are, and have been for 20 years"
char-set: UTF-8
#
# File exported Tue May 13 08:11:26 2014
#
begin schema
name : Test6
core-version : 2
upgrade-version: 0
num-fields : 11
timestamp : 1399993611
owner : Admin
last-changed : Admin
default-vui : Default Admin View
num-vuis : 1
export-version : 12
schema-type : 1
next-field-id : 536870912
permission : 0\2
object-prop : 4\60006\4\0\\60008\40\0\60009\4\0\\60010\4\0\\
vui {
id : 536870912
name : Default Admin View
label : Default Admin View
timestamp : 1399992125
vui-locale :
vui-type : 1
owner : Demo
last-changed : Admin
display-prop : 7\20\4\18\Default Admin
View\201\2\113610\202\2\60000\264\6\0\272\6\0\318\2\0\60019\4\21\ViewWebAlias536870912\
}
field {
id : 1
name : Request ID
datatype : 4
fieldtype : 1
create-mode : 1
option : 3
timestamp : 1399988954
owner : Admin
last-changed : Admin
length-units : 0
maxlength : 15
clob-store-opt : 0
menu-style : 2
qbe-match-op : 2
fulltext-optns : 0
default : SCT-
permission : 0\2
display-instance :
536870912\19\3\41\2\562\1000\14060\4500\4\6\1\7\40\2147483638\20\4\6\SCT
ID\21\41\2\0\0\13275\1300\27\8\2\28\6\4\29\6\1\60\40\1\61\40\22\65\41\2\0\0\0\0\66\4&
display-instance :
1\2\0\0\0\0\90\6\1\91\6\4\143\40\4294967295\151\41\2\0\1400\13500\3500\170\40\0\231\6\0\310\6\0\
help-text : <meta name="window size" content="Small" />This field
contains the unique identifier for this entry.
}
field {
id : 2
name : Submitter
datatype : 4
fieldtype : 1
create-mode : 1
option : 1
timestamp : 1399992140
owner : Admin
last-changed : Admin
length-units : 0
maxlength : 254
clob-store-opt : 0
menu-style : 2
qbe-match-op : 2
fulltext-optns : 0
default : $-1$
permission : 0\2
display-instance :
536870912\20\3\41\2\562\5000\19684\8500\4\6\1\7\40\2147483640\20\4\9\Submitter\21\41\2\0\0\19575\1300\22\4\6\System\27\8\2\28\6\4\29\6\1\60\40\1\61\40\32\65\&
display-instance :
41\2\0\0\0\0\66\41\2\0\0\0\0\90\6\1\91\6\4\143\40\4294967295\151\41\2\0\1400\19125\3500\170\40\0\231\6\1\310\6\0\
help-text : <meta name="window size" content="Small" />This field
contains the Remedy user id of the person who created this entry.
}
field {
id : 3
name : Create Date
datatype : 7
fieldtype : 1
create-mode : 1
option : 3
timestamp : 1399992140
owner : Admin
last-changed : Admin
permission : 0\2
display-instance :
536870912\19\3\41\2\20809\5000\39931\8500\4\6\1\7\40\2147483641\20\4\11\Create
Date\21\41\2\0\0\18900\1300\27\8\2\28\6\4\29\6\1\60\40\1\61\40\32\65\41\2\0\0\&
display-instance :
0\0\66\41\2\0\0\0\0\90\6\1\91\6\4\143\40\4294967295\151\41\2\0\1400\19125\3500\170\40\0\231\6\1\310\6\0\
help-text : <meta name="window size" content="Small" />This field
contains the date and time when this entry was created.
}
field {
id : 4
name : Assigned To
datatype : 4
fieldtype : 1
create-mode : 1
option : 2
timestamp : 1399988954
owner : Admin
last-changed : Admin
length-units : 0
maxlength : 254
clob-store-opt : 0
menu-style : 2
qbe-match-op : 1
fulltext-optns : 0
permission : 0\2
display-instance :
536870912\20\3\41\2\52868\1000\64116\4500\4\6\1\5\6\2\7\40\2147483702\14\40\1\20\4\11\Assigned
To\21\41\2\0\0\11248\1300\27\8\2\60\40\1\66\41\2\0\0\0\0\91\6\&
display-instance :
4\143\40\4294967295\151\41\2\0\1400\11248\3500\170\40\0\231\6\1\288\6\0\289\4\4\0x00\290\4\4\0x00\310\6\0\5116\6\0\
}
field {
id : 5
name : Last Modified By
datatype : 4
fieldtype : 1
create-mode : 1
option : 3
timestamp : 1399992140
owner : Admin
last-changed : Admin
length-units : 0
maxlength : 254
clob-store-opt : 0
menu-style : 2
qbe-match-op : 2
fulltext-optns : 0
permission : 0\2
display-instance :
536870912\19\3\41\2\41057\5000\60179\8500\4\6\1\7\40\2147483642\20\4\16\Last
Modified
By\21\41\2\0\0\18787\1300\27\8\2\28\6\4\29\6\1\60\40\1\61\40\32\65\41\2&
display-instance :
\0\0\0\0\66\41\2\0\0\0\0\90\6\1\91\6\4\143\40\4294967295\151\41\2\0\1400\19125\3500\170\40\0\231\6\1\310\6\0\
help-text : <meta name="window size" content="Small" />This field
contains the Remedy user id of the person who last updated this entry.
}
field {
id : 6
name : Modified Date
datatype : 7
fieldtype : 1
create-mode : 1
option : 3
timestamp : 1399992140
owner : Admin
last-changed : Admin
permission : 0\2
display-instance :
536870912\19\3\41\2\61304\5000\80426\8500\4\6\1\7\40\2147483643\20\4\13\Modified
Date\21\41\2\0\0\19237\1300\27\8\2\28\6\4\29\6\1\60\40\1\61\40\32\65\41\2\0\&
display-instance :
0\0\0\66\41\2\0\0\0\0\90\6\1\91\6\4\143\40\4294967295\151\41\2\0\1400\19125\3500\170\40\0\231\6\1\310\6\0\
help-text : <meta name="window size" content="Small" />This field
contains the date and time when this entry was last modified.
}
field {
id : 7
name : Status
datatype : 6
fieldtype : 1
create-mode : 1
option : 1
timestamp : 1399988954
owner : Admin
last-changed : Admin
enum-value : Active
enum-value : Inactive
default : 0
permission : 0\2
display-instance :
536870912\22\3\41\2\14623\1000\22497\4500\4\6\1\7\40\2147483644\20\4\6\Status\21\41\2\0\0\7875\1300\27\8\2\28\6\4\29\6\1\60\40\1\61\40\0\62\6\0\64\6\0\65\41\&
display-instance :
2\0\0\0\0\66\41\2\0\0\0\0\90\6\1\91\6\4\143\40\4294967295\151\41\2\0\1400\7874\3500\170\40\0\230\4\21\2\0\Active\1\Inactive\231\6\0\310\6\0\
help-text : <meta name="window size" content="Small" />This field
contains the current status of this entry.
}
field {
id : 8
name : Short Description
datatype : 4
fieldtype : 1
create-mode : 1
option : 1
timestamp : 1399988954
owner : Admin
last-changed : Admin
length-units : 0
maxlength : 254
clob-store-opt : 0
menu-style : 2
qbe-match-op : 2
fulltext-optns : 0
default : a
permission : 0\2
display-instance :
536870912\19\3\41\2\23059\1000\52305\4500\4\6\1\7\40\2147483645\20\4\17\Short
Description\21\41\2\0\0\29250\1300\27\8\2\28\6\4\29\6\1\60\40\1\61\40\50\65\41\&
display-instance :
2\0\0\0\0\66\41\2\0\0\0\0\90\6\1\91\6\4\143\40\4294967295\151\41\2\0\1400\29250\3500\170\40\0\231\6\1\310\6\0\
}
field {
id : 15
name : Status History
datatype : 4
fieldtype : 1
create-mode : 2
option : 3
timestamp : 1377625512
owner : Admin
last-changed : Admin
permission : 3\1
permission : 4\1
}
field {
id : 536870913
name : Regular
datatype : 4
fieldtype : 1
create-mode : 1
option : 2
timestamp : 1399988954
owner : Admin
last-changed : Admin
length-units : 0
maxlength : 255
clob-store-opt : 0
menu-style : 2
qbe-match-op : 2
fulltext-optns : 0
permission : 0\2
display-instance :
536870912\20\3\41\2\562\11000\18672\14500\4\6\1\5\6\2\7\40\2147483710\14\40\1\20\4\7\Regular\21\41\2\0\0\18110\1300\27\8\2\60\40\1\66\41\2\15748\1400\18110\3&
display-instance :
500\91\6\4\143\40\4294967295\151\41\2\0\1400\15185\3500\170\40\0\231\6\0\288\6\0\289\4\4\0x00\290\4\4\0x00\310\6\0\5116\6\0\
}
field {
id : 536870915
name : Display
datatype : 4
fieldtype : 1
create-mode : 1
option : 4
timestamp : 1399993611
owner : Admin
last-changed : Admin
length-units : 0
maxlength : 255
clob-store-opt : 0
menu-style : 2
qbe-match-op : 2
fulltext-optns : 0
permission : 0\2
display-instance :
536870912\20\3\41\2\20809\11000\38919\14500\4\6\1\5\6\2\7\40\2147483711\14\40\1\20\4\7\Display\21\41\2\0\0\18110\1300\27\8\2\60\40\1\66\41\2\15748\1400\18110&
display-instance :
\3500\91\6\4\143\40\4294967295\151\41\2\0\1400\15185\3500\170\40\0\231\6\0\288\6\0\289\4\4\0x00\290\4\4\0x00\310\6\0\5116\6\0\
}
end
begin filter
name : Test6:100OnSubmitModify: 'TR.Regular' != 'DB.Regular'
timestamp : 1399992970
owner : Admin
last-changed : Admin
filter-op : 6
enable : 1
filter-order : 100
wk-conn-type : 1
schema-name : Test6
export-version : 12
filter-query : 4\6\50\536870913\51\536870913\
action {
message-type: 0
message-num : 10000
message-text: 100: 'TR.Regular' != 'DB.Regular'
}
errhandler-opt : 0
end
begin filter
name : Test6:110OnSubmitModify: 'TR.Regular' != 'Regular'
timestamp : 1399992970
owner : Admin
last-changed : Admin
filter-op : 6
enable : 1
filter-order : 110
wk-conn-type : 1
schema-name : Test6
export-version : 12
filter-query : 4\6\50\536870913\99\536870913\
action {
message-type: 0
message-num : 10000
message-text: 110: 'TR.Regular' != 'Regular'
}
errhandler-opt : 0
end
begin filter
name : Test6:120OnSubmitModify: 'Regular' != 'DB.Regular'
timestamp : 1399992970
owner : Admin
last-changed : Admin
filter-op : 6
enable : 1
filter-order : 120
wk-conn-type : 1
schema-name : Test6
export-version : 12
filter-query : 4\6\99\536870913\51\536870913\
action {
message-type: 0
message-num : 10000
message-text: 120: 'Regular' != 'DB.Regular'
}
errhandler-opt : 0
end
begin filter
name : Test6:150OnSubmitModify: SetRegularToHello
timestamp : 1399992970
owner : Admin
last-changed : Admin
filter-op : 6
enable : 1
filter-order : 150
wk-conn-type : 1
schema-name : Test6
export-version : 12
action {
set-field : 0\536870913\101\4\5\Hello\
}
errhandler-opt : 0
end
begin filter
name : Test6:200OnSubmitModify: 'TR.Regular' != 'DB.Regular'
timestamp : 1399992970
owner : Admin
last-changed : Admin
filter-op : 6
enable : 1
filter-order : 200
wk-conn-type : 1
schema-name : Test6
export-version : 12
filter-query : 4\6\50\536870913\51\536870913\
action {
message-type: 0
message-num : 10000
message-text: 200: 'TR.Regular' != 'DB.Regular'
}
errhandler-opt : 0
end
begin filter
name : Test6:210OnSubmitModify: 'TR.Regular' != 'Regular'
timestamp : 1399992970
owner : Admin
last-changed : Admin
filter-op : 6
enable : 1
filter-order : 210
wk-conn-type : 1
schema-name : Test6
export-version : 12
filter-query : 4\6\50\536870913\99\536870913\
action {
message-type: 0
message-num : 10000
message-text: 210: 'TR.Regular' != 'Regular'
}
errhandler-opt : 0
end
begin filter
name : Test6:220OnSubmitModify: 'Regular' != 'DB.Regular'
timestamp : 1399992970
owner : Admin
last-changed : Admin
filter-op : 6
enable : 1
filter-order : 220
wk-conn-type : 1
schema-name : Test6
export-version : 12
filter-query : 4\6\99\536870913\51\536870913\
action {
message-type: 0
message-num : 10000
message-text: 220: 'Regular' != 'DB.Regular'
}
errhandler-opt : 0
end
begin filter
name : Test6:300OnSubmitModify: 'TR.Display' != 'DB.Display'
timestamp : 1399992970
owner : Admin
last-changed : Admin
filter-op : 6
enable : 1
filter-order : 300
wk-conn-type : 1
schema-name : Test6
export-version : 12
filter-query : 4\6\50\536870915\51\536870915\
action {
message-type: 0
message-num : 10000
message-text: 300: 'TR.Display' != 'DB.Display'
}
errhandler-opt : 0
end
begin filter
name : Test6:310OnSubmitModify: 'TR.Display' != 'Display'
timestamp : 1399992970
owner : Admin
last-changed : Admin
filter-op : 6
enable : 1
filter-order : 310
wk-conn-type : 1
schema-name : Test6
export-version : 12
filter-query : 4\6\50\536870915\99\536870915\
action {
message-type: 0
message-num : 10000
message-text: 310: 'TR.Display' != 'Display'
}
errhandler-opt : 0
end
begin filter
name : Test6:320OnSubmitModify: 'Display' != 'DB.Display'
timestamp : 1399992970
owner : Admin
last-changed : Admin
filter-op : 6
enable : 1
filter-order : 320
wk-conn-type : 1
schema-name : Test6
export-version : 12
filter-query : 4\6\99\536870915\51\536870915\
action {
message-type: 0
message-num : 10000
message-text: 320: 'Display' != 'DB.Display'
}
errhandler-opt : 0
end
begin filter
name : Test6:350OnSubmitModify: SetDisplayToHello
timestamp : 1399992970
owner : Admin
last-changed : Admin
filter-op : 6
enable : 1
filter-order : 350
wk-conn-type : 1
schema-name : Test6
export-version : 12
action {
set-field : 0\536870915\101\4\5\Hello\
}
errhandler-opt : 0
end
begin filter
name : Test6:400OnSubmitModify: 'TR.Display' != 'DB.Display'
timestamp : 1399992970
owner : Admin
last-changed : Admin
filter-op : 6
enable : 1
filter-order : 400
wk-conn-type : 1
schema-name : Test6
export-version : 12
filter-query : 4\6\50\536870915\51\536870915\
action {
message-type: 0
message-num : 10000
message-text: 400: 'TR.Display' != 'DB.Display'
}
errhandler-opt : 0
end
begin filter
name : Test6:410OnSubmitModify: 'TR.Display' != 'Display'
timestamp : 1399992970
owner : Admin
last-changed : Admin
filter-op : 6
enable : 1
filter-order : 410
wk-conn-type : 1
schema-name : Test6
export-version : 12
filter-query : 4\6\50\536870915\99\536870915\
action {
message-type: 0
message-num : 10000
message-text: 410: 'TR.Display' != 'Display'
}
errhandler-opt : 0
end
begin filter
name : Test6:420OnSubmitModify: 'Display' != 'DB.Display'
timestamp : 1399992970
owner : Admin
last-changed : Admin
filter-op : 6
enable : 1
filter-order : 420
wk-conn-type : 1
schema-name : Test6
export-version : 12
filter-query : 4\6\99\536870915\51\536870915\
action {
message-type: 0
message-num : 10000
message-text: 420: 'Display' != 'DB.Display'
}
errhandler-opt : 0
end
_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
"Where the Answers Are, and have been for 20 years"