Tuesday, September 26, 2017

Debugging Tips:

Debugging Tips:

1) Info (Class) -> Add (Method)
2) Xsession::xppcallstack()  ----> To get stack information
 Ex:   con2str(Xsession::xppcallstack())
3) Securityutill::sysAdminMode(false);  ---> Debugging as a non Admin Role
 For Exclude User permission again, Execute code again Securityutill::sysAdminMode(True)

Invaluable when stuck deep in a debugging session, and want to verify that the sql Statements being executed has the intended behavior;

Job:

Static void SS_jobtest(Args _agrs)
{
SWealthTable sWealthTable;
;
ttsbegin;
select forupdate sWealthTable
where sWealthTable.id == "1005";
sWealthTable.GroupId = "EDX";
sWealthTable.update();

breakpoint;

ttscommit;
}

Before Committing Transaction Query

SQL Query 1: 

select Id,GroupId from SWealthTable
 where Id = '1005'

result would
Id - 1005
GroupId - MDX

SQL Query 2 :

select Id,GroupId from SWealthTable (noLock)
 where Id = '1005'

result would
Id - 1005
GroupId - EDX

No comments:

Post a Comment

Copy Markup charges while posting purchase invoice using X++

 Copy Markup charges while posting purchase invoice using X++ Class: Important: Code logic is just for Reference.  New class => Duplicate...