$editor ->where does not work
$editor ->where does not work
This is the way you say to do a WHERE in the editor and it breaks the ajax call. Works fine without it.
```
// Build our Editor instance and process the data coming from _POST
$editor = Editor::inst( $db, 'InvoiceLine' )
$editor ->fields(
Field::inst( 'customer_full_name' )
->validator( Validate::notEmpty( ValidateOptions::inst()
->message( 'A name is required' )
) ),
Field::inst( 'customer_id' ),
Field::inst( 'OrderNumber' ),
Field::inst( 'OrderStatus' ),
Field::inst( 'GeminiOrderNo' ),
Field::inst( 'shippedFrom' ),
Field::inst( 'shippedDate' )
->validator( Validate::dateFormat( 'm-d-Y' ) )
->getFormatter( Format::dateSqlToFormat( 'm-d-Y' ) )
->setFormatter( Format::dateFormatToSql('m-d-Y' ) ),
Field::inst( 'ShippedVia' ),
Field::inst( 'TrackingNumber')
)
$editor ->where( 'OrderStatus', 'shipped', '!=')
->where( 'GeminiOrderNo' ,'null' ,'!=');
$editor
->process( $_POST )
->json();
This question has an accepted answers - jump to answer
Answers
I got it working by not using $editor before
->where( 'OrderStatus', 'shipped', '!=')
but I was unable to get the 2nd WHERE working but thats not an issueGlad, working, I think for the second one you need:
See here for more info,
Colin
Thanks Colin