Add values to an existing custom entity bundle I've created a custom entity with bundle and added 3 fields to the bundle(namely recipient, sender, flag). How can I add values to it programmatically.
Any help would be appreciated.

Thanks
One approach is using entity_metadata_wrapper:


  The Entity API provides wrapper classes you may use to make dealing with the values of an entity's properties and fields easier.
  Wrappers make it easier to get and set the values of fields and
  properties as well as to programmatically retrieve additional
  information about these elements and iterate over lists of values in a
  consistent manner.


Example:

$entity_wrapper = entity_metadata_wrapper('myentity', $id);
$var = $entity_wrapper-&gt;field_flag-&gt;value() + 1;
$entity_wrapper-&gt;field_flag-&gt;set($var);
$entity_wrapper-&gt;save();