If you are trying to create a entry in the join table (relations_company_brand) then you will need to script it. I'm guessing that you want a join table because you want multiple companies to also stock multiple brands and vice versa.
I.E. you will want to gather the ID Company and the ID Brand in a variable, then go to the join table, then create a new record and populate it:
set variable $IDCompany xxxx
set variable $IDBrand xxxxx
go to layout (relations_company_brand)
set field 'ID Company' $IDCompany
set field 'ID Brand' $IDBrand
go to layout (original layout)
okay, it then is not possible to achieve this just by the form-fields etc. in the layout... Does it mean that I should have a global field where the user types in the brand name and the a script makes a look-up and does the setting if the brand is already there or make a new brand entry, obtains the ID and make then the new brand entry?
Ok from your description, it does seem you need a join table to be able link M Companies to N Brands.
My approach for this would be as follows:
Starting from the company context, which I assume you are doing, have a portal of all brands that are linked to the company. The portal will be based on the join table between Companies and Brands.
To add new brands to a company, I would institute a picker. So, just put a button next to or in the portal. This button will take in the current Company ID and will navigate to a picker layout that would have the list of all brands. Then, when the user has selected a brand and hit Submit/Done, store the Brand ID and navigate to the join table context. Create a new record and populate the appropriate fields with the Company ID and the Brand ID. Navigate back to the Company layout and you should have a new brand in your portal for the company.