Friday, 24 October 2014

Delete geometry but keep record

When you delete a geometry (industry model) Map also deletes the database record as well. In some situations you just want to delete the geometry of a feature but keep the record. How do you do this?

in Administrator:
(1) add the Geometry/Coordinate Editor control to the form





Administrator - Form Designer - add control....

in Map:
(2) set form in Edit mode
(3) open Geometry editor (button will appear next to the Editor control)



... Map - Form - use control to delete geometry.

(4) In the Geometry Editor window you can delete - step by step - all vertices of a feature (you cannot delete the whole feature in one go). After deleting all vertices don't forget to "Update" the record to make the changes permanent.

Friday, 10 October 2014

dynamic maps in Crystal reports - transparent background

In the process of migrating from TB2 to Map we also have to migrate CR reports. A few of them include a map which is created dynamically. For creating these maps with Map/AIMS I use the GeoRest extension (the one which comes with AIMS installation). The Georest extension seems only to be able to create PNG files - including a transparent background. But there is a bug in CR 2011 - transparency is not handled properly and converted either to a black or white background (see Note:  1199393 ). In our case the background was always black - the report with the map embedded didn't look nice at all:

transparent background appears black....


My colleague found a nice work-around. We created a layer which covers the whole area relevant for reporting. The layer is put in the background and gets the colour white. A map generated via GeoRest does not have a transparent background anymore:

....background colour set to white
Map 2013, SP2

Thursday, 9 October 2014

Form filter settings and reference records gone missing.....

We experienced the loss of form filter settings and reference records. The issue kept us busy for quite some time. First one colleague reported, that form-filters he had defined in multiple industry models had gone. After setting the filters up again they went missing again. Then something similar was reported from a different colleague regarding reference records. The issues occurred in our production and our testing environment.  Initially we could not really reproduce the issues. Suddenly entries were gone. Sometimes on the same day as they had been made, sometimes a few days after. No one had an explanation and Autodesk support was as puzzled as we were. Obvious suspects such as 1-ClickMaintenance or importing forms or similar actions as a cause could be excluded right from the start.

We created a trigger on table TB_REF where reference records are kept. This way we could at least determine who did a delete in the table and when. With this information available it became clear where to look for the cause.

But first some words about our Map environment:

We have set up three MAPSYS users - each MAPSYS user is run by a different organizational unit (for security reasons one organizational unit shall not have unlimited access to the data of another unit). Each MAPSYS contains a set of distinctive industry models, for instance Mapsys1 contains the industry model for electricity, Mapsys2 contains the industry model for waste water and so on. Map users can only connect to one Mapsys - the one which belongs to their organizational unit. But users need data maintained in other Mapsys environments (the guys running the water industry model would like to see data from the waste water network as well). So we created guest users for each industry model (usually based on the read-only template in Security Admin) and imported these guest users into the other Mapsys users. In my example Mapsys1 now contains:
- electricity industry model (data user)
- waster water industry model via an imported guest user

The filter settings and reference records now go missing when you set up a new workspace (in Mapsys1) and you add a guest user (in my example waste water guest user) where the underlying data user is kept in a different MAPSYS (Mapsys2). Because the user ids of the users who created the filter settings and reference records (in Mapsys2) are not known in the Mapsys environment the project is created in (Mapsys1) the settings get deleted by Map.
But there is one exception - (public) settings made by the default "Administrator" user are kept - just because the default Administrator user is always present in a Mapsys and always has the same user-id. The settings get also deleted when a user just opens the project later in Map.

There are a couple of issues here:

(1) For some reasons the default read-only guest user template allows DELETE operations on tables TB_REF* and TB_GN_DIALOG_FILTER. By revoking the DELETE permission the problem should go away.

(2) There is some in-built functionality in Map which tries to keep data consistent and to prevent orphaned entries in "TB_" tables. But in the situation described above there aren't any orphaned entries - is just that Map doesn't recognize that the data user is kept in a different Mapsys environment and therefore no deletion should take place.


The trigger we set up in the industry model (kept in Mapsys2) logged users only able to connect with Mapsys1. They actually did not delete any records - the just opened a project containing a the guest user from Mapsys2.

Map 2013, SP2