Skip to main content

Delete attachment in HTML5 Viewer

Comments

13 comments

  • Permanently deleted user

    +1

    0
  • Permanently deleted user

    +1

    I am having the same problem. Cannot delete attachments.

    0
  • Ryan Kelley

    I have no problem doing this in HTML5.

    1. Cast your attachment (object) to a System.String[] variable. Ex: strArrayAttachmentVar = {string.Format("{0}", <obj variable for attachmnet>)}. So, if you have a listbox showing all available attachments, the one selected would be your object.

    2. Delete Attachment Activity: your Attachment Ids param = your variable from above (ie. strArrayAttachmentVar). The other params should be intuitive.

    0
  • Ryan Kelley

    Sorry... this is all workflow driven. I am subscribed to too many forums;)

    0
  • Permanently deleted user

    Thank you, Ryan. I am a newbie to workflows. I was hoping that it would be an out of the box function in the HTML5 viewer. I guess not yet. For now with the out of the box function, users can add attachmetns to the feature, but they cannot remove/delete attachments. That is probably why you built the workflow. Would you would be willing to share your workflow? Thanks, agian.  

    0
  • Ryan Kelley

    I'll try and get out a sample when I have some time... though, I think I found a sample originally on the workflow forum - you may want to check there first. 

    We typically don't do any editing with the out of the box tools and almost exclusively use workflows, with a few exceptions.

    0
  • Permanently deleted user

    Ryan, I donwloaded the "attachment" workflow from the forum. But I could not get it to work. When I try to run in in the viewer, it tells me that I don't have attachments configured on any layers? Thanks. 

    0
  • Ryan Kelley

    Nataliya-

    Can you please send me the form post url where you grabbed the attachment sample?

    Ryan

    0
  • Permanently deleted user

    Ryan,

    I downloaded it from code gallery:

    https://support.geocortex.com/attachment-manager-workflow

    0
  • Permanently deleted user

    Thank you, very much. I got it to work. However, in current workflow all documents get attached to one feature in my feature class, the feature that I referenced in the workflow by "ObjectID = 0000". With this workflow is it possible to modify it so that the end user selects a feature on the map and attaches docs to the selected feature?

    0
  • Ryan Kelley

    Yes, you can certainly do all of that... You just need to be able to select the feature of interest using other workflow activities that get the geometry, and put the geometry into the query task to retrieve the OBJECTID of the feature of interest, which you wold feed into the initial Query Task in the sample I provided. If you get stuck I can probably put something together next week.

    0
  • John Nerge

     

    Any chance you could repost your workflow, Ryan? It looks like it got cut off partway through. Must have happened when Latitude decided to update the forum in September.
    0
  • Permanently deleted user
    Ryan, can yo uplease post your workflow again, as John suggested it looks like it's been cut off, not working for me when I save it as .xaml

     

    I tried the Attachment Manager Workflow and I get the following error when running it:

     

    _img_ alt="User-added image" src="https://latitudegeo--c.na53.content.force.com/servlet/rtaImage?eid=907f2000000fxvc&feoid=Body&refid=0EMf2000000kA2O"_/_img_

     

    I have checked the query task in the workflow but I can't figure out what the error is referring to.
    0

Please sign in to leave a comment.