Have a look at the getGUID action in the Community Commons module. This will return the GUID / Id of an object.
I hope this helps.