Hi,
I have 4 lists in a parent/children relationship. Lets call them List1, List2, List3 and List4.
List3 is a child of List2 and List2 is a child of List1. List4 is a child of List1, but is also linked to List2 and List3.
Data for List1 is loaded when online to the server. Lists 2, 3 and 4 are pre-loaded. New records can be created on the fly for List2, List3 and List4. Whenever a new record is created for Lists 2, 3 and 4, the linking fields are setup manually with javascript.
This works fine when online. However, this app has offline capability, so it needs to work offline. I can create new records when offline for List2, List3 and List4, however the linking fields are not set as the ids for the new records are not assigned. (the id fields are auto generated in the db). When the app comes back online, I have a 'Sync' button which does a saveListEdits to save all the records back to the db that were added during the offline period. However, the linking fields do not get configured during the sync.
So I can do this manually by 1) saving List2, then 2) copying the id to List3, 3)saving List3, then 4)copying the ids from List2 and List3 to List 4 and then 5) saving List4. I would need to either introduce relevant delays between each step, or work out how to ensure the record has been saved and the id is available.
I thought there might be a more "automatic" way of doing this. I tried setting up the lookup fields in the list properties but that didn't seem to do it. So is there a way to do this via configuration, or is the only option to do it programmatically ?
Cheers,
Greg
I have 4 lists in a parent/children relationship. Lets call them List1, List2, List3 and List4.
List3 is a child of List2 and List2 is a child of List1. List4 is a child of List1, but is also linked to List2 and List3.
Data for List1 is loaded when online to the server. Lists 2, 3 and 4 are pre-loaded. New records can be created on the fly for List2, List3 and List4. Whenever a new record is created for Lists 2, 3 and 4, the linking fields are setup manually with javascript.
This works fine when online. However, this app has offline capability, so it needs to work offline. I can create new records when offline for List2, List3 and List4, however the linking fields are not set as the ids for the new records are not assigned. (the id fields are auto generated in the db). When the app comes back online, I have a 'Sync' button which does a saveListEdits to save all the records back to the db that were added during the offline period. However, the linking fields do not get configured during the sync.
So I can do this manually by 1) saving List2, then 2) copying the id to List3, 3)saving List3, then 4)copying the ids from List2 and List3 to List 4 and then 5) saving List4. I would need to either introduce relevant delays between each step, or work out how to ensure the record has been saved and the id is available.
I thought there might be a more "automatic" way of doing this. I tried setting up the lookup fields in the list properties but that didn't seem to do it. So is there a way to do this via configuration, or is the only option to do it programmatically ?
Cheers,
Greg
Comment