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
Staff
Posts: 46
Registered: ‎02-16-2017
Accepted Solution

Creating New Geometry Records in Oracle without saving the form is erroring out

[ Edited ]

I"m trying to create a new record of building using the following:

 

<Form name="EditForm" label="Edit Form" editable="true" idfield="ID1" table="SINGAPORE.CADASTRAL_LAND_LOT">
<FormGeometry name="GEOMETRY" layer="SINGAPORE.CADASTRAL_LAND_LOT">
<NewActions>
<GeometryAction name="GE_NEWPOLYGON" isstartonload="true" label="New CADASTRAL_LAND_LOT"/>
</NewActions>
<EditActions>
<GeometryAction name="GE_MODIFY" label="Edit Polygon" isstartonload="true" />
</EditActions>
</FormGeometry>
<FormTab name="EditFormTab" label="Edit Form " editable="true" visible="true">
<FormGroup name="Cadastral" label="Cadastral" editable="true" visible="true">
<FormField name="ID1" editable="false" visible="true" datatype="number" required="true" persisted="true" saveinsession="false" type="textfield" />
<FormField name="LOT_KEY" label="LOT_KEY" editable="true" visible="true" datatype="string" required="false" persisted="true" saveinsession="false" type="textfield" />
<FormField name="INC_CRC" label="INC_CRC" editable="true" visible="true" datatype="string" required="false" persisted="true" saveinsession="false" type="textfield" />
<FormField name="OBJECTID" editable="true" visible="true" datatype="string" required="false" persisted="true" saveinsession="false" type="textfield" />
<FormField name="FMEL_UPD_D" editable="true" visible="true" datatype="date" required="false" persisted="true" saveinsession="false" type="textfield" />
<FormField name="SHAPE_AREA" editable="true" visible="true" datatype="number" required="false" persisted="true" saveinsession="false" type="textfield" />
<FormField name="SHAPE_LENG" label="SHAPE_LENG" editable="true" visible="true" datatype="number" required="false" persisted="true" saveinsession="false" type="textfield" />
<FormField name="Y_ADDR" label="Y_ADDR" editable="true" visible="true" datatype="number" required="false" persisted="true" saveinsession="false" type="textfield" />
<FormField name="X_ADDR" label="X_ADDR" editable="true" visible="true" datatype="number" required="false" persisted="true" saveinsession="false" type="textfield" />
</FormGroup>
</FormTab>

<FormAction name="CaptureGeometry" label="Capture" action="SCRIPT[IG.captureGeometry()]"></FormAction>
<FormAction name="Save" action="save" visible="form"></FormAction>
</Form>

<Form name="NewForm" inherits="EditForm">
<FormTab name="EditFormTab">
<FormGroup name="Cadastral">
<FormField name="ID1" visible="true" editable="false" datatype="number" type="textfield" persisted="true" defaultvalue="SQL[Select CADASTRAL_ID15.Nextval from Dual]" />
</FormGroup>
</FormTab>
</Form>

</FormList>

 

However, when I click on Capture without Saving the form first I keep getting the eror Sequence contains no elements. However, clicking on the Save does save the record and then I can proceed to create the new geometry and save it. This same workflow used to work fine on 2015 GMSC! I have upgraded to 2016SP2. This is using Oracle DB. (See the screenshot for the error). Any clue what is happening here? 

 

 

Staff
Posts: 71
Registered: ‎10-09-2015

Re: Creating New Geometry Records in Oracle without saving the form is erroring out

Hi Vishnu,

 

Please check out the "Oracle sequences (How To)".

 

=> In the form "NewForm" you do need to set the visibility of the ID field to false!

 

Regards,

Markus Holler
Product Line Director
Hexagon Geospatial
Staff
Posts: 46
Registered: ‎02-16-2017

Re: Creating New Geometry Records in Oracle without saving the form is erroring out

Hi Markus, 

 

I did try that, but I was still getting an error and I was not able to save the form (attribute only) because the ID1(primary key) was hidden. Attached is the error when I changed the ID1 visibility to false. And there seem to be no error logged anywhere. 

 

Thats the reason why I changed it to visible and see if the ID was being generated. 

 

thanks 
Vishnu

 

Technical Evangelist
Posts: 178
Registered: ‎03-03-2016

Re: Creating New Geometry Records in Oracle without saving the form is erroring out

Hi Vishnu,

 

the defaultvaluemode attribute was introduced some time ago to overcome those problems.

So the defaultvaluemode="onSave" and the defaultvalue="" should solve the problem regardless of the visibility.

 

defaultvaluemode handles the execution of e.g. the execution of the SQL statement placed in the defaultvalue="".

onSave means the value is fetched during the saving process. 

onLoad means the value is fetched when the form is displayed.

 

For fetching values from a sequence --> onSave is recommended over onLoad to avoid unused values of a sequence when the user hits cancel.

 

Staff
Posts: 46
Registered: ‎02-16-2017

Re: Creating New Geometry Records in Oracle without saving the form is erroring out

Thanks tpaul, Yes, I remember. (also figured I had misspelt onsave, after correcting it worked).

Vishnu

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