Full Question:
I encountered a situation where I need to link an existing catalog with vendorRef=null to a vendor and am looking for some guidance. I am considering an approach of copying the catalog along with the related categories, products, and relationships between them. However, the catalog already contains a large number of relations in our database and I am concerned that something might be missed during the copying process. Is it possible to instead update the vendorRef field for the catalog? What steps would you recommend to achieve this?
Answer:
In our documentation regarding marketplace concepts the catalog.vendorRef field is immutable after creation for security and consistency purposes. The reasoning for this is because in the marketplace context, the vendorRef reference is propagated to a number of related, supporting tables.
If you only need to include a reference to a Vendor on the Catalog, you can safely update this value so it is no longer null in it’s entry.
However, if your requirements extend to the following, then you’ll need to do more work.
- External vendors using the admin to manage aspects of the catalog
- Two stage approval where the vendor can make changes that are separately approved in the scope of the marketplace application.
In these cases, you need to update all relevant relationships to support these functions which include:
- Corresponding catalog tables at
tenant.blc_tenant_catalogandcatalog.blc_catalog - The vendor itself will have references in
blc_vendor,blc_mpl_appl_catandblc_tenant_mpl_appl_catfor the vendor entity and marketplace application catalog entities. It should have an auto generated catalog which would also be visible inblc_tenant_catalog_refandblc_catalog_ref. - Other potential entities, such as Order fulfillment or Inventory location