Create complex child record?

Create complex child record?

gordonc200gordonc200 Posts: 39Questions: 7Answers: 0
edited January 2018 in Free community support

I use datatables to keep records of construction drawings and the issues of these drawings to various persons.

When I create an issue record I add recipients from a linked table. In my editor form I use a select field for this adding as many recipients as needed.

My problem is that a recipient may receive a variable number of copies of a drawing and so as well as selecting multiple recipients I would like to be able to select a variable number of copies for each recipient individually also.

The poor workaround I have for this at the moment is to have more than one record for each recipient with an additional number of copies field in the recipients table. If they sometimes get one copy and sometimes two I simply select the required recipient record for the recipient plus number of copies.

As I say, it's pretty basic!

I know that I could create a link table using the recipients ID, the issue ID and the number of copies such that I would need only one recipient record per recipient but I'm not sure how I would handle the record creation in the issues form.

I hope the above makes sense to someone out there!

Thanks
Gordon

Replies

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin

    Hi Gordon,

    Great question. What you are looking for is technically possible, but it isn't a feature that is ready to use out of the box I'm afraid. In essence what needs to be done is a field type plug-in be created for Editor which will accept two values for a single field (i.e. build an object of values). That is what can then be submitted to the Mjoined table (I'm assuming you are using Mjoin here?).

    There was a discussion on this topic relatively recently where I showed how such a plug-in could be created. There is a screenshot there - is that the sort of thing you might be looking for?

    Allan

  • gordonc200gordonc200 Posts: 39Questions: 7Answers: 0

    Hi Allan

    Yes, I'm using mjoin. I'll have a look at your solution using a custom field type. Seems very promising!

    If I get anywhere I'll post back here.

    Thanks
    Gordon

This discussion has been closed.