09-17-2018 10:43 PM
I have spotted an interesting issue: seems MApp Enterprise Mobile always inserts two duplicated records programatically when the user creates only one feature on the device regardless of what data source it uses (table or view). You can see the SQL Server profiler trace below, I inserted only one new record however the insert syntax got executed twice:
If you are using SQL server table you will most likely only see one record inserted into the destination table, this is because you normally set the GUID field as the primary key field i.e., the constraint prevents the 2nd duplicated record from being inserted into the table.
However if you are using a view, you will see two duplicated records inserted into the view, I think this is because view doesn't support constraints or primary key. The workaround here is to create a unique constraint on the GUID column in the source table of the view. Note in my source table GID (GID is my GUID column) field is a newly added uniqueidentifier column that is solely for Mobile use (not set to primary key), this is to minimize the source table schema changes (i.e., I am still using the original primary key column – ID.)
II have the following set up:
The view:
The source table for the view above:
You can see I had to add a unique constraint for GID column to stop duplicated rows from being inserted into the view.
Has anyone else seen the similar behaviour - MApp Mobile does two identical inserts.
Cheers
Yuan
Solved! Go to Solution.
09-18-2018 06:26 AM
Hi Yuan,
I am not sure which version you are using, as there has not been an offical release yet, but this should not occur anymore.
Regards
Christian
09-18-2018 02:16 PM
Thanks Christian, how could you check the version number?
I think our demo mobile instance was installed by Jan eary this year.
Cheers
Yuan