11-11-2018 12:49 AM
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
Solved! Go to Solution.
11-11-2018 03:30 AM
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
11-11-2018 06:38 AM
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
11-11-2018 08:27 AM
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:
HTH,
Stefano
11-11-2018 11:31 PM - edited 11-12-2018 12:21 AM
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