Get the assigned_user_id from realte field with bean

Hello guys, how are you?
I’ve the following code:


if (! empty($bean)) {
			global $current_user, $app_list_strings;
			$bean->j_pbd_c = ($bean->price - $bean->cost) * 100 / $bean->price;
			if ($current_user->j_tipo_utente_c == 2) { [...]

This is about managing e quote’s line of products.
I want to keep as a variable not the $current_user (that is the user logged in), but i want to keep the assigned_user_id of the quote (that could be different one).

i think that $bean->parent_id->assigned_user_id->vendor_code could be wrong, but how can i do?
thank you again!

Hi,
There are different possibilities. You are on which view? on line item view? or any detail page? or in a popup?
If you know how to code then no worries. I will guide you Through.
Just a generic Hint which will work in all the cases.
To get Assigned User ID of a Product you have to run a Query

$query= “SELECT assigned_user_id FROM aos_products WHERE id=’$bean->parent_id’”
$assigned_user_id= $GLOBALS[‘db’]->getOne($query);

That’s it.