Editor Server Side - How do i ignore a Field
Editor Server Side - How do i ignore a Field
Link to test case: N/A
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:
In the javascript i have a column defined as
{ data: "NEW_ITEM", defaultContent: '' },
On the server side i have the following call to the editor.
response = new Editor(db, Instance, new[] { "UNIT", "PRECID", "SRECID", "SUPPLIER" }).Debug(true)
.Model<CSDTMOD>()
.Field(new Field("NEW_ITEM").Set( // Exclude the "NEW_ITEM" field
.Set(false)) // Set it to be ignored
.Process(request)
.Data();
The field "NEW_ITEM" does not exist in CSDTMOD or in the table on the database. We are inserting a value on the client side using jquery for each row.
I was under the impression .Set(false)
would tell the editor to ignore the field and not include it in the query. Any suggestions on how to resolve this?
Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.
Replies
{ data: "NEW_ITEM", defaultContent: '' },
There is something funny with your syntax on lines 3/4. Reformatting shows:
It should be:
Maybe it was just a copy / paste error. However, that will exclude the
NEW_ITEM
field from INSERT and UPDATE queries. If it doesn't exist in the table then you will want to disable it for SELECT queries as well:But at that point I'm not clear on why you'd have that field on the server-side at all?
Allan