Home > Forum > Rules, JS, SQL > Passing Instance ID using Hyperlink button with StartElement

Passing Instance ID using Hyperlink button with StartElement
0

Hello all,

I'm trying to set up a button to start another workflow but I want to pass the current instance ID so I can relate the two instances.

I'm using the info from Webcon but I don't know how to pass the ID:
<div style="margin-top:30px;">
<div style="margin-bottom:30px;"><button style="background-color: #DAA520; padding: 10px 25px;font-weight: bold;font-family: Helvetica;font-size:18px;
" class="fr-rounded fr-large" onclick="StartElementInNewWindow(54,54, 'AttText47=' + encodeURIComponent('WFD_ID'))">
Legal Request Process</button></div>
</div>

Using this, I'm basically writing WFD_ID in the destination field.
Does anyone know how to get this working=
Thank you

MVP

Hi Andreia,

I'm not sure whether you copied the generated html from the browser here, the one from the expression editor when you clicked on show, or the actual expression editor value.

If you copy this one to the expression editor it should work fine:
<div style="margin-top:30px;">
<div style="margin-bottom:30px;"><button style="background-color: #DAA520; padding: 10px 25px;font-weight: bold;font-family: Helvetica;font-size:18px;
" class="fr-rounded fr-large" onclick="StartElementInNewWindow(#{WF:54}#,#{DT:54}#, 'AttText47=' + encodeURIComponent('#{WFD_ID}#'))">
Legal Request Process</button></div>
</div

Make sure that the target field is either set to editable or "Read only (cannot be modified except by JavasSript).

Best regards,
Daniel