Skip to main content


 

Symptoms


A smart box object added as a view on a form only saves items, per Submit button rules, if the form's own 'Save' button is not used. In other words, when using the Add button, the larger, parent form's Submit button saves the related child list items (which are the smart-box object, programmatically). But once the user clicks the Save button the child list, which lives on the mother form, the items are not saved.
 

Diagnoses


We build this list based on the Expense Claims tutorial. The interesting thing is that the Expense claims tutorial has stopped working today, and we have not edited anything on it, I guess we can verify.

We'd like to use the 'Save' button since the data on the sub-view of the smart-box object is displayed more intuitively.
 

Resolution

Issue: List View 'Save' button not working in conjunction with 'New' Form 'Submit' button.

Resolution:

Short answer: The List View 'Save' button interferes with how the state of items appears in further rules. The "for all items that were Added/Changed" state depends on whether said items have been processed by the 'Save' button. The Form 'Submit' rule was trying to check for this state but the items were already processed and would be recognized as "Unchanged", which makes logical sense but is pretty unintuitive.

Long answer:
- The 'Save' button in the List View needs to have its auto-number ID field checked but empty so new values are generated and should pull its other values from its associated SmartObject. This will create List View items with no associated form ID.

- The Form 'Submit' button should:
1. Execute the form Create List Item method (so there is an ID to pass to the List View in step 3).
2. Execute the List View 'Save Toolbar button is Clicked' rule to make sure IDs are created for each list item.
3. Execute the 'Save' method for all the items that have been 'Unchanged', passing in the List item ID and the Form's ID (the latter will be used in the 'Edit' and 'Display' forms to get all the List View items that are associated).

The last step seems counter-intuitive, but the 'Save' button has already dealt with the 'Added'/'Changed' states so the items appear as 'Unchanged' to future rules.




 
Be the first to reply!

Reply