"Invalid Reference Id" error when creating records in a child table

edited June 26, 2020 in Questions
I have a page containing a "parent" model called "Workshop" and a table beneath it where users can create rows for "Workshop Attendance". When users click the green plus icon in the table, it fills in the parent record automatically in the lookup field (Excellent!). However, when I do so and save the page, it throws the error "Invalid Reference Id: Workshop" and no child records in the table are saved. What am I'm missing?

Comments

  • edited June 26, 2020
    Peter, I ran into this a week or so ago. Does the workshop attendance model have a filter on the Id of workshop as a url param ? Is the field Workshop_Id__c in the workshop attendance model ?
  • edited June 18, 2019
    Nope, I have neither of those situations. I do have the Workshop_Attendance__c.Workshop__c field (the lookup from attendance to workshop) on the model, and it shows up in the table fine. FYI, I have lots of models on this page, actually, one of which is a Class, whose ID is passed to the page via URL (Workshop has a lookup to Class).
  • Zach McElrathZach McElrath Principal Software Engineer Chattanooga, TN 💎💎💎
    edited March 2, 2017
    Peter, can you send us the XML for this page?
  • edited June 18, 2019
    Emailed to you & Anna - Thanks!
  • Zach McElrathZach McElrath Principal Software Engineer Chattanooga, TN 💎💎💎
    edited March 2, 2017
    Peter, Can you try reordering these two Conditions in your Workshop Attendance model:
                                  
    You should be able to reorder just by dragging in the Builder. We think that the issue here is that, when new your users click to create a new Workshop Attendance record, Skuid is (helpfully) using the Conditions in your Model to pre-populate the new records' "Workshop__c" field with the corresponding Workshop's Id. But, because you have OR logic here, and because of the order of the Conditions, Skuid is first using the Model Merge condition, then it is overwriting the value with null. So, switching the order of your conditions should change this! We'll see if there's some way we can make this not happen in a future version of Skuid.
  • edited June 18, 2019
    I wasn't able to drag/drop conditions, but i just deleted the first one and recreated it, emulating the same thing, and now it works. Thanks! And yes, this should be pointed out / documented or worked around so builders don't face this. I would never have figured that out.
  • Zach McElrathZach McElrath Principal Software Engineer Chattanooga, TN 💎💎💎
    edited December 21, 2016
    Glad it worked - and, definitely agreed about us changing to make it so that this doesn't happen.
  • edited October 8, 2013
    I'm running into the same error, but I only have one condition: I have two very similar pages, on different objects but with the same approach & condition, and one works while the other gives me the "Invalid Reference Id" error. I tried deleting and re-creating the condition (just in case something was off/odd), but no joy.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!