I edited the class : AxaptaUserManager in method currentUserId().
My edited code :
public static str currentUserId()
{
str userSingle;
;
userSingle = 'azn03';
return userSingle;
}
I put method above for range in my query :
Exportfile for AOT version 1.0 or later
Formatversion: 1
***Element: QUE
; Microsoft Dynamics AX Query: ABU_HCMWorker03 unloaded
; --------------------------------------------------------------------------
VERSION 31
QUERY #ABU_HCMWorker03
PROPERTIES
Name #ABU_HCMWorker03
Version #29
NextUniqueId #1003
Origin #{DC53FD0D-7322-447E-8393-3FCA091A6CE1}
ENDPROPERTIES
METHODS
SOURCE #classDeclaration
#public class QueryRun extends ObjectRun
#{
#}
ENDSOURCE
ENDMETHODS
BLOCKS
BLOCK #HcmWorker
PROPERTIES
Name #HcmWorker_1
Table #HcmWorker
UniqueId #1000
FetchMode #1:1
ENDPROPERTIES
FIELDLIST
PROPERTIES
Dynamic #Unselected
ENDPROPERTIES
ENDFIELDLIST
SORTING
ENDSORTING
LINES
ENDLINES
BLOCKS
BLOCK #DirPerson
PROPERTIES
Name #DirPerson_1
Table #DirPerson
UniqueId #1001
FetchMode #1:1
Relations #Yes
ENDPROPERTIES
FIELDLIST
PROPERTIES
ENDPROPERTIES
ENDFIELDLIST
SORTING
ENDSORTING
LINES
ENDLINES
BLOCKS
BLOCK #DirPersonUser
PROPERTIES
Name #DirPersonUser_1
Table #DirPersonUser
UniqueId #1002
FetchMode #1:1
Relations #Yes
ENDPROPERTIES
FIELDLIST
PROPERTIES
Dynamic #Unselected
ENDPROPERTIES
ENDFIELDLIST
SORTING
ENDSORTING
LINES
LINE #User
PROPERTIES
Name #User
Table #DirPersonUser
Field #User
Value #(currentUserId())
ENDPROPERTIES
ENDLINES
BLOCKS
ENDBLOCKS
ASSOCIATIONS
ASSOCIATION
FOREIGNKEYRELATION #DirPerson
ENDASSOCIATIONS
ENDBLOCK
ENDBLOCKS
ASSOCIATIONS
ASSOCIATION
FOREIGNKEYRELATION #DirPerson
ENDASSOCIATIONS
ENDBLOCK
ENDBLOCKS
GROUPBY
ENDGROUPBY
HAVING
ENDHAVING
ORDERBY
ENDORDERBY
ENDBLOCK
ENDBLOCKS
DEPENDENTS
ENDDEPENDENTS
COMPOSITEQUERIES
ENDCOMPOSITEQUERIES
ENDQUERY
***Element: END
Then, i create policy which connect query and role :
Last, i add one user to 'TradeSalesRepresentative'.
The result is not as expected, in form SalesTable shows all sales order from all salesman. My purpose is filter sales order in SalesTable form. Is there anything wrong in my step ?
