gn:act_openAttachmentWithExternalApp
- Description
- Action is used to open a document from database.
- Action returns
- void
Action signatures
Open attachment
[gn:act_openAttachmentWithExternalApp]|[source,dataType,attachmentId]
Parameter Description source
source from where document id will be retrieved - Valid source:
dataType
dataType of file that is being opened. Data types supported can be found here - Valid source:
- hardcoded
attachmentId (optional)
internal id of attachment which is to be opened in case there are multiple attachments you can specify which one will be opened. If omitted first attachment that exists in row will be opened. - Valid target should be of datatype
text
Example 1
@+id/documentNumber
- id of widget
- ⤷
[gn:act_openAttachmentWithExternalApp]|[@+id/documentNumber,application/pdf]
- ⤷
variables.xml
<variable id="rowId" type="text">e0567dffe-7775-467c-8f56-6641a9ac3eb8</variable> <variable id="attachmentId" type="text">8dfce38e-e324-4d1f-9773-30274f4db270</variable>
screen.xml
<FrameLayout android:id="@+id/exampleFrame" android:layout_width="wrap_content" android:layout_height="wrap_content" android:visibility="gone" gn:act_set="[gn:act_openAttachmentWithExternalApp]|[@variable/rowId,image/png,@variable/attachmentId]" />
Example 2
@+id/abnahmenUbergabe_ubergabeprotokollDocumentId
- id of widget
- ⤷
[gn:act_openAttachmentWithExternalApp]|[@variable/abnahmenUbergabe_ubergabeprotokollDocumentId,application/pdf]
- ⤷
variables.xml
<variable id="abnahmenUbergabe_ubergabeprotokoll" type="documents" /> <variable id="abnahmenUbergabe_ubergabeprotokollDocumentId" type="text" />
screen.xml
<FrameLayout android:id="@+id/exampleFrame" android:layout_width="wrap_content" android:layout_height="wrap_content" android:visibility="gone" gn:act_set=" [gn:act_copyDataNew]|[@variable/abnahmenUbergabe_ubergabeprotokoll(0)(id),@variable/abnahmenUbergabe_ubergabeprotokollDocumentId], [gn:act_openAttachmentWithExternalApp]|[@variable/abnahmenUbergabe_ubergabeprotokollDocumentId,application/pdf]" />
Open attachment from another ginstr app
[gn:act_openAttachmentWithExternalApp]|[source,dataType,attachmentId,appId]
Parameter Description source
source from where document id will be retrieved - Valid source:
dataType
dataType of file that is being opened. Data types supported can be found here - Valid source:
- hardcoded
attachmentId (optional)
internal id of attachment which is to be opened in case there are multiple attachments you can specify which one will be opened. If omitted first attachment that exists in row will be opened. - Valid target should be of datatype
text
appId (optional)
ginstr app from where the document will be opened - Can be:
hardcoded
Example 1
@+id/documentNumber
- id of widget@variable/appId
- ginstr app id
- ⤷
[gn:act_openAttachmentWithExternalApp]|[@+id/documentNumber,application/pdf,,@variable/appId]
- ⤷
variables.xml
<variable id="rowId" type="text">e0567dffe-7775-467c-8f56-6641a9ac3eb8</variable> <variable id="attachmentId" type="text">8dfce38e-e324-4d1f-9773-30274f4db270</variable> <variable id="appId" type="text">IVRflatHandover</variable>
screen.xml
<FrameLayout android:id="@+id/exampleFrame" android:layout_width="wrap_content" android:layout_height="wrap_content" android:visibility="gone" gn:act_set="[gn:act_openAttachmentWithExternalApp]|[@variable/rowId,image/png,@variable/attachmentId,,@variable/appId]" />