Trying to get value of a field for additional server-side processing
Trying to get value of a field for additional server-side processing
I have using .net libraries and in my controller action that is creating or updating a record (POST, not a GET), I need to get the values of the record being edited for additional server-side processing. I thought I could use the Field("field_name") api on the server side but that doesn't seem to work even though these values are seemingly passed in (see snippet). I want to get the values of Rsm and Rlg, which are floating point values. Do I need to just dig into the Request object to get these? Is that what the Editor class does internally?
                    var response = new Editor(db, "XProfile", "ID")
                                        .Model<XProfile>()
                                        .Field(new Field("ID"))
                                        .Field(new Field("Name"))
                                        .Field(new Field("Description"))
                                        .Field(new Field("Rsm").Validator(Validation.Numeric()))
                                        .Field(new Field("Rlg").Validator(Validation.Numeric()))
                                        .TryCatch(false)
                                        .Process(Request)
                                        .Data();
                This question has an accepted answers - jump to answer
Answers
Actually, straightforward to get the values from the Request object. You need the correct keys, which are in a collection in Request.Form.Keys. The keys are in the form of data[row_3][Rsm].
Hi,
You might also want to take a look at the events such as
PreEditandPreCreatethat the .NET libraries can fire. Docs on them here. They can be really useful for performing extra operations per row.Allan
Thanks Allan - I'll take a look!