Context: When creating a booking sometimes your users might need to submit multiple documents for a single booking.  An example could be a booking for a large group study where each person might need to have submitted a patient form.


Suitable for: Admins with experience of working with the Bakery


Objective: Use the bakery to set up the necessary fields in order to store the attachments.


Steps:

  1. Go to Admin->Bakery.
  2. Click the + next to Biskit Def to open the Biskit Tree
  3. Select any Biskit.
  4. Press the Create button to create a new Biskit and enter edit mode. First we need to create the BiskitDef to hold the attachments.
  5. Update the meta-properties of the Biskit.
    • Change Type to be the new BiskitDef name, in this case Project Attachment.
  6. In Properties Add New
    • Change myProperty name to attachment
    • Change Type to Biskit
    • Change Biskit Def to Attachment
  7. Create another new property using Add New
    • Change Type to Biskit.
    • Change myProperty name to project
    • Change Biskit Def to Project
    • Change Biskit Property Type to Many To One.
    • Make sure Required is ticked
  8. Press the Save button. There will be an error: 'ProjectAttachment: Project is manyToOne Project but no inversePropertyName set'
    1. Check the error by pressing Show Log. If the error is complaining about a no inversePropertyName being set go ahead and click the Save Despite Errors button.
  9. Select the Project BiskitDef, press the Edit button to get back into edit mode.
  10. In Properties Add New.

    1. Change Type to Set.

    2. Change Name to attachments

    3. Change Biskit Def to Project Attachment

    4. Change Biskit Property Type to One To Many

    5. Change Reference Deletion Option to Set Null

    6. Change Inverse Property to project

  11. Press the Save button and although there will be an error you can click the Save Despite Errors button
  12. Select the Project Attachment BiskitDef, press the Edit button to get back into edit mode.
  13. Select the Project property.
    1. Change Inverse Property to attachments
  14. Press the Save button
  15. If there are no errors the database will need to be updated:

    1. Press Update DB Schema to implement changes in the DB, and then run the script to apply the changes

    2. Press Validate Biskits button to check the database Biskits.

    3. Press Reload Database Configuration, to load the new database into Calpendo

    4. Refresh the browser