Get Bean for Custom Module not workin

First I will give the short version:

$vnd = BeanFactory::getBean(‘vnd_Vendors’)->retrieve_by_string_fields(array(‘name’=>$bean->vnd_vendors_po_purchase_orders_1_name));
Returns an error stating that: The Class vnd_Vendors is not found. I have tried every iteration of this. vnd_vendors, vendors, Vendors, etc.

Long version.

Module po_purchase_orders has a One to Many relationship with Module vnd_vendors
One Vendor Many Purchase Orders

Purchase Order has a relate field with Vendors. The Sub Panel of Purchase Orders in Vendors never shows any Purchase Orders. (Shouldn’t this be automatic?)

I thought using a logic hook to create the relationship would work. But the line of code keeps telling me that there is no Class (Do they mean module?) called vnd_Vendors.

I was successful in doing this with stock modules but not with custom modules.

What am I doing wrong?

 function relateVendor($bean, $event, $arguments){
       
        if (!empty($bean->vnd_vendors_po_purchase_orders_1_name)){


            $vnd = BeanFactory::getBean('vnd_Vendors')->retrieve_by_string_fields(array('name'=>$bean->vnd_vendors_po_purchase_orders_1_name));
            $id = $vnd->id;

            $GLOBALS['log']->error($ven);

            $bean->load_relationship('vnd_vendors_po_purchase_orders_1');
            $bean->accounts->add($id);  

        }
    }

On further inspection, the table in the database is getting filled without my code due to the One To Many relationship but why is it not showing up in the subpanel???

Yes I have done a relationship rebuild and an r&r

Hello @johnwreford

Have you fixed this?
Is this a custom PO module you’ve built since SuiteCRM does not have a native PO module?

I’ll be very keen to hear from you.
Kindest