I have been using some models that I want to create a new record if there are no records, but clone the existing record if there is one. This lets you present the current record info to the user as a clone, allow them to update it and save it, but still have the original record so you can create a version history. Since upgrading from 8 to 9.5.5, I now get a console error if the model has no rows on page load. It used to just create a new row. It would be great to have this functionality back.
(I reported this last week, but wanted to explain the problem more concisely)
Thank you for explaining it in more precise manners.
If you wouldn’t mind, could you post the page’s XML for us? Since it has to do with upgrading, it might be something that has carried over in the XML.
Furthermore, is this the kind of thing where if you make a new page with the same set up, it’ll work? Or is it broken in all instances?
Sure. I cloned my page and removed most of the components and models so that it was easier to sort through. If, on page load, the model loads no rows due to conditions restricting the rows to just those that belong to a specific contact, then upon model save attempt, you will get the following console error and the model will not save. If upon page load, the model has a row, then the model will save correctly with no console error.
skuid__SkuidJS:8 Uncaught TypeError: Cannot read property ‘row’ of undefined at Object. (skuid__SkuidJS:8) at Function.each (skuid__JQueryJS:2) at W. (skuid__SkuidJS:8) at Function.each (skuid__JQueryJS:2) at Object.K tas save] (skuid__SkuidJS:8) at save (skuid__SkuidJS:18) at Object.h.runActionNode (skuid__SkuidJS:18) at m (skuid__SkuidJS:18) at Object.h.runActionsNode (skuid__SkuidJS:18) at HTMLDivElement. (core.js:3)
Here is the XML
Hi Raymond, thank you for your patience. With the old behavior you describe, when the model didn’t have an existing record to clone, did its ‘empty’ clone just look empty? I will submit this as a product issue to our development team. Can you say which was the previous version you were using, in which the model save behaved as expected?
In both versions, If there is no record, a new record is dispalyed so the user can add info. In the old version, saving the model then saves/creates the record. In the new version a console error results and the record does not save. -Old version was one of the last version 8’s. Maybe the last one. -new version is 9.5.5 Thanks
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.