Hi Steve and forum members,
I hope someone can shed light on __keys__[id] a hidden field which is passed when submitting a form.
The issue we are facing is that in a related table arrangement, the __keys__[id] at some random point in time do not match the actual id of the table. As a result the related data which gets entered is for a wrong parent record.
Here is the source view of the page before submission:
<input name="__keys__[id]" type="hidden" value="730" />
<input name="-table" type="hidden" value="tbl_application" />
<input name="-relationship" type="hidden" value="trc" />
<input name="-action" type="hidden" value="new_related_record" />
<input name="-table" type="hidden" value="tbl_application" />
<input name="-action" type="hidden" value="new_related_record" />
<input name="-limit" type="hidden" value="200" />
<input name="-cursor" type="hidden" value="202" />
<input name="-skip" type="hidden" value="200" />
<input name="-mode" type="hidden" value="browse" />
<input name="-recordid" type="hidden" value="tbl_application?id=729" />
<input name="-relationship" type="hidden" value="trc" />
<input name="--original_action" type="hidden" value="new_related_record" />
<input name="-query" type="hidden" value="-table=tbl_application&-action=new_related_record&-limit=200&-cursor=202&-skip=200&-mode=list&rfaId=%3D4&status=%3DComplete&-recordid=tbl_application%3Fid%3D729&-relationship=trc" />
The actual value that should have been passed is 729 but what is passed is 730 ( __keys__[id]) and as a result the data gets entered in the wrong parent record. Really scratching my head and there just does not seem to be a logical answer to this - Did not change the code etc, every thing was working just a few days ago and the recurrence of the event is more than can be safely ignored. Currently handling this in beforeInsert when I manually check the values and if they are different, exit gracefully. This happens in all related tables and with admin as well other roles.
Any pointers will be highly appreciated,
Looking forward -
Thanks!