I have two different profile2 type those are 'main' and 'nilaiku' and have a couple of fields inside of each profile2 type i want to every i update field in 'main' type will automatically generate or change the value of field in 'nilaiku' prfofile2 type ?? i have some code but not work !

function formid_profile2_update($profile) {

global $user; //is the current user

$profile = profile2_load_by_user($user->uid, $type_name = 'nilaiku');
$profile ->field_uas[LANGUAGE_NONE][0]['value'] = 4447;
//drupal_set_message ($user->uid);

field_attach_update('profile2', $profile);

}

it will be working fine if we put specific uid in profile2_load_by_user() into first parameter but thats not what i need.

thanks in advance :)

Comments

imunk created an issue. See original summary.

rickj’s picture

Status: Active » Closed (outdated)