Thanks Enrico, I was so focused on my end of code and I didn't notice the wrong JSON that my client is sending, but BTW my client is running Ensemble 2014 and Set dynOBJ={}.%FromJSON(pInput) is raising an error maybe this is one of the latest versions Set dynOBJ = ##class(%Object).%FromJSON(pInput) doesn't raise errors so will try that ?
but in this case does my client need to send with Get or Post action?


    
 
Thanks 

Sorry Ashok this code didn't work, my globals could set at all maybe because in the code it's locked before been set, will put some traces and see where it's stopping

tstart if staten["IUDX" { lock +^IudexNqlInByte(1):0 if $test{ set IudexNqlInByte(1,inc)=obj.%Id() lock -^IudexNqlInByte(1) } } else { lock +^ToshibaNQLIn(1):0 if $test { set ^ToshibaNQLIn(1,inc)=obj.%Id() lock -^ToshibaNQLIn(1) } } tcommit   

Thanks Julius I found the problem, the reason why the directory couldn't be removed because the command before was holding it because it's deleting a file inside the directory the last command is trying to do.

so  ##class(%File).Delete(FileZip) is deleting a file inside the directory "FileUnZip"  (##class(%File).RemoveDirectoryTree(FileUnZip))

I've removed the first call and now the second is execute Ok 

Thanks