Select to view content in your preferred language

Scripting - Update AXF Status and Timestamp fields via code

3217
4
04-11-2012 06:22 PM
SteveFitzgerald
Occasional Contributor
Hi all.
I've written a script that can update attributes of any number of point records at once.
By drawing a box around the points the script updates the record fields without opening the forms.

This is all great but...
the AXF TIME_STAMP and AXF_STATUS fields required for check-in are not automatically being updated.
I guess there is some kind of trigger in opening the form that causes these to update.

Does anyone know a way to update these in Arcpad using a script or SQL?

Thanks,
Steve
Tags (3)
0 Kudos
4 Replies
TimHopper
Frequent Contributor
Steve,

This should do the trick:

Dim objLayer, objDS
Set objLayer = Map.Layers("POINTS")
Set objDS = objLayer.DataSource

Dim strsql
strsql = "insert INTO [POINTS] (AXF_TIMESTAMP, AXF_STATUS) VALUES (GETDATE(), 1)"
objDS.Execute strsql
Map.Refresh(True)

Set objLayer = Nothing
Set objDS = Nothing
0 Kudos
SteveFitzgerald
Occasional Contributor
Tim,
Thanks very much for the prompt and helpful response.

As I'm updating checked out data I've changed the query to:
UPDATE [POINTS] SET AXF_TIMESTAMP = GETDATE(), AXF_STATUS = 16777218;


I'll use your query for new records.

Steve
0 Kudos
TimHopper
Frequent Contributor
Steve,

I'm glad you were able to get it working.

Although I haven't tested, the status code of 16777218 indicates that the feature has had attributes modified and has then been checked in.  My guess is that if you were to go and try to check the data in it would not show any changed features.

Simply having "attributes modified" and having a status of "not checked in" would be a status of 2.

[ATTACH=CONFIG]13492[/ATTACH]

[ATTACH=CONFIG]13493[/ATTACH]

[ATTACH=CONFIG]13494[/ATTACH]

[ATTACH=CONFIG]13495[/ATTACH]

Hopefully this info will prove helpful to you and others in the future.

I'd appreciate it if you could mark this post as "answered" by clicking the check mark to the right of one of my posts.  This will help others quickly locate helpful info on this same topic.

Thanks.
0 Kudos
SteveFitzgerald
Occasional Contributor
Tim,
Thanks again! The tables will come in handy too.

Regards,
Steve
0 Kudos