Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7101 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I need to create a screen to store MS Word documents by ID. What would be the best way to do that in terms of the table fields? Should I save those documents as binary files? Is there a way to store the paths to the files instead?

Any comments or responses will be appreciated.

Onnuri

  • 1 month later...
Posted

this is an old post but I found it looking for my answer so maybe someone looking for the answer to this will appreciate my reply.

this is a robust answer that gives you a lot more than just what you need but gives you a ready to expand upon solution.

two tables:

tblDocIDs

has auto-enter serial number field called "primk"

has number field called "documentID"

tblDocuments

has auto-enter serial number field called "primk"

has number field called "fkDocID"

has container field to house the file

go to the relationships tab on the same window where you define the tables, on this tab:

(you see tblDocuments and tblDocIDs ... keep them out of the way in the top left corner ... use this area to store base instances of the tables so you can see at a glance the tables in your database.)

click the new-table occurance button and add tblDocIDs as rgDocIDs

click the new-table occurance button and add tblDocuments as rgDocuments

drag from rgDocIDs primk field to rgDocuments fkDocID field ... this creates a relation drawn as a line between these two fields.

double click the equals sign on the relation line. Set to allow the creation and deletion of records in the column for rgDocuments.

close the database definitions window.

enter layout mode and create a new layout, based on the rgDocIDs table. Import all the table fields into the layout.

right click the primk field and under field behavior set it to not allow entry in browse mode. for a visiual queue that this is only for searching, change the color of the field as well.

add a portal to the layout, select the related table "rgDocuments". add a vertical scroll bar, and add the container field.

in the portal, beside the container, add a button with the label "delete". right click and specify button to Delete Portal Row.

add a button just above the portal with the label "new".

in scriptmaker make this script "newdocument":

If [ IsEmpty ( Get ( ScriptParameter ) ) ]

  Perform Script [ "newdocument" ; GetAsText ( rgDocIDs::primk ) ]

Else

  Go to Layout [ tblDocuments ]

  New Record/Request

  Set Field [ tblDocuments::fkDocID ; GetAsNumber ( Get ( ScriptParameter ) ) ]

  Commit Records/Requests

  Go to Layout [ original layout ]

End If

Right click the "new" button and specify button to Perform Script, selecting the newdocument script.

This topic is 7101 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.