In a system module, during an system_update function, I am trying to avoid the "fatal error" scenario when I try to update a row and values already exist. In my query, I am trying to set an error or flag so I can report the reason an update didn't execute to the content screen so the user knows there was an input error and why.
In theory, I am testing the myview.d.eof value. If there is EOF, the query didn't find a record. If not myview.d.eof, then a record already exists and I need to report the entry error.
Doing the query with known values, all scenarios have the result that myview.d.EOF always fails and at least one record is found.
Why might myview.d.EOF not be true when no records are found in the query? is there another status I should be checking instead or a better way to accomplish this?
Note: I've have an Unique Index on the two fields in question, which I assume are the reason for the Fatal Error. Should I consider not having these fields as Unique Indexes?
Thanks,
Scott
In theory, I am testing the myview.d.eof value. If there is EOF, the query didn't find a record. If not myview.d.eof, then a record already exists and I need to report the entry error.
Code:
<MvIF EXPR = "{ myview.d.EOF }"> <MvCOMMENT>-SDS--no duplicate found </MvCOMMENT> <MvCLOSEVIEW NAME = "Merchant" VIEW = "myview"> <MvFUNCTIONRETURN VALUE = "0"> <MvELSE> <MvCOMMENT>-SDS--at least one record was found </MvCOMMENT> <MvCLOSEVIEW NAME = "Merchant" VIEW = "myview"> <MvFUNCTIONRETURN VALUE = 1> </MvIF>
Why might myview.d.EOF not be true when no records are found in the query? is there another status I should be checking instead or a better way to accomplish this?
Note: I've have an Unique Index on the two fields in question, which I assume are the reason for the Fatal Error. Should I consider not having these fields as Unique Indexes?
Thanks,
Scott
Comment