Using an AutoNumber attribute as a foreign key? (screenshots included)
So I keep getting an error regarding a certain AutoNumber attribute. Basically I have two relevant forms: one for making an order and one for making orderlines. The form that I use to make a new order has an AutoNumber attribute that automatically gives each order a new number. In my orderline form, I use this ordernumber to see which orderline belongs to which order. Yet for some reason I can't select which ordernumber I want to use in my orderline form. Does anyone have any ideas? I'll include some screenshots below. Orderline form while running my app: Orderline form in Mendix Studio Pro: Order form in Mendix Studio My Domain Model: (Ordernumber is the AutoNumber that I just can't seem to use in my Orderline form)
This can work fine. You are not allowed to change the auto number, but you are only referencing it and reading the value.
All you are probably missing is reading rights for this attribute. Check the access-right of Bestelling/Bestelnummer for having read-rights for the Project-role that you are signed in with.
Tim van Steenbergen
Autonumbers are automatically generated by mendix which we cannot edit in pages or microflows.
Use integer instead of autonumber for ordernumber to get the orderline.