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.JS4 < prev    next >
Text File  |  2007-02-04  |  9KB  |  278 lines

  1. // ****************************************************************************
  2. // Name: PublicFunctions.js
  3. //
  4. // Description: functions available to Form and Macro scripts in the Forms Tool.
  5. //
  6. // Comments:
  7. // All functions contained can be called by custom form or macro scripts.
  8. // Contents may be changed in future versions.  
  9. // Please don't modify this file, as modifications may be overwritten.
  10. //
  11. // Copyright ⌐2006 Microsoft Corporation,  All Rights Reserved.
  12. // ****************************************************************************
  13.  
  14. // Globals used by various methods
  15. var GrooveMessageBoxIcon_None = 0x0000;
  16. var GrooveMessageBoxIcon_Exclamation = 0x0080;
  17. var GrooveMessageBoxIcon_Warning = 0x0081;
  18. var GrooveMessageBoxIcon_Information = 0x0100;
  19. var GrooveMessageBoxIcon_Asterisk = 0x0101;
  20. var GrooveMessageBoxIcon_Question = 0x0081;
  21. var GrooveMessageBoxIcon_Stop = 0x0400;
  22. var GrooveMessageBoxIcon_Error = 0x0401;
  23. var GrooveMessageBoxIcon_Hand = 0x0402;
  24.  
  25. var GrooveDialogBoxResultCode_OK = 1;
  26. var GrooveDialogBoxResultCode_Cancel = 2;
  27.  
  28. var GrooveFormsToolRole_Guest = 0x01;
  29. var GrooveFormsToolRole_Participant = 0x02;
  30. var GrooveFormsToolRole_Manager = 0x04;
  31.  
  32. var GrooveIntlDateFormatStyle_Full = 0;
  33. var GrooveIntlDateFormatStyle_Long = 1;
  34. var GrooveIntlDateFormatStyle_Medium = 2;
  35. var GrooveIntlDateFormatStyle_Short = 3;
  36. var GrooveIntlDateFormatStyle_Default = GrooveIntlDateFormatStyle_Medium;
  37.  
  38. var GrooveFormsToolLinkType_None = 0;
  39. var GrooveFormsToolLinkType_Record = 1;
  40. var GrooveFormsToolLinkType_View = 2;
  41. var GrooveFormsToolLinkType_Tool = 3;
  42.  
  43.  
  44. // This function returns the App object. The App object implements various
  45. // functions as defined by the IGrooveFormsToolUIDelegate interface. This
  46. // object provides functions and properties which are useful when building
  47. // applications which need to interact with the Groove platform.
  48. function GetApp()
  49. {
  50.     return int_GetApp();
  51. }
  52.  
  53. // This function returns an IGrooveBSTREnum which can be used as a parameter
  54. // in several calls on the application.
  55. function CreateBSTREnumFromArray(i_StringArray)
  56. {
  57.     return int_CreateBSTREnumFromArray(i_StringArray);
  58. }
  59.  
  60. // This function will dynamically set the text of a field label on a form.
  61. function SetFieldLabel(i_FieldName, i_Label)
  62. {
  63.     int_SetFieldLabel(i_FieldName, i_Label);
  64. }
  65.  
  66. // This function will dynamically show a field and its label on a form.
  67. // i_bShow is an optional argument and will default to true.
  68. function ShowField(i_FieldName, i_bShow)
  69. {
  70.     if (typeof i_bShow == "undefined")
  71.         i_bShow = true;
  72.  
  73.     int_HideField(i_FieldName, !i_bShow);
  74. }
  75.  
  76. // This function will dynamically hide a field and its label on a form.
  77. // i_bHide is an optional argument and will default to true.
  78. function HideField(i_FieldName, i_bHide)
  79. {
  80.     if (typeof i_bHide == "undefined")
  81.         i_bHide = true;
  82.  
  83.     int_HideField(i_FieldName, i_bHide);
  84. }
  85.  
  86. // This function will dynamically enable a field on a form.
  87. // i_bEnable is an optional argument and will default to true.
  88. function EnableField(i_FieldName, i_bEnable)
  89. {
  90.     if (typeof i_bEnable == "undefined")
  91.         i_bEnable = true;
  92.  
  93.     int_DisableField(i_FieldName, !i_bEnable);
  94. }
  95.  
  96. // This function will dynamically disable a field on a form.
  97. // i_bDisable is an optional argument and will default to true.
  98. function DisableField(i_FieldName, i_bDisable)
  99. {
  100.     if (typeof i_bDisable == "undefined")
  101.         i_bDisable = true;
  102.  
  103.     int_DisableField(i_FieldName, i_bDisable);
  104. }
  105.  
  106. // This function will refresh all visible error icons on the page. This should
  107. // be used if there is any code that dynamically changes the layout of the page
  108. // and there are fields on the form that have any validation (i.e. "Required",
  109. // "Min/Max", or text validation). Calling this will make sure that all of the
  110. // error icons display in the proper location.
  111. function RefreshErrorIcons()
  112. {
  113.     int_RefreshErrorIcons();
  114. }
  115.  
  116. // This function will refresh the contents of the preview pane from the record.
  117. function RefreshPreviewPane()
  118. {
  119.     int_RefreshPreviewPane();
  120. }
  121.  
  122.  
  123. // Returns true if record is new, false otherwise.
  124. function GetIsNew()
  125. {
  126.     return int_GetIsNew();
  127. }
  128.  
  129. // Returns true if form opened in search dialog; false otherwise.
  130. function GetIsSearch()
  131. {
  132.     return int_GetIsSearch();
  133. }
  134.  
  135. // Returns true if form open in preview layout; false otherwise.
  136. function GetIsFormPreview()
  137. {
  138.     return int_GetIsFormPreview();
  139. }
  140.  
  141. // Returns true if form opened in preview pane; false otherwise.
  142. function GetIsPreviewPane()
  143. {
  144.     return int_GetIsPreviewPane();
  145. }
  146.  
  147. // Returns true if record is read-only; false otherwise.
  148. function GetIsReadOnly()
  149. {
  150.     return int_GetIsReadOnly();
  151. }
  152.  
  153. // Returns true is record is a response; false otherwise.
  154. function GetIsResponse()
  155. {
  156.     return int_GetIsResponse();
  157. }
  158.  
  159. // Returns true if record is versioned; false otherwise.
  160. function GetIsVersioned()
  161. {
  162.     return int_GetIsVersioned();
  163. }
  164.  
  165. // Returns the ID of the current record.
  166. function GetRecordID()
  167. {
  168.     return int_GetRecordID();
  169. }
  170.  
  171. // Returns the ID of the current form.
  172. function GetFormID()
  173. {
  174.     return int_GetFormID();
  175. }
  176.  
  177. // Returns the ID of the record that was selected when a new record is created.
  178. function GetSelectedID()
  179. {
  180.     return int_GetSelectedID();
  181. }
  182.  
  183. // Return the current record as an IGrooveFormsToolFormRecord.
  184. function GetFormRecord()
  185. {
  186.     return int_GetFormRecord();
  187. }
  188.  
  189.  
  190. // This function will open the current record for edit (if allowed) in
  191. // full-screen mode if it is currently being viewed in the preview pane.
  192. function OpenThisRecord()
  193. {
  194.     int_OpenThisRecord();
  195. }
  196.  
  197. // This function will return the current value of any HTML field as a
  198. // string. It will not work on Rich Text or Attachments fields.
  199. function GetHTMLFieldValue(i_FieldName)
  200. {
  201.     return int_GetHTMLFieldValue(i_FieldName);
  202. }
  203.  
  204. // This function will return the current value of any numeric field as
  205. // a number. The only field types it will work with is Number, Unformatted
  206. // Number, and Currency.
  207. function GetHTMLFieldValueAsNumber(i_FieldName)
  208. {
  209.     return int_GetHTMLFieldValueAsNumber(i_FieldName);
  210. }
  211.  
  212. // This function will set the current value of any HTML field as a string.
  213. // It will not work on Rich Text or Attachments fields.
  214. function SetHTMLFieldValue(i_FieldName, i_Value)
  215. {
  216.     int_SetHTMLFieldValue(i_FieldName, i_Value);
  217. }
  218.  
  219. // This function will set the current value of any numeric field as a
  220. // number. The only field types it will work with is Number, Unformatted
  221. // Number, and Currency.
  222. function SetHTMLFieldValueAsNumber(i_FieldName, i_Value)
  223. {
  224.     int_SetHTMLFieldValueAsNumber(i_FieldName, i_Value);
  225. }
  226.  
  227. // This is a utility function to check for the existence of any function that
  228. // a script writer might want to call. It is a good idea to make this call for
  229. // any methods defined after this one for backwards compatibility. Pass in the
  230. // name of the method you want to check, as a string.
  231. function DoesFunctionExist(i_FunctionName)
  232. {
  233.     return int_DoesFunctionExist(i_FunctionName);
  234. }
  235.  
  236. // This function will take an enum, usually returned from a lookup, and insert
  237. // the values into a drop-down list or list box field. The third argument,
  238. // i_bAllowDuplicates, is optional, and is false by default. You must call
  239. // DoesFunctionExist before using this method as it was added in 3.0f.
  240. function InsertBSTREnumIntoListField(i_BSTREnum, i_FieldName, i_bAllowDuplicates)
  241. {
  242.     int_InsertBSTREnumIntoListField(i_BSTREnum, i_FieldName, i_bAllowDuplicates);
  243. }
  244.  
  245. // This function will determine if a date's value, in milliseconds, is valid.
  246. function IsValidDate(i_Value)
  247. {
  248.     return int_IsValidDate(i_Value);
  249. }
  250.  
  251. // This function creates a unique ID.  The ID returned is the same type of ID
  252. // generated when using a field whose initial value is set to be 'Unique' in the
  253. // Forms Designer.
  254. function CreateUniqueID()
  255. {
  256.     return int_getUniqueID();
  257. }
  258.  
  259. // This functions should be used after calling GetApp().SaveCurrentFormData()
  260. // to determine if there were validation errors that the user must fix.
  261. function HasValidationErrors()
  262. {
  263.     return int_HasValidationErrors();
  264. }
  265.  
  266. // This function will set the current value of any contact field on the form.
  267. // The contact is set to empty if the i_Contact value passed in is null.
  268. function SetContactFieldValue(i_FieldName, i_Contact)
  269. {
  270.     int_SetContactFieldValue(i_FieldName, i_Contact);
  271. }
  272.  
  273. // This function will return the current value of any contact field on the form.
  274. // If the contact field is empty, it will return null.
  275. function GetContactFieldValue(i_FieldName)
  276. {
  277.     return int_GetContactFieldValue(i_FieldName);
  278. }