April 11, 201312 yr I am trying to set a field in a related table, via a script, but am getting this error: "This operation cannot be performed because one or more required related records are not available and cannot be created." This is the interrelation of my tables: TableB::ID <*=1> TableA::ID <1=1> TableC::ID The script is running in a layout based on TableB (many-to-one to TableA). I am trying to have set a field in TableC ( one-to-one with TableA), so it is looking through TableA to set a field in TableC. The related records in TableC DON'T previously exist, but I have 'Create records based on this relationship' checked in the relation from TableA to TableC, just for this purpose. In my dataviewer I see: TableB::ID = 1111 TableA::ID = 1111 TableC::ID = "" Anyone have ideas what's going on here, why I can't create the related records? -- J
April 11, 201312 yr Author Urrrmmm....no. I suppose that it may not hurt anything ultimately, in practice, but it kind of scares me. TableA is kind of the primary table of the whole system. Does the 'Create...' chain have to be present at each step?
April 11, 201312 yr If you want B to create a record in C going through A then Yes. If you dont want B to create records in A use another TO with B to C.
April 11, 201312 yr Author Durn. I just tested it. It DOES have to be enabled along each leg of the chain. Grrr... Hmmm...might mean a new TO with a direct connection between C and B. Oh hey, that's what you just said. I hadn't refreshed my browser window.
April 11, 201312 yr Yes, I believe you need to have "Allow creation of related records" set for both B to A and A to B. You can "reach through" A to make new records in C, if the corresponding A record already exists. This should not create a new record in A if a record with the matching ID exists already. An alternative is to create an additional occurrence of Table C in your relationship graph and link B directly to C. You can generate records from B directly in C with this relationship without effecting A. Another alternative is to have your script switch to a layout linked to Table C and generate new records in C directly.
Create an account or sign in to comment