Validate single record on continuous form - validation

So I have a form and a table called Variables. The table is simply the fields VarID, VarDescription, and VarValue. It's only three items that are all network locations of things. The VarValue is the only thing that can be changed through the form, and thus it is the only thing validated. I validate those records on the form with the Before Update Event in the control by using logic such as:
If Me.VarID = 1 Then
If Me.Tex like "*:\* Then....
End If
If GetAttr(Me.Tex) = vbDirectory Then
End
End If
If Me.VarID = 2 Then
If Me.Tex like "*:\* Then....
End If
If GetAttr(Me.Tex) = vbNormal Or GetAttr(Me.Tex) = vbArchive Then
End If
End If
This all works great. However my issue comes in when multiple locations become invalid at once. I get stuck in one cell because the other VarValue's are invalid as well. How can I validate only the cell I have changed? I tried playing around with various Dirty and Focus events/methods, but those seem to be form specific, not cell specific.

This seems to just be a reference issue as I am looking on the database on two completely separate networks. The original uses all Office 16.0 libraries whereas the instance I was having the issue with was using Office 15.0 libraries. I played around with the original and it works fine, even if all the locations become bad at the same time.

Related

How to store and retrieve data from an optional array of integers using core-data?

I've developed an iPhone app that is working fine except for navigating from one view to another without losing the data. I know that core-data is the solution but I'm a beginner in this area. I need to store and retrieve several arrays such as: var arrayName = [Int?] (repeating: nil, count: 9) in the exact order they become populated (0-8). How do I set these existing arrays up in core-data?
I've watched and read several tutorials, but none explain how to include an array (especially with integers) that already exists.
All of my code is working perfectly for this app. I only need to save the data.
I expect to be able to navigate from view to view and return with everything in place. Also to close and reopen the app where I left off.
Note: No need for error messages.

Lat/Lng Coordinate variables not recognized in ActiveRecord, forced to hard code

Hey guys I'm having the WEIRDEST issue while pairing on this rails app. We're using google maps api to grab lat and lng to do an ActiveRecord look up. For some odd reason the SomeModel.where("lat <=?", neLat) will not work BUT when I print neLat to the console and then copy the number and then hard code it to that query it works perfectly! I'm so stumped. Has anyone had any issues like this before?
This is an example of what I'm currently doing which doesn't work:
data = request.parameters
neLat = data['neLat'].to_f
#props = SomeModel.where("lat <=?", neLat)
47.6090933689332 is the number I see in my console/ActiveRecord query. One troubleshooting step I've taken was hard coding the number into a variable like this:
neLat = 47.6090933689332
#props = SomeModel.where("lat <=?", neLat)
I get the results I'm looking for this way, but I don't want to be hardcoding these coordinates. Another troubleshooting step I've taken was to make sure there wasn't a conflict with the float value so I went with this:
temp = "47.6090933689332"
neLat = temp.to_f
#props = SomeModel.where("lat <=?", neLat)
This didn't work either as it gave me the same results as the example just above.
EDIT:
I've provided more details as requested in the comments. Also, I realized I wasn't as clear as I could've been in my initial question. When I query I'm able to get my desired results back in the console, but the problem lies in the rendering of the results in my view. Any form of hardcoding will render correctly in my view, but when I use the values from my request.parameters is where the rendering fails. It will either render everything in the table or nothing in the table. So in the example below I can see that I'm getting 3 different properties from my properties table, but my view will render EVERYTHING in my table, which is like 7 properties.
Here is the raw sql query that ActiveRecord generates (this is the result of all 3 ways as I've done above):
SELECT `properties`.* FROM `properties` WHERE (lat >= 47.609093368933195)
#<Property:0x007fa333ac1880>
#<Property:0x007fa333ac1718>
#<Property:0x007fa333ac15b0>
As for the schema, it's just one table that I'm using and no joins.

How to develop a backend for a scrum-like board

Currently I'm developing a debate module (much like a scrum/kanban board) for a GPL application (e-cidadania) and I don't have any experience with complex backends. I have developed a basic frontend for it, but now I don't know what approach I should use for the ajax and django backends to save and manipulate the table and notes.
The table can be N rows and N columns, every row and column has a name and position inside the table. Every note has also a position, text and comments (managed with the django comments framework).
I thought to store the parent element of every note (so I can place it later) and store the name of the rows and columns like CSV strings. Is that a good approach?
A screenshot of the current frontend: http: //ur1. ca/4zn4h
Update: I almost forgot, the frontend has been done with jQuery Sortables (so the user can move the note around as he likes) and CSS3.
You just need to model your domain (that is, debates that look like scrum boards) within Django. Think about it in plain English first, like this:
The has debates. These consist of criteria, organised in rows and columns in a specific order. This creates cells, which can have notes inside them.
Then you can set to work translating this into model classes. Don't worry too much about the fields they contain, the most important bit is the relationships (so the ForeignKey bits):
class Debate(models.Model):
title = ...
class Column(models.Model):
title = ...
order = ...
board = models.ForeignKey(ScrumBoard, related_name='columns')
class Row(models.Model):
title = ...
order = ...
board = models.ForeignKey(ScrumBoard, related_name='rows')
class Cell(models.Model):
column = models.ForeignKey(Column)
row = models.ForeignKey(Row)
class Note(models.Model)
text = ...
cell = models.ForeignKey(Cell)
That might be overly complex for what you need, though. I'm not an expert in the problem you're trying to solve? My suggestion, Django is quick – so start hacking, and give it a go, and if it's all wrong then you can go back a few steps, clean out your database and try again.
You might find it useful to play with South, which does database migrations for when you do things like add/remove/edit fields in your models.

QTP Visibility Issue with a strange solution

I'm testing a Java web application on QTP. In one screen, not all fields are visible initially (ie: they're 'below the fold'), so this:
Browser("x").Page("y").JavaApplet("z").JavaInternalFrame("a").JavaEdit("txtName").Set "bob"
Causes an unspecified error to occur.
But if I change it slightly, to:
Browser("x").Page("y").JavaApplet("z").JavaInternalFrame("a").JavaEdit("txtName").Object.SetText "bob"
It works fine. Why?
If the object Properties for the JavaEdit Box which is set by the Developers is different from other similar objects. hence it has to be done in that way.
There are many instance like where one cell of the Java Table is set by the value using SetCellData for the Edit operation and for a same kind operation usually we use Type / SendKey methods.

