I have the following MS SQL tables:
Customer (Parent table 'Customer')
- Name (Child table 'Name')
I have an interesting design issue.
In this case, there can be one or two related records in 'Name' but never more. So I have set this up in a UX component with data binding as follows:
Customer (Parent table 'Customer')
- Name1 (Child table 'Name' with one-to-one relationship, linking on CustomerID and a second field always containing '1')
- Name2 (Child table 'Name' with one-to-one relationship, linking on CustomerID and a different second field always containing '2')
This enables me to put the two name records side by side with the fields for each name in a form (columnar) format.
The problem I have is that when I save a record with only one name specified (no dirty fields in Name2), there is an UPDATE SET executed that saves a blank Name2 record. How can I suppress saving Name2 when it is blank?
When I view the Xbasic of the ExecuteServerSideAction() save data action, it seems I would need to remove the values from 'e' that relate to Name2. If so, how is this done?
I also tried Name as one-to-many (linking on CustomerID) but then the Name records are one per row in the repeating section and I do not see a way to put the records side by side.
Suggestions welcome!
Customer (Parent table 'Customer')
- Name (Child table 'Name')
I have an interesting design issue.
In this case, there can be one or two related records in 'Name' but never more. So I have set this up in a UX component with data binding as follows:
Customer (Parent table 'Customer')
- Name1 (Child table 'Name' with one-to-one relationship, linking on CustomerID and a second field always containing '1')
- Name2 (Child table 'Name' with one-to-one relationship, linking on CustomerID and a different second field always containing '2')
This enables me to put the two name records side by side with the fields for each name in a form (columnar) format.
The problem I have is that when I save a record with only one name specified (no dirty fields in Name2), there is an UPDATE SET executed that saves a blank Name2 record. How can I suppress saving Name2 when it is blank?
When I view the Xbasic of the ExecuteServerSideAction() save data action, it seems I would need to remove the values from 'e' that relate to Name2. If so, how is this done?
I also tried Name as one-to-many (linking on CustomerID) but then the Name records are one per row in the repeating section and I do not see a way to put the records side by side.
Suggestions welcome!
Comment