How to programmatically set the status code field of a Dynamic entity