use toLong()
instead, the identifier is now simply a wrapper around the long value (as far as the outside world is concerned)
Edit: I have updated the documentation at https://world.mendix.com/display/refguide4/Moving+from+3+to+4 to reflect these changes.