Forum Discussion

Ginger_Main's avatar
Ginger_Main
New Contributor II
2 years ago

Reading Data Attachment Objects from a Data Attachment List

Hello All,

I am creating a confirmation rule with the following goal:

- Read data attachment text from from a V#Annotation field 

Due to my unfamiliarity with the DataAttachmentList object, I have been unsuccessful in utilizing this list within my rule. I wanted to reach out to the community and see if anyone could help correct my mistakes. My code for testing is as follows:

 

 

  • A guess would be that "List(Of Items)" does not match "DataAttachment". Try below

    For Each item As DataAttachment In CommentaryVar.Items
      Brapi.ErrorLog.LogMessage(si, item.Text)
    Next
    
    '' or just
    
    For Each item in api.Data.GetDataAttachments(.....
      Brapi.ErrorLog.LogMessage(si, item.Text)
    Next
    

    For future questions, including something like compiler output/error messages makes it easier to troubleshoot 🙂