M.App Enterprise Discussions

Discuss topics with other M.App Enterprise Product pioneers and experts to get the most out of it.
Showing results for 
Search instead for 
Do you mean 
Reply
Highlighted
Frequent Contributor
Posts: 134
Registered: ‎04-11-2016
Accepted Solution

MApp Enterprise Mobile inserts duplicated records

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:

 

SQLProfiler.png

 

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:

View.jpg

 

The source table for the view above:

Table.jpg

Table2.jpg

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

 

 

 

 

 

 

Highlighted
Staff
Posts: 105
Registered: ‎10-25-2016

Re: MApp Enterprise Mobile inserts duplicated records

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

Highlighted
Frequent Contributor
Posts: 134
Registered: ‎04-11-2016

Re: MApp Enterprise Mobile inserts duplicated records

Thanks Christian, how could you check the version number?

I think our demo mobile instance was installed by Jan eary this year.

 

 

Cheers

Yuan