OLENotes in Directory - Back Track all tables they are from.

I have a directory on the network that contains all the OLENotes (attachments) from Dynamics.  After extensive research, i have only identified only a few tables that contains the NOTEINDX value i need that ties back to the SY03900 table.  The tables i have identified are: RM00101. SOP30200, IV00101 and POP30300.  

Using the convert binary(binary(),Cast(dbo...)) function, i can identify the file names that are stored on the network by using the NOTEINDX value from the SY03900 table.  I currently have over 20,000 files in the OLENotes folder.  I now need to back track to the tables they are referenced to so i can get the information (Data side) that is associated to that attachment.

So basicallly, i should be able to tie back each of the files (20,000 +) to an assoicated table.
Who is Participating?
Victoria YudinConnect With a Mentor Owner / Dynamics GP ConsultantCommented:
You can find all the tables that have a field called NOTEINDX using this query (from http://victoriayudin.com/2010/04/23/how-to-find-all-sql-tables-with-a-column-name/):

   (SELECT name
    FROM sysobjects
    WHERE xtype = 'U')

In my sample install of GP 2010 this returns 244 tables.  However, there will also be cases where the note index is not called NOTEINDX.  For example, look at table POP10100 - there are 15 fields called PONOTIDS_1, PONOTIDS_2, etc. and each one represents a note index.  Even though you might only need to worry about one of these (as the others might point to notes elsewhere, like vendor, item, site, etc.), you still need to find out what each note index in tables like this is called.  I am not aware of any comprehensive listing of this.  And if you have any 3rd party products installed, this could complicate matters further.
What's the problem? Please give an example.
hiramqAuthor Commented:
We no longer use MS Dynamics and i need to extract all the attachments that were stored in the notes.  All the attachements have been converted into a binary file on the network.  I need to take those binary files and find out what tables they are referenced to.  So if i have a file named: 0012345, i should be able to convert that binary name and get the Noteindx value that is currently in the Sy03900 table and I NEED TO KNOW WHICH TABLE THE SAME NOTEINDX is linked to.  I have indentifed 4 tables but i am missing a few others.
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

But these 20,000 files are embedded objects, how will you open them?
hiramqAuthor Commented:
Ah, good question.  I am already in the works on creating a small program that will drag and drop the binary file into the Container using the Contain.exe file.  I am using send keys to perform this action.  I just need to work out a few bugs (If the container contains more than one attachment).  I have already identified 13,765 files (that link back to the appropriate tables that contain the NoteIndx value).  Dynamics contains so many tables so i was hoping for some insight on which tables contains the (noteIndx value) that associates the binary files that are stored on the network.
hiramqAuthor Commented:
The answer provided let me down the path i needed to trace back the tables that are associated to the binary OLENOTES.    I was able to map back the 20,406 olenotes to their corresponding tables.  I have a remaining 126 files to look for which i am sure are located in one of the POP tables.  Thanks for help.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.