Customer -> location dependant form create event

Hi,

I have an overview window containing a table for the list of customers and based on the selected customer from this table, it fills out all the customers contacts & locations (wharehouses, hq and other delivery hubs).

Both sub tables have an create event, so that i can add additional locations or contacts.

I’m probably looking at the wrong end, however how can i prefill the foreignkey for the customer into the create form for the location or other contact?

kr,

Tim

Probably you need the InitEntityEvent handler.

image

HI

okay but i’m getting a type through where I would basically need the foreign key from customer to preset the values …

image

Then install the initailizer handler for the Create actions of the subordinate tables. For example:

@Install(to = "contactsTable.create", subject = "initializer")
private void contactsTableCreateInitializer(Contact contact) {
    customer.setCustomer(selectedCustomer);
}