home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.tcs3.com
/
ftp.tcs3.com.tar
/
ftp.tcs3.com
/
DRIVERS
/
Audio
/
Office2010
/
ProPlus.WW
/
ProPsWW2.cab
/
PUBLICFUNCTIONS.JS5
< prev
next >
Wrap
Text File
|
2007-02-04
|
10KB
|
317 lines
// ****************************************************************************
// Name: PublicFunctions.js
//
// Description: functions available to Form and Macro scripts in the Forms Tool.
//
// Comments:
// All functions contained can be called by custom form or macro scripts.
// Contents may be changed in future versions.
// Please don't modify this file, as modifications may be overwritten.
//
// Copyright ⌐2006 Microsoft Corporation, All Rights Reserved.
// ****************************************************************************
// Globals used by various methods
var GrooveMessageBoxIcon_None = 0x0000;
var GrooveMessageBoxIcon_Exclamation = 0x0080;
var GrooveMessageBoxIcon_Warning = 0x0081;
var GrooveMessageBoxIcon_Information = 0x0100;
var GrooveMessageBoxIcon_Asterisk = 0x0101;
var GrooveMessageBoxIcon_Question = 0x0081;
var GrooveMessageBoxIcon_Stop = 0x0400;
var GrooveMessageBoxIcon_Error = 0x0401;
var GrooveMessageBoxIcon_Hand = 0x0402;
var GrooveDialogBoxResultCode_OK = 1;
var GrooveDialogBoxResultCode_Cancel = 2;
var GrooveFormsToolRole_Guest = 0x01;
var GrooveFormsToolRole_Participant = 0x02;
var GrooveFormsToolRole_Manager = 0x04;
var GrooveIntlDateFormatStyle_Full = 0;
var GrooveIntlDateFormatStyle_Long = 1;
var GrooveIntlDateFormatStyle_Medium = 2;
var GrooveIntlDateFormatStyle_Short = 3;
var GrooveIntlDateFormatStyle_Default = GrooveIntlDateFormatStyle_Medium;
var GrooveFormsToolLinkType_None = 0;
var GrooveFormsToolLinkType_Record = 1;
var GrooveFormsToolLinkType_View = 2;
var GrooveFormsToolLinkType_Tool = 3;
// This function returns the App object. The App object implements various
// functions as defined by the IGrooveFormsToolUIDelegate interface. This
// object provides functions and properties which are useful when building
// applications which need to interact with the Groove platform.
function GetApp()
{
return int_GetApp();
}
// This function returns an IGrooveBSTREnum which can be used as a parameter
// in several calls on the application.
function CreateBSTREnumFromArray(i_StringArray)
{
return int_CreateBSTREnumFromArray(i_StringArray);
}
// This function will dynamically set the text of a field label on a form.
function SetFieldLabel(i_FieldName, i_Label)
{
int_SetFieldLabel(i_FieldName, i_Label);
}
// This function will dynamically show a field and its label on a form.
// i_bShow is an optional argument and will default to true.
function ShowField(i_FieldName, i_bShow)
{
if (typeof i_bShow == "undefined")
i_bShow = true;
int_HideField(i_FieldName, !i_bShow);
}
// This function will dynamically hide a field and its label on a form.
// i_bHide is an optional argument and will default to true.
function HideField(i_FieldName, i_bHide)
{
if (typeof i_bHide == "undefined")
i_bHide = true;
int_HideField(i_FieldName, i_bHide);
}
// This function will dynamically enable a field on a form.
// i_bEnable is an optional argument and will default to true.
function EnableField(i_FieldName, i_bEnable)
{
if (typeof i_bEnable == "undefined")
i_bEnable = true;
int_DisableField(i_FieldName, !i_bEnable);
}
// This function will dynamically disable a field on a form.
// i_bDisable is an optional argument and will default to true.
function DisableField(i_FieldName, i_bDisable)
{
if (typeof i_bDisable == "undefined")
i_bDisable = true;
int_DisableField(i_FieldName, i_bDisable);
}
// This function will refresh all visible error icons on the page. This should
// be used if there is any code that dynamically changes the layout of the page
// and there are fields on the form that have any validation (i.e. "Required",
// "Min/Max", or text validation). Calling this will make sure that all of the
// error icons display in the proper location.
function RefreshErrorIcons()
{
int_RefreshErrorIcons();
}
// This function will refresh the contents of the preview pane from the record.
function RefreshPreviewPane()
{
int_RefreshPreviewPane();
}
// Returns true if record is new, false otherwise.
function GetIsNew()
{
return int_GetIsNew();
}
// Returns true if form opened in search dialog; false otherwise.
function GetIsSearch()
{
return int_GetIsSearch();
}
// Returns true if form open in preview layout; false otherwise.
function GetIsFormPreview()
{
return int_GetIsFormPreview();
}
// Returns true if form opened in preview pane; false otherwise.
function GetIsPreviewPane()
{
return int_GetIsPreviewPane();
}
// Returns true if record is read-only; false otherwise.
function GetIsReadOnly()
{
return int_GetIsReadOnly();
}
// Returns true is record is a response; false otherwise.
function GetIsResponse()
{
return int_GetIsResponse();
}
// Returns true if record is versioned; false otherwise.
function GetIsVersioned()
{
return int_GetIsVersioned();
}
// Returns the ID of the current record.
function GetRecordID()
{
return int_GetRecordID();
}
// Returns the ID of the current form.
function GetFormID()
{
return int_GetFormID();
}
// Returns the ID of the record that was selected when a new record is created.
function GetSelectedID()
{
return int_GetSelectedID();
}
// Return the current record as an IGrooveFormsToolFormRecord.
function GetFormRecord()
{
return int_GetFormRecord();
}
// This function will open the current record for edit (if allowed) in
// full-screen mode if it is currently being viewed in the preview pane.
function OpenThisRecord()
{
int_OpenThisRecord();
}
// This function will return the current value of any HTML field as a
// string. It will not work on Rich Text or Attachments fields.
function GetHTMLFieldValue(i_FieldName)
{
return int_GetHTMLFieldValue(i_FieldName);
}
// This function will return the current value of any numeric field as
// a number. The only field types it will work with is Number, Unformatted
// Number, and Currency.
function GetHTMLFieldValueAsNumber(i_FieldName)
{
return int_GetHTMLFieldValueAsNumber(i_FieldName);
}
// This function will return the current value of any Date or Date/Time
// field as a number in millseconds. This can be used to create a new
// JavaScript date object to get more in depth information.
function GetHTMLFieldValueAsDate(i_FieldName)
{
return int_GetHTMLFieldValueAsDate(i_FieldName);
}
// This function will set the current value of any HTML field as a string.
// It will not work on Rich Text or Attachments fields.
function SetHTMLFieldValue(i_FieldName, i_Value)
{
int_SetHTMLFieldValue(i_FieldName, i_Value);
}
// This function will set the current value of any numeric field as a
// number. The only field types it will work with is Number, Unformatted
// Number, and Currency.
function SetHTMLFieldValueAsNumber(i_FieldName, i_Value)
{
int_SetHTMLFieldValueAsNumber(i_FieldName, i_Value);
}
// This function will set the current value of any Date or Date/Time field.
// The value passed in should be a number representing the number of milliseconds
// past the date 1/1/1970 00:00.
function SetHTMLFieldValueAsDate(i_FieldName, i_Value)
{
int_SetHTMLFieldValueAsDate(i_FieldName, i_Value);
}
// This is a utility function to check for the existence of any function that
// a script writer might want to call. It is a good idea to make this call for
// any methods defined after this one for backwards compatibility. Pass in the
// name of the method you want to check, as a string.
function DoesFunctionExist(i_FunctionName)
{
return int_DoesFunctionExist(i_FunctionName);
}
// This function will take an enum, usually returned from a lookup, and insert
// the values into a drop-down list or list box field. The third argument,
// i_bAllowDuplicates, is optional, and is false by default. You must call
// DoesFunctionExist before using this method as it was added in 3.0f.
function InsertBSTREnumIntoListField(i_BSTREnum, i_FieldName, i_bAllowDuplicates)
{
int_InsertBSTREnumIntoListField(i_BSTREnum, i_FieldName, i_bAllowDuplicates);
}
// This function will determine if a date's value, in milliseconds, is valid.
function IsValidDate(i_Value)
{
return int_IsValidDate(i_Value);
}
// This function creates a unique ID. The ID returned is the same type of ID
// generated when using a field whose initial value is set to be 'Unique' in the
// Forms Designer.
function CreateUniqueID()
{
return int_getUniqueID();
}
// This functions should be used after calling GetApp().SaveCurrentFormData()
// to determine if there were validation errors that the user must fix.
function HasValidationErrors()
{
return int_HasValidationErrors();
}
// This function will set the current value of any contact field on the form.
// The contact is set to empty if the i_Contact value passed in is null.
function SetContactFieldValue(i_FieldName, i_Contact)
{
int_SetContactFieldValue(i_FieldName, i_Contact);
}
// This function will return the current value of any contact field on the form.
// If the contact field is empty, it will return null.
function GetContactFieldValue(i_FieldName)
{
return int_GetContactFieldValue(i_FieldName);
}
// This function will return the number of attachments in the attachments field on the form.
// If there is no attachments field on the form, it will return null.
function GetAttachmentCount()
{
return int_GetAttachmentCount();
}
// This function will bring up the 'Add Attachments' dialog.
// If there is no attachments field on the form, the dialog will fail to load
function LoadAddAttachmentDialog()
{
int_LoadAddAttachmentDialog();
}
// This function will return an IGrooveNameValueEnum containing the names and sizes
// of attached files in the attachment field on the form.
// If there is no attachments field on the form, it will return null.
function CreateAttachmentsNameSizeEnum()
{
return int_CreateAttachmentsNameSizeEnum();
}