Tip on checking existance of records..
So I don't know about you, but I get really tired of having to use the count function to check for the existence of records first before making a collection. (From my knowledge this is how most do it) Example...
- cnt = count(myForm[field == value]);
- if(cnt != 0)
- {
- myRecords = myForm[field == value];
- }
One must use the count function because if you try to do this, ZC throws an error
- myRecords = myForm[field == value];
- info myRecords.ID;
However, I've found what I think is a very convenient way of testing for records..
- myRecords = myForm[field == value];
- if(myRecords.ID.getAll().size() != 0)
- {
- info myRecords.ID;
- }
getALL() nerfs the error turning a blank "NVIEW" into an BIGINT list of ID's. I've always used getAll but I've never thought of trying it on a blank collection.
Hope this is helpful to others. BTW, if another developer has a way to mitigate collection errors WITHOUT having to restate your collection query. Let me know ;)
Stephen Rhyne