Create Vendor with existing employee name for GAB

Hi All,

I’ve written code to automatically create a vendor from an employee.

Problem I’m getting is that when I create the vendor, it is creating a new entry in the Global Address Book. Instead I want it to use the Global Address Name of the employee (so if then employee name gets updated, so does the vendor).

At the moment my code simply says : vendor.name = employee.name. This is what creates a new line in the GAB.

Does anybody know how to (in X++) say “use the employee name, don’t create a new one”. The entry is stored in the DirPartyTable.

Regards,

Anthony

when ever you create an employee, vendor, customer the system will create an Address Book Id.

So when you creating a vendor from employee the system will create an address book id for vendor even.

The address book id is mandatory for creating the vendor - you cannot have same address book id for a vendor and employee.

Hi thanks.

I’ve solved my problem. You can assign a vendor the same GAB as an employee. You need to set the vendor.partyID = EmplTable.partyId. This means if you update the employee name, the vendor also gets updated.