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
Regular Contributor
Posts: 185
Registered: ‎11-17-2015

MAE Desktop/Mobile - Incompatible GUID primary key between desktop and mobile

Hello,

 

For mobile app editing I have created a table with a GUID field as primary key. 

It works perfectly in MAE mobile.

I have created a WF in MAE desktop to view and edit the same feature.  

Displaying the WF is OK but I have an error when I try to fit the object in the map or if I try to edit the geometry.

 

For that I use:

- SC.Map.setSelectedElements(featureid)

ERROR -> "java.lang.NumberFormatException: For input string: "04a720d4-cc93-4802-bb56-4583c077af86"

 

- SC.digitize('debroussaillage', {commands: ['MODIFY','Redo','Reset','Save','Undo'], startOnLoad: 'MODIFY'},[{FORM.id1}])

ERROR ->  "java.lang.Throwable: Error during start edit! Please check log file for details! [layer=debroussaillage]"

IN LOG FILE -> "java.lang.String cannot be cast to class java.lang.Number (java.lang.String and java.lang.Number are in module java.base of loader 'bootstrap')"

 

In my WF I have set the id1 field to string type.

In postgis DB, the id1 column is character varying(36)

 

Does anyone has the same issue?

 

Thank you.

Regular Contributor
Posts: 185
Registered: ‎11-17-2015

Re: MAE Desktop/Mobile - Incompatible GUID primary key between desktop and mobile

Seems like SC.Map.setSelectedElements(ids) and SC.digitize(...[{FORM.id1}]) only accept number(s) as parameter.
I have workaround it by adding an integer column to my table (serial type in postgres).
MAE desktop uses this integer column. MAE mobile the guid column (mandatory for offline editing).
Is it the only way to do that? Is is a WAD? 
If yes, it would be great that MAE desktop and mobile use the same primary key (and number type instead of guid).

Regular Contributor
Posts: 185
Registered: ‎11-17-2015

Re: MAE Desktop/Mobile - Incompatible GUID primary key between desktop and mobile

I don't know why but after testing again with only GUID ID field (character varying 36 in DB, string or GuidString in WF) the API functions work again...