How to update product field with referenced product supplier code?

Hi everyone,

I’m trying to add some functionality into « Stock Details By Product ». I want a search field for Supplier Product Code.

I want to use the Supplier Product Code you can define in the Supplier Catalog, as an alternative option to search for a product in the « Stock Details By Product » form.

Once I select the Supplier Part Number/Code it’ll update the « Product » field already in « Stock Details By Product » with the matching Product that relates to the Supplier Part Number/Code.

I’ve created a many-to-one field and assigned the SupplierCatalog as the target model for the field. But I don’t know how to achieve the desired result. I’ve created a custom button figuring that I might need a custom action in order to apply the update to the « Product » Field. I just don’t know how to get that to work if that is the case.

When I select the « Supplier Part Number » field, it seems to reference the « id » field from the database? I can select « Search More » and it’ll show me the Supplier Catalog form completely with all records I have. But how do I get it to show me the Product Supplier Code instead of the record « id »? I’ll attach some images of what I have so far. Thanks


Hello

specify target-name="<fieldNameYouWantShowInsteadOfId>" Like target-name="productSupplierCode"

Thank you

Is this something I have to do on the actual XML file? Or is it done through the studio? Not sure where to exactly put that.

I made an action for the onchange method of that field. Isn’t that the way I’d achieve the functionality of updating the Product « field » whenever I select a corresponding supplier part number?

@rch-axelor thank you