How to assign credit hours to user account once the content is marked completed by admin I have a custom content type "course" and it has an entity reference to username. ( the username is basically an instructor who is suppose to teach the course )

I have created a field "Course Completed" in course content type and admin changes it to "completed" manually. The content type also has a filed "Number of hours"

What i need is, when the node is marked as completed, the "Number of hours" is taken from node and added  to user account.  ( i can create a field using profile2 and name it as "user credit hours")

How would i do this? is there any module which will work similar to what is needed  ?

thanks
i managed to do it with rules and adding some action code in a custom module.



After adding a condition, i had a make a custom action and then i was able to add that action in to the created rule.

You can send value to your custom action and then load user and update its field.

$user = user_load($user_trainer_id);
$obj = entity_metadata_wrapper('user', $user);
$obj-&gt;field_earned_credit_hours = $new_custom_value;
$obj-&gt;save();