I am very new to Drupal and trying to write a module. I have 2 entities - Membership and MembershipRequest and both are fieldable. A MembershipRequest is a request to the admin of the website to create or update (renew/delete) a Membership entity. On the MembeshipRequest form, I want to populate the form elements with Membership entity values that user are requesting to update. For example, on the request form's First name text box, I want to populate the Membership's First name. I have membership_id property in the the request entity. But the First name and other fields are attached to both entities via Field API.
I am not sure which object (and how) - $form, $form_state, $request - I need to modify so that the request form will show up with populated values.
Thanks a lot.