Transcript:
0:02 hello everyone in this video I'm going
0:04 to demonstrate how to debug a trace log
0:06 in North52 we'll start with a sample
0:09 multi- sheet decision table doing some
0:12 basic calculations and then we will
0:14 review the trace
0:19 log first however there's some basic
0:21 information to discuss North52 tracing
0:25 has two primary purposes information
0:28 reporting what the formula did and why
0:31 and information logs are generated every
0:34 time a North52 formula complete
0:36 successfully and then ER reporting what
0:39 the formula did and what went
0:45 wrong tracing can also be turned on
0:48 local to a specific formula or globally
0:52 on the North52 configuration record and
0:54 that will enable tracing on all
0:57 formulas Please be aware that local and
0:59 Global Trac in are independent of each
1:01 other meaning that if you have local
1:04 tracing turned on a formula and Global
1:06 tracing turned on then you will see two
1:09 instances of the trace log it is
1:12 important to understand that the formula
1:14 did not execute twice it was simply
1:16 logged
1:19 twice this is our sample decision table
1:23 its purpose is to carry out some basic
1:25 tax calculations on an employee
1:28 salary it first checks that we have a
1:30 value for gross salary and Taxation
1:38 type then we determine what the taxable
1:41 salary is this is gross salary minus
1:44 pre-tax
1:46 deductions these reduce the amount of
1:48 salary that can be taxed and in this
1:50 case we are only accounting for pension
1:56 contributions next we determine what the
1:58 cut off point for the higher rate of
2:00 taxes for the salary this is based on
2:02 the relationship marriage or civil
2:04 partner status
2:09 Etc if the taxable salary is greater
2:11 than the cutoff point we apply the 20%
2:14 standard rate tax to the cut off amount
2:17 otherwise we apply the 20% rate to the
2:20 entire taxable
2:23 salary next we check if the taxable
2:26 salary is greater than the cut off
2:28 amount and if yes we apply the 40% tax
2:31 rate to everything above the cutof point
2:34 and if the taxable salary is not greater
2:36 than the cutof point we set a zero value
2:38 for the higher rate tax
2:42 amount we then add the standard tax
2:45 amount and the higher tax amount
2:46 together and deduct any tax
2:49 allowances and finally we update the net
2:53 salary and the total tax payment fields
2:55 on the contact
2:58 record
3:02 this is our test contact Robert Stanton
3:05 he has an income of ? 100,000 is a
3:08 single person and has ?12,000 in pension
3:12 contributions he further has ?2,500 in
3:15 tax Alles and ?75,000 in tax
3:23 credits when we click save we can see
3:25 that an error has occurred this is part
3:28 of the error reporting
3:30 we download the log and open it as we
3:34 scroll through the trace log we can see
3:36 each decision sheet starting the row is
3:39 being completed the functions on that
3:41 row and the decision sheet
3:47 ending we can clearly see the validation
3:50 sheet is passed as it does not contain
3:52 data for both of those test returns
3:55 false here we can see that the taxable
3:57 salary is calculated at
4:01 88,000 and the cut off rate is set to
4:10 42,000 the standard rate tax amount is
4:12 calculated at
4:15 8,400 and the higher tax amount is
4:17 computed at ?1
4:24 18,400 however here on the combined tax
4:27 decision sheet we can see something odd
4:30 the higher tax rate amount is a question
4:32 mark this is the North52 representation
4:35 for a null
4:37 value this gets added to the standard
4:39 rate amount giving us a string value of
4:42 question mark
4:48 84 on the tax credit deduction sheet the
4:52 error recurs and roll
4:58 four
5:01 when we review the higher tax rate
5:03 decision sheet we can see that the
5:05 calculated amount is named higher tax
5:08 higher rate tax due but in the combined
5:11 tax amount calculation it is using
5:14 higher rate tax amount a different name
5:18 so we can delete this add the correct
5:21 inline calcul name and then save and
5:23 publish the
5:28 formula now when we save the record we
5:31 can see that the formula has executed
5:33 successfully and calculated both the net
5:36 pay and the tax
5:41 payment while this is functional now we
5:44 can make some changes to test our
5:46 record what would be the outcome if
5:49 Robert's pension contribution was
5:50 increased to
5:53 177,000 while this gives us an output on
5:55 the record what if I want to see exactly
5:57 what the formula is doing
6:00 since tracing is set the information on
6:02 the North52 configuration record we can
6:04 simply open the formula and click on the
6:07 test and Trace button here this opens
6:10 the test and Trace
6:13 console by default the test and Trace
6:15 console loads with the most recent
6:17 version of the trace log included and we
6:20 can manually refresh it from the load
6:21 Trace button if you want to this is
6:24 useful when we are testing the records
6:26 repeatedly and want to get the most
6:28 recent Trace log
6:30 we can switch between full and basic
6:32 views the full view shows additional
6:35 information outside of the formal
6:38 execution for example plug-in execution
6:42 context here under quick links you can
6:45 navigate directly to specific sheets in
6:47 a formula this is helpful for
6:49 troubleshooting specific sheets
6:52 quickly this is also broken up a
6:56 formula if there are multiple formulas
6:59 executing sequentially in synchronous
7:02 transaction then the trace logs for each
7:04 formula will include the trace logs for
7:07 the previous formulas in the execution
7:09 chain for example formulas a b and c
7:13 will
7:13 trigger a will go first Formula B will
7:17 have the trace log for formula a and
7:19 formula B and formula c will have the
7:21 trace logs for formulas a b and c
7:23 included in
7:28 it
7:30 import file allows you to import a trace
7:33 log into the test and Trace console if
7:35 you want to manually review yourself
7:38 this is extremely useful when you have a
7:39 complex Trace file for example uh from
7:42 an error and you want to review what's
7:48 happened the trace level option allows
7:51 you to set the global Trace level either
7:53 to information which will generate a
7:55 trace log each time a formula has
7:57 successfully executed information show
8:00 exception details which is useful for
8:02 troubleshooting nested exceptions from
8:04 further on down the execution pipeline
8:07 or to Simply turn off Global
8:13 tracing you can also run bulk delete
8:16 jobs here that will delete all North52
8:18 Trace logs in the system or simply the
8:21 trace logs that have just been generated
8:22 today this is useful when you are
8:24 testing changes to your formula I want
8:26 to view only the relevant Trace logs in
8:28 your system
8:34 here in the full view we can see
8:36 information like the user ID that ran
8:39 the formula the message name update
8:42 create delete Etc the stage the formul
8:45 rant 10 for pre-validation 20 for
8:49 pre-operation and 40 for
8:51 postoperation you can also view the
8:53 depth that the formula ran at here
8:56 Microsoft uses depth to control infinite
8:58 loops a maximum depth of 16 is permitted
9:01 in online instances of
9:06 Dynamics you can see the input
9:08 parameters that actually changed trigger
9:10 the formula in this case you can see the
9:13 change was recorded on the pension
9:15 contribution and you can see the initial
9:17 formula
9:18 context here two formula short codes are
9:21 listed six CV and five
9:25 fi however only six CV is marked in as
9:29 true true this means that the formula
9:32 will execute while 5 fi is marked as
9:36 true false so it will not execute this
9:39 is a useful way to determine which
9:41 formulas have executed and which haven't
9:44 if you have complex Logics with many
9:45 formulas on the same
9:48 entity you can also see the entity trace
9:51 for the contact record these are values
9:54 that North52 has brought into the formula
9:56 from the contact record they are needed
9:59 to perform the necessary
10:01 calculations here we have taxation type
10:04 both in primitive type which is the
10:06 option set value and then the formatted
10:08 value which is this the display name of
10:10 the option set
10:16 value line 100 confirms that only one
10:19 formula will execute and then we get
10:21 into the actual execution of the formula
10:24 6 CV you can see the final formula
10:27 description this is what the decision
10:29 table looks like in the classic style
10:35 Logic on line
10:37 133 you see Start Formula execution 6 CV
10:42 everything before this point was the
10:44 Preamble but from here we can see the
10:46 actual formula starting to execute we
10:49 see the name of the decision sheet that
10:51 is starting we see the row number and
10:54 then the output of the functions on that
10:56 row here we are running two does not
10:58 contain data functions and we can see
11:01 their output is
11:06 false in North52 Trace logs each
11:10 decision sheet has a clear starting
11:11 point then all the roles will execute
11:14 and the functions on them and then a
11:16 clear end
11:22 point here on the update record decision
11:24 sheet we can see the two attributes
11:27 being set net and total tax payment we
11:31 can also see the output of the update
11:33 record function on line 221 we can see
11:38 that an update was completed against the
11:40 contact record and the good of the
11:42 record that was
11:47 updated finally at the end of the trace
11:49 log we can see information about the
11:52 formula
11:53 itself you can see it short code The
11:57 Source entry name in this case contact
12:01 and the source entty properties these
12:03 are the triggers for the
12:10 formula thank you for watching as always
12:13 if you have any questions please contact
12:15 support ATN52.com or visit support.
12:19 52.com
