Index: vhMAIL.mac.rou =================================================================== diff -u -r1620 -r1632 --- vhMAIL.mac.rou (.../vhMAIL.mac.rou) (revision 1620) +++ vhMAIL.mac.rou (.../vhMAIL.mac.rou) (revision 1632) @@ -256,6 +256,14 @@ New I,R,MailId,Count,FArchTyp,LArchTyp,IndexTyp,UserIds Set Sort=$G(Sort) Quit:'$$IsGroep^vhUSER(CUserId,"BOEKH") + If '$L(Sort) Do + .Set IndexTyp="N" + .Set Sort=$G(@("^vhMAIL(""I"_IndexTyp_""",CUserId)")) + .Set:'$L(Sort) Sort=$G(@("^vhMAIL(""IR"",CUserId)")) + Set SortTyp=Sort + Set IndexTyp="N" + Set:'$D(^vhMAIL("IN",CUserId)) IndexTyp="" + If $L(Sort),$L(IndexTyp) For I=1:1:$L(IndexTyp) Set @("^vhMAIL(""I"_$E(IndexTyp,I)_""",CUserId)")=$S(Sort="G":"",1:Sort) Do CLEAN Set Count=0 Set UserIds=$$USERID^vhUSER("BOEKH") @@ -264,10 +272,6 @@ .If '$L(Sort) Do ..Set Sort=$G(^vhMAIL("IN",CUserId)) ..Set:$L(Sort) Sort=$G(@("^vhMAIL(""IR"",CUserId)")) - .Set SortTyp=Sort - .Set IndexTyp="N" - .Set:'$D(^vhMAIL("IN",CUserId)) IndexTyp="" - .If $L(Sort),$L(IndexTyp) For I=1:1:$L(IndexTyp) Set @("^vhMAIL(""I"_$E(IndexTyp,I)_""",CUserId)")=$S(Sort="G":"",1:Sort) .Set MailTyp="N" .Set MailId="" .For Set MailId=$O(^vhMAIL("IN",CUserId,MailId)) Quit:MailId="" Do