11/// <reference path="..\xrm.d.ts" />
22
3+
4+
5+
36declare namespace Xrm {
47 /**
58 * Lookup-like type object for userSettings.roles.
@@ -11,12 +14,14 @@ declare namespace Xrm {
1114
1215 interface userSettings {
1316 /**
14- * Collection of lookup-like objects containing the GUID and display name of each of the security role or teams that the user is associated with.
17+ * Collection of lookup-like objects containing the GUID and display name of each of the security role or teams
18+ * that the user is associated with.
1519 */
1620 roles : Collection < Role > ;
1721
1822 /**
19- * Returns an array of strings that represent the GUID values of each of the security role privilege that the user is associated with or any teams that the user is associated with.
23+ * Returns an array of strings that represent the GUID values of each of the security role privilege that the
24+ * user is associated with or any teams that the user is associated with.
2025 */
2126 securityRolePrivileges : string [ ]
2227 }
@@ -45,7 +50,8 @@ declare namespace Xrm {
4550 getDataLoadState ( ) : LoadState ;
4651 }
4752
48- interface OnLoadEventContext extends ExecutionContext < UiModule < TabCollectionBase , ControlCollectionBase > , LoadEventArgs > { }
53+ interface OnLoadEventContext extends ExecutionContext < UiModule < TabCollectionBase , ControlCollectionBase > , LoadEventArgs > {
54+ }
4955
5056 interface LookupTagValue extends Lookup {
5157 /**
@@ -61,7 +67,8 @@ declare namespace Xrm {
6167 getTagValue ( ) : LookupTagValue ;
6268
6369 /**
64- * Returns a value indicating whether the lookup tag click event has been canceled because the preventDefault method was used in this event hander or a previous event handler.
70+ * Returns a value indicating whether the lookup tag click event has been canceled because the preventDefault
71+ * method was used in this event handler or a previous event handler.
6572 */
6673 isDefaultPrevented ( ) : boolean ;
6774
@@ -71,7 +78,8 @@ declare namespace Xrm {
7178 preventDefault ( ) : void ;
7279 }
7380
74- interface OnLookupTagClickContext extends ExecutionContext < any , OnLookupTagClickEventArgs > { }
81+ interface OnLookupTagClickContext extends ExecutionContext < any , OnLookupTagClickEventArgs > {
82+ }
7583
7684 interface LookupControl < T extends string > extends Control < LookupAttribute < T > > {
7785 /**
@@ -90,6 +98,11 @@ declare namespace Xrm {
9098 * Sets a value that indicates whether the control is visible.
9199 */
92100 setVisible ( visibility : boolean ) : void ;
101+
102+ /**
103+ * Return a value that indicates whether the form is currently visible
104+ */
105+ getVisible ( visibility : boolean ) ;
93106 }
94107
95108 /**
@@ -99,7 +112,69 @@ declare namespace Xrm {
99112 /**
100113 * Method to cause the ribbon to re-evaluate data that controls what is displayed in it.
101114 */
115+
116+ /**
117+ * Provides information on how to set the visibility of header section.
118+ */
102119 headerSection : HeaderSection ;
120+
121+ /**
122+ * Provides information on how to set the visibility of footer section.
123+ */
124+ footerSection : FooterSection ;
125+
126+ /**
127+ * Provides objects and methods to interact with the business process flow control on a form.
128+ * More information: formContext.ui.process
129+ */
130+ process : UiProcess ;
131+
132+
133+ //quickViewControl: QuickViewControl;
134+
135+ // /**
136+ // * Adds a function to be called on the form OnLoad event.
137+ // * @param onLoadFunction The function to be executed on the form OnLoad event.
138+ // * The function will be added to the bottom of the event handler pipeline.
139+ // * The execution context is automatically passed as the first parameter to the function.
140+ // * See Execution context for more information.
141+ // */
142+ // addOnLoad(onLoadFunction); figure out function ref
143+ //
144+ // /**
145+ // * Removes a function from the form OnLoad event.
146+ // * @param onLoadFunction The function to be removed from the form OnLoad event.
147+ // */
148+ // removeOnLoad(onLoadFunction): void; figure out function ref
149+
150+ /**
151+ * Sets the name of the table to be displayed on the form.
152+ * @param tableName Name of the table to be displayed on the form.
153+ */
154+ setFormEntityName ( tableName : string ) : void ;
155+
156+ /**
157+ * Displays form level notifications.
158+ * You can display any number of notifications and they will be displayed until they are removed using clearFormNotification.
159+ * The height of the notification area is limited so each new message will be added to the top.
160+ * Users can scroll down to view older messages that have not yet been removed.
161+ * @param messageText The text of the notification message.
162+ * @param level The level of the message, which defines how the message will be displayed. Specify one of the following values:
163+ * ERROR : Notification will use the system error icon.
164+ * WARNING : Notification will use the system warning icon.
165+ * INFO : Notification will use the system info icon.
166+ * @param uniqueId A unique identifier for the message that can be used later with clearFormNotification to remove the notification.
167+ * returns true if the method succeeded; false otherwise.
168+ */
169+ setFormNotification ( messageText : string , level : string , uniqueId : string ) : boolean ;
170+
171+ /**
172+ * Removes form level notifications.
173+ * @param uniqueId A unique identifier for the message to be cleared that was set using the setFormNotification method.
174+ * returns true if the method succeeded, false otherwise.
175+ */
176+ clearFormNotification ( uniqueId : string ) : boolean ;
177+
103178 }
104179
105180 interface HeaderSection {
@@ -120,19 +195,157 @@ declare namespace Xrm {
120195
121196 /**
122197 * Sets the header's body visibility.
198+ * @param isVisible Specify true to show the body; false to hide the body.
123199 */
124- setBodyVisible ( isVisible : boolean ) ;
200+ setBodyVisible ( isVisible : boolean ) : void ;
125201
126202 /**
127203 * Sets the command bar visibility.
204+ * @param isVisible Specify true to show the command bar; false to hide the command bar.
128205 */
129- setCommandBarVisible ( isVisible : boolean ) ;
206+ setCommandBarVisible ( isVisible : boolean ) : void ;
130207
131208 /**
132209 * Sets the tab navigator visibility.
210+ * @param isVisible Specify true to show the tab navigator; false to hide the tab navigator.
211+ */
212+ setTabNavigatorVisible ( isVisible : boolean ) : void ;
213+ }
214+
215+ interface FooterSection {
216+ /**
217+ * Returns the footer section visibility
218+ * returns true if the footer section is visible; false otherwise.
219+ */
220+ getVisible ( ) : boolean ;
221+
222+ /**
223+ * Sets the visibility of the footer section
224+ * @param isVisible Specify true to show the footer section; false to hide the footer section.
225+ */
226+
227+ setVisible ( isVisible : boolean ) : void ;
228+ }
229+
230+ interface UiProcess {
231+ /**
232+ * Retrieves the display state for the business process control.
233+ * Returns "expanded" or "collapsed" on the legacy web client; returns "expanded", "collapsed", or "floating" on Unified Interface.
234+ */
235+ getDisplayState ( ) : string ;
236+
237+ /**
238+ * Returns a value indicating whether the business process control is visible.
239+ * returns true if the control is visible; false otherwise.
133240 */
134- setTabNavigatorVisible ( isVisible : boolean ) ;
241+ getVisible ( ) : boolean ;
242+
243+ /**
244+ * Reflows the UI of the business process control. Parameters are optional
245+ * @param updateUI Specify true to update the UI of the process control; false otherwise.
246+ * @param parentStage Specify the ID of the parent stage in the GUID format.
247+ * @param nextStage Specify the ID of the next stage in the GUID format.
248+ */
249+ reflow ( updateUI ?: boolean , parentStage ?: string , nextStage ?: string ) : void ;
250+
251+ /**
252+ * Sets the display state of the business process control.
253+ * @param state Specify "expanded", "collapsed", or "floating". The value "floating" is not supported on the web client.
254+ */
255+ setDisplayState ( state : string ) : void ;
256+
257+ /**
258+ * Shows or hides the business process control.
259+ * @param visibility Specify true to show the control; false to hide the control.
260+ */
261+ setVisible ( visibility : boolean ) : void ;
262+
135263 }
264+
265+ // This needs to be created in F# to get it working
266+ // interface QuickViewControl {
267+ // /**
268+ // * Gets the control on a form.
269+ // * @param arg Optional. You can access a single control in the constituent controls collection by passing an
270+ // * argument as either the name or the index value of the constituent control in a quick view control.
271+ // * For example: quickViewControl.getControl("firstname") or quickViewControl.getControl(0)
272+ // * Returns an Object or Object collection
273+ // */
274+ // getControl(arg?);
275+ // figure out return type call
276+ //
277+ // /**
278+ // * Returns a string value that categorizes quick view controls.
279+ // * For a quick view control, the method returns "quickform".
280+ // * For a constituent control in a quick view control, the method returns the actual category of the control.
281+ // */
282+ // getControlType(): string;
283+ //
284+ // /**
285+ // * Gets a boolean value indicating whether the control is disabled.
286+ // * true if disabled; false otherwise.
287+ // */
288+ // getDisabled(): boolean;
289+ //
290+ // /**
291+ // * Returns the label for the quick view control.
292+ // */
293+ // getLabel(): string;
294+ //
295+ // /**
296+ // * Returns the name assigned to the quick view control.
297+ // */
298+ // getName(): string;
299+ //
300+ // /**
301+ // * Returns a reference to the section object that contains the control.
302+ // */
303+ // getParent() PageSection<Collection<QuickViewControl>>;
304+ // figure out return type call
305+ // UiModule<Collection<PageTab<Collection<PageSection>>>, Collection<BaseControl>>
306+ //
307+ // /**
308+ // * Returns a value that indicates whether the quick view control is currently visible.
309+ // * Returns true if the control is visible; false otherwise.
310+ // */
311+ // getVisible(): boolean;
312+ //
313+ // /**
314+ // * Returns whether the data binding for the constituent controls in a quick view control is complete.
315+ // * true if the data binding for a constituent control is complete; false otherwise.
316+ // */
317+ // isLoaded(): boolean;
318+ //
319+ // /**
320+ // * Refreshes the data displayed in a quick view control.
321+ // */
322+ // refresh(): void;
323+ //
324+ // /**
325+ // * Sets the state of the control to either enabled or disabled.
326+ // * @param disabled Specify true or false to disable or enable the control.
327+ // */
328+ // setDisabled(disabled: boolean): void;
329+ //
330+ // /**
331+ // * Sets focus on the control.
332+ // */
333+ // setFocus(): void;
334+ //
335+ // /**
336+ // * Sets the label for the quick view control.
337+ // * @param label The new label of the quick view control.
338+ // */
339+ // setLabel(label: string): void;
340+ //
341+ // /**
342+ // * Displays or hides a control.
343+ // * @param visible Specify true or false to display or hide the control.
344+ // */
345+ // setVisible(visible: boolean): void;
346+ //
347+ // }
348+
136349
137350 type KBSeachControlMode = "Inline" | "Popout" ;
138351
@@ -287,4 +500,45 @@ declare namespace Xrm {
287500 */
288501 addOnPostSave ( functionRef : ( context ?: SaveEventContext < this> ) => any ) : void ;
289502 }
503+
504+ // interface PageTab<T extends SectionCollectionBase> {
505+ // /**
506+ // * Collection of sections within this tab.
507+ // */
508+ // sections: T;
509+ //
510+ // /**
511+ // * Adds a function to be called when the TabStateChange event occurs.
512+ // * @param tabStateChangeFunction The function to be executed on the TabStateChange event.
513+ // * The function will be added to the bottom of the event handler pipeline.
514+ // * The execution context is automatically passed as the first parameter to the function.
515+ // * See Execution context for more information.
516+ // */
517+ // addTabStateChange(tabStateChangeFunction): void; figure out function ref
518+ //
519+ // /**
520+ // * Returns the content type.
521+ // * only supported on unified interface
522+ // * Returns "cardSections" or "singleComponent".
523+ // */
524+ // // getContentType() ; // figure out return value
525+ //
526+ // /**
527+ // * Removes a function to be called when the TabStateChange event occurs.
528+ // * @param tabStateChangeFunction The function to be removed from the TabStateChange event.
529+ // */
530+ // removeTabStateChange(tabStateChangeFunction): void; figure out function ref
531+ //
532+ // /**
533+ // * Sets the content type.
534+ // * only supported on unified interface
535+ // * @param contentType Defines the content type. It has the following parameters:
536+ // - cardSections: The default tab behavior.
537+ // - singleComponent: Maximizes the content of the first component in the tab.
538+ // */
539+ // setContentType(contentType: string): void;
540+ //
541+ //
542+ // }
543+
290544}
0 commit comments