Unknown DataField Error

Urgent assistance required
I’m receiving an “Unknown data field ‘UserId’” error in AppendSelectExpressions method in Controller.cs. A further message says "The given key was not present in the dictionary." Yet I have added all these fields to the editForm2 view. The points below give more info.

1. I have created two commands as shown below. Command1 is attached to editForm1 view and command2 is attached to editForm2 view.

<![CDATA[select
"ClinicRight"."UserId" "UserId"
,"User"."UserName" "UserUserName"
,"ClinicRight"."ClinicId" "ClinicId"
,"Clinic"."CentreName" "ClinicCentreName"
,"Clinic"."ClinicCode" "ClinicClinicCode"
,null "Australia"
,null "Japan"
,null "Taiwan"
,null "Korea"
,null "China"
,null "Hongkong"
,null "Singapore"
,null "Malaysia"
,null "Philippines"
,null "Thailand"
,null "Newzealand"
from "dbo"."ClinicRight" "ClinicRight"
left join "dbo"."ClinicUser" "User" on "ClinicRight"."UserId" = "User"."UserId"
left join "dbo"."FMCAP_Table_ThisCentre" "Clinic" on "ClinicRight"."ClinicId" = "Clinic"."ClinicID"
]]>

<![CDATA[select
null "UserId"
,null "UserUserName"
,null "ClinicId"
,null "ClinicCentreName"
,null "ClinicClinicCode"
,null "Australia"
,null "Japan"
,null "Taiwan"
,null "Korea"
,null "China"
,null "Hongkong"
,null "Singapore"
,null "Malaysia"
,null "Philippines"
,null "Thailand"
,null "Newzealand"
]]>

2. I invoke editForm2 using the following action:

3. The above action invokes the following business rule method:
[ControllerAction("ClinicRight", "Custom", "AssignClinic")]
protected void AssignClinic()
{
FieldValue UserIdValue = SelectFieldValueObject("UserId");
Guid userId = new Guid(SelectFieldValue("UserId").ToString());
Int32 clinicId = (Convert.ToInt32(SelectFieldValue("ClinicId")));
if (userId != null)
{
ClinicRight cr = ClinicRight.SelectSingle(userId, clinicId);
Context.Session["ClinicRight"] = cr;
Result.ShowModal("ClinicRight", "editForm2", "Edit", "editForm2");
}
else
Result.ShowAlert("Please select a row.");
}
4. The dataFields, UserId, etc. have been placed in a category called General as shown below:

User details
1 person has
this question
+1
Reply