Hexagon Geospatial
MENU

GeoMedia Smart Client

GeoMedia Smart Client community discussion board is where you can create, contribute and share information and knowledge in regards to configuring as well as working with GeoMedia Smart Client. Find your answers, share your knowledge and help build a strong GeoMedia Smart Client community.
Showing results for 
Search instead for 
Do you mean 
Reply
Contributor
Posts: 46
Registered: ‎06-18-2018
Accepted Solution

Save form field value when persisted mode is false

Hi,

 

I have a data entry form in my workflow. The form is bounded to a table. All the fields correspond to columns of the table. However for 2 fields 'Updated By' and 'Updated Date', I set persisted mode is false (these fields non editable). So, that I am not able to save these 2 fields. Please let me know, how I can save these 2 fields on save. For updated By, I am trying to save USER.NAME.

 

Thanks & Regards,
Anil

Highlighted
Frequent Contributor
Posts: 112
Registered: ‎04-05-2016

Re: Save form field value when persisted mode is false

If you set persisted to false it means the field is not synchronized with a corresponding column in your database. In other words: It doesn't read the value of this field from database and it also doesn't write on save.

 

Where do you want to save your values to?

Contributor
Posts: 46
Registered: ‎06-18-2018

Re: Save form field value when persisted mode is false

[ Edited ]

Hi,

 

I have a normal standard data entry form with save action.

Along with the form data that the user updates, I also want to autoupdate 'UpdatedUser' and 'UpdatedDate' into the same table when the user clicks save.

 

What is the best approach to accomplish this?

 

Regards,

Anil

Staff
Posts: 1,015
Registered: ‎10-19-2015

Re: Save form field value when persisted mode is false

hi,

 

you have to set persisted="true" together with override="true" and set a proper value for defaultvalue. As an alternative you can always use a trigger to set a specific value after you posted data back.

 

Stefano

Stefano Turcato
Presale Engineer
Hexagon Geospatial
Contributor
Posts: 46
Registered: ‎06-18-2018

Re: Save form field value when persisted mode is false

Hi Stefano,

 

For the 'UpdatedBy' field, I set default value as {USER.NAME}. Persistance='true' and override='true'. 

But everytime when form loads, it shows value from database instead of default value.

 

Regards,

Anil

Staff
Posts: 1,015
Registered: ‎10-19-2015

Re: Save form field value when persisted mode is false

hi Anil,

 

I guess it's a bug, please open a support ticket.

In then meantime you can quickly do the same using a trigger.

 

Stefano

Stefano Turcato
Presale Engineer
Hexagon Geospatial
Contributor
Posts: 46
Registered: ‎06-18-2018

Re: Save form field value when persisted mode is false

Hi Stefano,

 

It is working now. I made visible mode of the field to false and now the override is working.

 

However, we would like to try other way you suggested - using the post back trigger.

I made a sql trigger to update 'UserName' and 'Date'. How do you call this trigger after user clicks save. Because by default, save action updates the form data to the database and form closes.

 

Thanks & Regards,

Anil

 

 

 

 

Staff
Posts: 1,015
Registered: ‎10-19-2015

Re: Save form field value when persisted mode is false

it depends on the type of aciton you are using:

 

  • if it is a simple save or IG.captureGeometry you can use an after trigger
  • if it is any script action you would need to use an action trigger and call the IG.trigger method in your scripting action

 

Stefano Turcato
Presale Engineer
Hexagon Geospatial
Technical Evangelist
Posts: 1,063
Registered: ‎09-11-2015

Re: Save form field value when persisted mode is false

It seems like the "override" behavior is by design - it will work only together with visible="false". See the note for override e.g. here:

https://hexagongeospatial.fluidtopics.net/reader/rMZAmliqhWp7LKakCy9Pig/692seVmG8XBykyuPwNA11g

 

Jan Neumann
Post Sales Engineer Web Applications
Hexagon Geospatial

Contributor
Posts: 46
Registered: ‎06-18-2018

Re: Save form field value when persisted mode is false

Thanks Stefano and Jan,

 

We are able to save 'UpdatedBy' and 'UpdatedBy' by setting visible='false' persistence='true' and set default value for field.

 

Also, as Stefano suggested write a sql trigger to update the fields with 'after' mode.

 

Also, we are able to do the same by calling a trigger with default save as below:

 

IG.submit('Form','Save').done(function(result){IG.trigger({triggerNames:['trgUpdateDate']})}).

 

Thanks & Regards,

Anil

 

Do you need immediate support?
If you encounter a critical issue and need immediate assistance please submit a Service Request through our Support Portal.