Hi Folks!
Launching a script from a generated group linked to a service - visio assistance.
I am looking to see if it is possible to launch an Automation script that is inside a generated shape (group) from a list of services whilst passing in service information as a script parameter.
Current Situation:
- I have a list of services that 3we are using to generate groups of shapes i.e. service_1;service_2;service_3
- Currently, these shapes set a variable on click which I use elsewhere on a visio page
New Changes:
- Adding a new Shape inside the group
- Linking this shape to an Automation Script via execute
- Adding script params such as [this serviceid] to the shape doing the execute.
The problem I seem to be having is that if I want to use the service information in the variable, I need to bring in ForcePropertyFromParent, but in doing so this is linking the shape that I want to use to trigger the script to the associated service which then means that the shape will open the cube card for the service and not launch the script. The inverse, AllowInheritance=False of NoCopyElementProperty disable he link as would be expected but then mean that I can no longer access the service name property that I need to trigger the script correctly
Is there any way that I can specifically disable the linkage to the card on button press of the shape whilst still maintaining the link to the service so that I can use the properties as placeholders in the shape data for execution?
I have experimented with ParentTableIndex etc however I don't think this is availale to me as I am generating based on services in a list not from the table row.
Any pointers would be greatly appreciated!
Many thanks
Oliver
Hi Oliver,
I'm glad to see your heading already in the right direction as this is a more advanced Visio topic that requires a good understanding of how things are linked.
We have the context of the 'Shape'. Typically this is done through Shape Data such as 'Element', 'View', or dynamic shapes as in your case. That means the shape is enhanced with data linked to the object. By using the 'AllowInheritance=False' Option, you can remove the link and therefore the context.
The placeholders (e.g. [this element], [this elementid], [property:x]) though are in another context typically. By default they are linked to the object of the card where your Visio is linked to. By using the 'ForceX' properties you can changed the context for these placeholders (and only these placeholders).
So - as you can see - depending on the context, you will have to define the correct settings to be able to make it work. In your case, you have a bit of a corner case. The Execute Shape Data is also considered a new context since it then links to either a parameter set or a automation script execution. That means you will need the 'AllowInheritance=False' and for the placeholder [this serviceid], you will need the 'ForcePropertyFromParent' as the context of parent shape is the service context your looking for.
Something that you need to know though is to also use the 'Enabled' -> True to enable the linking.
Kind Regards,
Jarno

Thank you Jarno, this is perfect and works as expected!
All the best
Oliver