GMSC Discussions

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
bw
Occasional Contributor
Posts: 11
Registered: ‎05-06-2016

Using triggers in modal form.

[ Edited ]

Hi,

 

i have following action in Parent Object:

 <FormAction name="EDIT_OGLEDZINY" label="Edytuj szczegóły oględzin"
					action="SCRIPT[IG.trigger({triggerNames:['SESSION'],urlParams:{rowId:{ROW.KOBRAKIID}}}).done(function(result)
					{IG.openSimpleModalForm({
					form:'KOBRAKI',
					id:{ROW.KOBRAKIID}, 
					closeAction: 'reloadFields', 
					closeActionParam:['ELEMENTY_TABELA']
					});})]" 
					type="row" image="ig-icon-edit"/>	

And it succesfully opens this form:

 

<Form name="KOBRAKI" label="Szczegóły obchodu" table="KOBRAKI" idfield="ID" customscript="CustomScript.js">
		<FormTab name="KOBRAKI_Tab" label=" ">
			<FormGroup name="KOBRAKI_Group" label=" ">
				<FormField name="ID" label="ID:" type="textfield" datatype="number" required="false" visible="true" maxlength="22" editable="false"/>
				<FormField name="KOID" label="KOID:" type="textfield" datatype="string" required="false" visible="true" maxlength="50" editable="false"/>
				<FormField name="NRROZTORU" label="Nr. rozjazdu/toru:" type="textfield" datatype="string" required="false" maxlength="50"/>
				<FormField name="DATAOGLEDZIN" label="Czas oględzin:" type="textfield" datatype="datetime" required="false" maxlength="15"/>
				<FormField name="OPIS" label="Braki i uszkodzenia:" type="textfield" datatype="string" required="false" maxlength="3000"/>
				<FormField name="ZADANIENAPRAWY" label="Zlecenia naprawy:" type="textfield" datatype="string" required="false" maxlength="2000"/>
				<FormField name="OSOBA" label="Osoba podpsiująca:" type="textfield" datatype="string" required="false" maxlength="200"/>
			</FormGroup>
		</FormTab>
		
		
		<FormAction name="Save_form" label="Zapisz istniejacy" visible="form[SQL[select case count(ID) when 0 then 0 else 1 end from CUPRUM.KOBRAKI where ID={FORM.ID}]]" type="form" 
		action="SCRIPT[IG.trigger({triggerNames:['ZAPISZ_KOBRAKI'],
		urlParams:{id:{FORM.ID},koid:{FORM.KOID},nrRoz:{FORM.NRROZTORU},dataOgl:{FORM.DATAOGLEDZIN}, opis:{FORM.OPIS},zadanie:{FORM.ZADANIENAPRAWY},osoba:{FORM.OSOBA}}})
		.done(function() {IG.closeModalForm();})]" />
			</Form>

</FormList>

When i press Save_button on this modal form it should execute this trigger:

 

<WorkflowTrigger name="ZAPISZ_KOBRAKI" type="SqlTrigger" method="action">
			<Param name="Sql" value="insert into kobraki  (ID,KOID,NRROZTORU,DATAOGLEDZIN,OPIS,ZADANIENAPRAWY,OSOBA) values ({REQUESTCONTEXT.id}, {REQUESTCONTEXT.koid}, {REQUESTCONTEXT.nrRoz}, {REQUESTCONTEXT.dataOgl}, {REQUESTCONTEXT.opis}, {REQUESTCONTEXT.zadanie}, {REQUESTCONTEXT.osoba}) "/>
		</WorkflowTrigger>

 

Unfortunately it raises error: 

ERROR - Controller Trigger has raised an exception in Action FireData.
System.InvalidOperationException: Cannot use FileUploadAttribute on an action without a DomainObject parameter.
   at Intergraph.Emea.Workflows.FileUploadAttribute.ActionExecuting(ActionExecutingContext filterContext).....

 Is it possible to use trigger from modal form? If so - then how?

If not - how can i save object from modal form without using IG.saveModalForm? Thats because i need to create ID value from database.

Highlighted
Frequent Contributor
Posts: 90
Registered: ‎10-13-2015

Re: Using triggers in modal form.

Hi, 

 

we use it without any problems, try to use IG.openModalForm instead of IG.openSimpleModalForm ...

 

Try to check this 

 

https://bitbucket.org/snippets/jhettler/oxrbg

 

Hope this helps.

 

Regards,

Jakub