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: 159
Registered: ‎01-14-2018
Accepted Solution

Reload vector layer after saving form

Dear all,

 

In M.App Enterprise 16.1, I am building a Desktop workflow form having an action widget to save what is in the form, so I type save in the field action.

What I want now is to reload the vector layer once I click on that save action, I tried to create a trigger but does not work.

Is there a way to write a script to do both the save and the reload?

 

Best regards

Khaled

Staff
Posts: 1,051
Registered: ‎10-18-2015

Re: Reload vector layer after saving form

hi Khaled,

 

can you please clarify what you are trying to achieve? If you capture the geometry from wtihin the app it should be automatically updated. If you don't capture the geometry what should be updated on the map? Can you also include your definition (what type of action are you using? What type of trigger are you trying?).

 

Stefano

Stefano Turcato
Presale Engineer
Hexagon Geospatial
Frequent Contributor
Posts: 159
Registered: ‎01-14-2018

Re: Reload vector layer after saving form

Hi Stefano,

 

I will give you an example;

I have a points feature representing agricultural, residential categories.

I built a styleset for them; each category having its own style.

 

The user uses the application to define whether the point is agricultural or residential through using Workflow form and clicking save.

 

The problem I am facing is on the map, the point does not take it style -depending on what made by the user- until the user right-click on the layer in the legend and choose Reload.

 

So I want to combine the save action and the reload in one thing.

 

Khaled

Staff
Posts: 1,051
Registered: ‎10-18-2015

Re: Reload vector layer after saving form

Hi Khaled,

 

instead of using the standard "save" action you should use a scripting action and reload the layer in the postback. There is a post here:

 

https://community.hexagongeospatial.com/t5/Developer-Discussions/Save-action-in-workflow/m-p/25707#M...

 

HTH,

Stefano

 

 

Stefano Turcato
Presale Engineer
Hexagon Geospatial
Frequent Contributor
Posts: 159
Registered: ‎01-14-2018

Re: Reload vector layer after saving form

[ Edited ]

That's exactly what I wanted, thanks Stefano,

 

I made the following configuration:

<FormAction name="save" label="save" editable="true" visible="true" action="SCRIPT[(IG.submit('Form','Save').done(function (result) {  SC.Map.reloadLayers('points') }))]" />

inwhich IG.submit('Form','Save') is a default (Don't change 'Form' to your form name)

 

Thanks

Khaled