Both these scripts are available for any destination table The source objects

Both these scripts are available for any destination

This preview shows page 7 - 9 out of 12 pages.

Both these scripts are available for any destination table. The source objects for a particular script can be from any table, so the script must examine the table using src.agtable before it can access any fields. Each attachment in database can store textual information (columns COMMENTSTR and SOURCE in table BT_DOCGROUPLINK). This text can be entered in a dialog box, which is, by default, shown for every attachment. The PRE_ADD_ATTACHMENT script can suppress the dialog box by setting myvar.opendestdlg to 0. (Note that this variable has a different meaning here than in the drag-and-drop scripts : despite the word “dest” in the variable name, the data edited in the dialog box is stored in the link table, not in the destination table.) The form of the dialog box depends on the source table; for example, with CM_IMAGE sources there are fields both for the caption and the image source, and default values for these are taken from certain metadata fields in the source object. The script cannot alter the dialog appearance or the default value logic. However, if the script modifies those fields where the default values are taken from, then these modified values are used as default instead of the original database values. The src and dest objects passed to PRE_ADD_ATTACHMENT are primarily meant for testing the object types and metadata values and thereby deciding whether the attachment is allowed or not. Changes done by PRE_ADD_ATTACHMENT to src or dest are not saved in database. Normally an option is provided to skip the dialog box for the remaining source documents if several documents are being attached at a time. If the user selects that option, no further dialog boxes are shown regardless of what the PRE_ADD_ATTACHMENT script returns in myvar.opendestdlg. However, by setting myvar.opendestdlg to 2 the script can remove the skipping option from every dialog box and thereby force the dialog box to appear for every source document. If the user is attaching several documents at a time, PRE_ADD_ATTACHMENT and the attachment dialog box are first run for every source document in turn, the dialog box being skipped if the user chose the skipping option or if the script set myvar.opendestdlg to 0. After processing all sources in this way, the attachment operations are executed in a single database transaction using the data obtained from the dialog boxes. During this phase ADD_ATTACHMENT_SCRIPT is called once for each source document that remains from the initial processing. Of the sources that the user originally tried, only part may remain in this phase if PRE_ADD_ATTACHMENT set myvar.result to 0 for some source or if the user pressed Cancel in some dialog box. For PRE_ADD_ATTACHMENT and ADD_ATTACHMENT_SCRIPT the dest object is the same for each script invocation when several attachments are done at a time, so if the script changes the dest fields, the changes are cumulative. The src and dest objects in ADD_ATTACHMENT_SCRIPT
Image of page 7
Anygraaf Neo System Configuration Guide Scripting
Image of page 8
Image of page 9

You've reached the end of your free preview.

Want to read all 12 pages?

  • Summer '18

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes
A+ icon
Ask Expert Tutors