I’m building a page and encountered some strangeness with Models, and have isolated the problem in a demo page. I’ll try and add the XML for this page into this post - if it doesn’t work, I’ll host elsewhere and link in the comments. It should work in any vanilla org with Accounts and Contacts.
There are two models - Account and Contacts. The idea is you can create an Account and Contacts for that account at the same time. As it’s a demo page, it’s a little weird, but essentially you enter an Account name at the top, then enter Contact email addresses in a table underneath. A button at the top Saves the Account first, then Contacts.
The Contacts model has a condition that sets the LastName field to the value from the Account Name - weird, but this is for demo purposes, so please bear with me
The idea here is that when saving the Contacts, the Account name should get pulled in and put into each Contact’s Last Name. This should be similar in principle to how I can link newly created Contacts to a newly created Account all in the same page, where the Contacts has a condition that sets AccountID to the ID field of the account. Skuid does the magic here.
But it doesn’t work like this for non-ID fields. In this case, the Last Name only gets set if the Account name is entered and a row is created in the model after this - and the value is only set on the new model, not any that existed before the Account Name was set (I’d be OK with this so long as on save, the value was copied, but that doesn’t seem to happen).
To demo this with the page, enter an Account name, enter an email address for the default row in the table, then click the + icon to add another row, put another email address in, and then click the button at the top. You should receive an error, but check the account that got created - the second contact was created with the last name set.
Am I wrong in my thinking of the way this should work? I have a workaround for now, but just curious! Here’s the code: