Skip to main content

Delete Attachments?

Comments

5 comments

  • Permanently deleted user

    how about this?

    (1) Declare a variable with the type "Array of String" , ie. String[]?

    (2) assign to the variable using the Cast <T> Activity with the value like '{string.Format("{0}", idObj)' where idObj is the attachment id with Object type you got.

    0
  • Ryan Kelley

    Thanks - but no luck. I got an invalid Cast error

    Here's what I tried... maybe you can correct me where I went wrong?

    SelectedAttachmentID = (obj variable of attachment from form) 

    Declared variable y as System.String[]

    Casting (type: <String[]> where y =  (string.Format("{0}", SelectedAttachmentID))

    ?

    Ryan

    0
  • Permanently deleted user

    Ryan,

    Check if your AttachmentID is existing valid one value first.

    This is my testing workflow.

    <Activity mc:Ignorable="sap sads" x:Class="{x:Null}" sap:VirtualizedContainerService.HintSize="304,465" mva:VisualBasic.Settings="Assembly references and imported namespaces serialized as XML namespaces"

     

     xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities"

     

     xmlns:eac="clr-namespace:ESRI.ArcGIS.Client;assembly=ESRI.ArcGIS.Client"

     

     xmlns:eacg="clr-namespace:ESRI.ArcGIS.Client.Geometry;assembly=ESRI.ArcGIS.Client"

     

     xmlns:eact="clr-namespace:ESRI.ArcGIS.Client.Tasks;assembly=ESRI.ArcGIS.Client"

     

     xmlns:gce="clr-namespace:Geocortex.Core.Extensions;assembly=Geocortex.Core"

     

     xmlns:gfc="clr-namespace:Geocortex.Forms.Client;assembly=Geocortex.EssentialsWpfApi"

     

     xmlns:gfci="clr-namespace:Geocortex.Forms.Client.Items;assembly=Geocortex.EssentialsWpfApi"

     

     xmlns:gr="clr-namespace:Geocortex.Reporting;assembly=Geocortex.Reporting"

     

     xmlns:gwa="clr-namespace:Geocortex.Workflow.Activities;assembly=Geocortex.Workflow"

     

     xmlns:gwa1="clr-namespace:Geocortex.Workflow.Activities;assembly=Geocortex.Workflow.Activities"

     

     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

     

     xmlns:mva="clr-namespace:Microsoft.VisualBasic.Activities;assembly=System.Activities"

     

     xmlns:s="clr-namespace:System;assembly=System.Core"

     

     xmlns:s1="clr-namespace:System;assembly=System"

     

     xmlns:s2="clr-namespace:System;assembly=mscorlib"

     

     xmlns:s3="clr-namespace:System;assembly=System.Reactive.Core"

     

     xmlns:sa="clr-namespace:System.Activities;assembly=System.Activities"

     

     xmlns:sads="http://schemas.microsoft.com/netfx/2010/xaml/activities/debugger"

     

     xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation"

     

     xmlns:scg="clr-namespace:System.Collections.Generic;assembly=mscorlib"

     

     xmlns:sl="clr-namespace:System.Linq;assembly=System.Core"

     

     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

     

      <Sequence sap:VirtualizedContainerService.HintSize="264,385" mva:VisualBasic.Settings="Assembly references and imported namespaces serialized as XML namespaces">

     

        <Sequence.Variables>

     

          <Variable x:TypeArguments="x:Object" Name="idObj" />

     

          <Variable x:TypeArguments="s2:String[]" Name="idArray" />

     

        </Sequence.Variables>

     

        <sap:WorkflowViewStateService.ViewState>

     

          <scg:Dictionary x:TypeArguments="x:String, x:Object">

     

            <x:Boolean x:Key="IsExpanded">True</x:Boolean>

     

          </scg:Dictionary>

     

        </sap:WorkflowViewStateService.ViewState>

     

        <gwa1:Cast x:TypeArguments="x:Object" sap:VirtualizedContainerService.HintSize="242,60" To="[idObj]">

     

          <gwa1:Cast.Value>

     

            <InArgument x:TypeArguments="x:Object">["1"]</InArgument>

     

          </gwa1:Cast.Value>

     

        </gwa1:Cast>

     

        <gwa1:Cast x:TypeArguments="s2:String[]" sap:VirtualizedContainerService.HintSize="242,60" To="[idArray]">

     

          <gwa1:Cast.Value>

     

            <InArgument x:TypeArguments="s2:String[]">[{string.Format("{0}", idObj)}]</InArgument>

     

          </gwa1:Cast.Value>

     

        </gwa1:Cast>

     

        <WriteLine sap:VirtualizedContainerService.HintSize="242,61" Text="[idArray(0)]" />

     

      </Sequence>

     

    </Activity>
    0
  • Permanently deleted user

     

    >

    Casting (type: <String[]> where y =  (string.Format("{0}", SelectedAttachmentID))

     

    Should be 

    Casting (type: <String[]> where y =  {string.Format("{0}", SelectedAttachmentID)}

     

    Use Curly brace ({})

    0
  • Ryan Kelley

    Thank you! That did work. Your original email suggested using the syntax:  '{string.Format("{0}", idObj)'... no curly brace at the end, so I made some assumptions.

    Ryan

    0

Please sign in to leave a comment.