app from spreadsheet template.Document attribute is considered as string attribute.

I created app using app from spreadsheet template and i want an attribute of document where file can be stored.Document attribute is considered as string attribute.While creating new entry the user should get the option to choose file instead of text field.How can i do that?
1 answers

Hi DevaPriya,

To store a document in Mendix you can do the following: go to your Domain model and instead of using the Document attribute in your Entity, you can create another entity  that will be used to stored the Document. This new entity needs to be a Generalization of FileDocument (from System module) like so:

You can learn about the process of creating a new Entity with the capability to store a File Document here.

And here is an example of how your domain model could look like with said changes (this may vary for, because in this type of association that I posted states that a Person can have many Documents, you may want to change that depending on how you want your logic):

If you have any more questions please mention them and we’ll gladly help, regards!