Getting a blank data report vb6

I am new to vb6. I am working to create the invoice generation application. I am using data report to show the generated invoice.
The step by step working of process is:
Entering the data in to Invoice and ItemsInvoice tables.
Then getting the maxId using (Adodc) from the data base to show the last generated Invoice.
Then passing the max Id as parameter to the data report which is showing the invoice according to the invoice id.
It is working fine when I first time generate invoice. Now for 2nd invoice without closing application I am getting a blank data report. For data report I am using dataenvironment.
I am guessing the reason the data report is blank is because there was no record for that Id, but actually the record is inserting in the database.
What is going wrong?
I'm not sure how your data set is getting configured, but it sounds like you have a single record in the data and aren't reloading it properly. If your report is manually moving through the recordset and only showing info based on the ID parameter you are passing it and then using the same recordset for the second report, you probably just need to MoveFirst on the recordset to put it back at the beginning.
Load the data environment and refresh the data report.
I am also generating report in the similar fashion. I faced this problem. Here's the solution
Load DataEnvironment1
With DataEnvironment1
'Command1 is the command added to data environment where you fire query or
'set it to point to a table
If .rsCommand1.State <> 0 Then .rsCommand1.Close
.Command1 maxid 'parameter you pass to the recordset
End With
DataReport1.Refresh
DataReport1.Show
Thats it!
You are done. I m sure it will work. Do tell me if it doesn't.
I don't know if the answer will still bother you, but if someone else have the same problem here is a example of how the problem works:
Imagine that there is a gate and a guard looking who is entering, when the first person (the first invoice) comes, the guard registers him, opens the gate (This is the event "Load DataEnvironmet") and then lets the guy pass. The guard believes that no one else would come and lets the door open (the instruction believes that the DataEnvironment ends and the value EOF becomes True), but when the second guy comes (the second invoice) the guard can't ask him who is (has, again, the value and lets it pass without registering him (this is the reason why the second invoice, and subsequent in while invoice would come blank). The solution is to close the gate ("Unload DataEnvironment") after a guy passes (After showing the data report).
The solution is the code given from Sangita above, but just before ending the sub you need to unload the DataEnvironment you were working on.
For me, it works. Sorry if the answer is not what you were looking for (and also if someone else can't understand what I'm writing, my English isn't very good). Just in case I will write the code with the solution
Load DataEnvironment1
With DataEnvironment1
If .rsCommand1.State <> 0 Then
.rsCommand1.Close
End If
.Command1 Value(ID)
End With
DataReport1.Refresh
DataReport1.Show
Unload DataEnvironment1
Try a refresh method like data1.recordset.requery or
Data1.refresh. This should work if you use data controls.

Resources