|
 Class : _Global (39) |  | | Command | # Any comment till end of line | | For commenting code. You need to use # for every line of your comment. Rest of line is treated as comment only. | |  | | Command | DIM variableName AS anyClass | | Declares a new variable scoped for the time of script | |  | | Command | IF condition THEN true commands [ELSE false commands] END IF | | Control block so depending on the condition (of Boolean type) it executes either TRUE commands block or FALSE commands block (if ELSE exists). IF commands can be nested. | |  | | Command | INPUT variableName AS FIELD(listName as String, fieldName as String) | | Forces Manual Tasks to accept new inputs from users based on the types declared per list/column). Those inputs are then available for you to manage in script. It is very useful for custom editing forms when you want your users to enter some data before running an action.
The listName argument is optional, empty string "" means we want field from the same list we are managing. ListName must be the list's display name, fieldName is the field's internal name.
Example for taking one comment and saving it later within the same list:
INPUT newComment as Field("", "OurColumnInTheSameList")
SET value("OurColumnInTheSameList") = newComment
Example for taking few inputs from different lists:
INPUT someString as Field("", "ColumnString")
INPUT someChoice as Field("AnotherList", "ColumnChoice")
INPUT somePerson as Field("ThirdList", "ColumnPerson")
Few important notes are:
- You can use them only with actions of "Manual Task" type as we cannot input anything for other tasks.
- You need to use it at the beginning of the script only (there can be many inputs one after another, all from the same web site).
- This is very universal mechanism as you can ask for any Sharepoint field's type e.g. persons, groups, choices, lookups etc. UI rendering will be used the same as Sharepoint does and it always takes the column's definitions e.g. if field is required with given description - all that information is handled properly.
- All users that are asked with such Manual Task, must have at least ADD NEW ITEM permissions on those lists. Otherwise rendering control will not work properly. Please test it with simple user, and not with administrator. | |  | | Command | SET object or variable = expression | |
Assigment | |  | | Function | ADCreate(SamAccountName as String, Type as String) | |
Function that creates Active Directory® object with given SamAccountName. With Type atribute you define what kind of object will be created. Currently supported Type is "User" only (shortly comming Security Groups and Distribution Lists). Function does not return any value.
Note: in order to use any of the AD* functions you need to define MWS parameter called LDAP_PATH as StringSingleLine and put there a value e.g. LDAP://OU=UsersManagedByMWS,DC=Malcan,DC=com (which OU you are to manage). Also it is suggested to run dedicated Web Application with separated Application Pool and New Site Collection to manage AD objects. Why? Because you need dedicated permission to be given only to that Application Pool's service account and only to that OU in your AD. You may also want to minimize permissions in that OU so only certain properties can be changed e.g. you want to change only first name, second name and department and nothing more. | Ask Malcan |  | | Function | ADExists(SamAccountName as String) | Boolean | Function returns True if object with given SamAccountName exists.
Be aware of note described at ADCreate function. | |  | | Function | ADGet(SamAccountName as String, PropertyName as String) | String |
Returns always String represantation of the Active Directory® object value. The attributes are: SamAccountName (which object), PropertyName (which property). Typical examples of AD properties are: samaccountname, givenName, description, displayName, SN, name, mail.
Be aware of note described at ADCreate function
Example:
set value("MyGivenNameColumn") = ADGet(CurrentUser().GetLogin(False), "givenName") | |  | | Function | ADSet(SamAccountName as String, PropertyName as String, Value as String) | Boolean |
Function sets one property of the Active Directory® object. The attributes are: SamAccountName (which object), PropertyName (which property), Value (what we are to set - always String represantation is needed). As an addition to typical AD properties are you may also use special two property names: UserEnabled (to control if object is enabled/disabled and "True", "False" as value), Password (to set newer password). Returning True when succeeded.
Be aware of note described at ADCreate function. | Ask Malcan |  | | Function | CallDLL(s1 as String, s2 as String, s3 as String, s4 as String, AssemblyName as String, ClassName as String) | String |
If MWS API is not sufficient for you may ask us to improve the set of actions/operations or just use your custom DLL library. You may dynamically call any custom DLL library directly from within MWS. Check guidelines please. | |  | | Function | CurrentList() | List |
Global function returning current List object | |  | | Function | CurrentListRow() | ListRow |
Global function returning current ListRow object | |  | | Function | CurrentUser() | User |
Global function returning current user object - useful with synchronous events (adding, updating, deleting) and manual tasks actions. When you use timer jobs or asynchronous events (post added, post updated, post deleted) it will return the IIS application pool context - consider using value("Author") or value("Editor") in those scenarios. | |  | | Function | CurrentWeb() | Web | Global function returning current Web object | |  | | Function | ForEachRow(InList as List, CamlQuery as String, Variable as ListRow) ... Next | |
Loop with all the list rows that satisfy the CAML condition. Each iteration runs all the commands between ForEachRow and Next. Nesting ForEachRow is forbidden. The third argument must be of type ListRow and it must be the declared variable. For CAML syntax refer also to List.GetRowByQuery method.
The example to concatenate all the Titles that are greater or equal to "c" is:
dim myRow as ListRow dim result as String forEachRow(
currentList(),
"<Geq> <FieldRef Name='Title'/><Value Type='Text'>cc</Value> </Geq>"
, myRow) set result = result + myRow.value("Title") + " " next # here we have result | |  | | Function | IsNull(expression) | Boolean | Evaluates expression and depending if it has value returns TRUE, otherwise FALSE | |  | | Function | IsNullTo(expression, valueIfNull) | Expression type OR valueIfNull type | Similar to IsNull, but in case expression evaluates to Null returns valueIfNull. If expression has own value returns the same expression. | |  | | Function | NewGuid() | Guid | Global function returning always new unique Guid (globally unique identificator, 128 bits) | |  | | Function | Now() | DateTime | Global function returning the current date and time | |  | | Function | Param(uniqueName as String) | depends on the type of the parameter |
Global function returning one of the defined parameters for that list. You need to define them first. | |  | | Function | ParamProc(uniqueName as String) | depends on code |
Global function "kind of procedure" that is very usefull when you repeat some script many times e.g. sending similar mails with plenty lines of body. Using ParamProc you may write code once, put in as one of the String parameters and run it multiple times from many scripting places. ParamProc works really as preprocessor replacement tool e.g. you may declare variables in code, and use them in ParamProc or vice versa. | |  | | Function | SendMail(to as String, cc as String, bcc as String, subject as String, body as String, priority as Int, isHtml as Boolean) | String("OK" if successfully sent, otherwise error message) |
Sending mails using SMTP server registered in the current web site. You must pass correct mail address for To required argument, CC and BCC - those aguments can be either comma seperated strings or empty strings "".
HINT: for big messages e.g. with HTML formatting you will probably want to use ParamProc function, and have your body details kept in Parameters (cleaner and smaller code).
If does not work, ensure standard Sharepoint outgoing mails are sent properly like alerts (also check if SMTP serwer and From Address was set in SharePoint Administration). If you still cannot send, check two things: common problem and also try CMD => telnet YourSMTPServerName 25 => should be connected (otherwise check network connections, antivirus etc.).
Example is: sendMail(currentUser().Email,"","", "mySubject", "myHtmlBody", 0, true). Priority=0 means Normal, 1-Low, 2-High.
NOTE: starting with v.4.0 it returns String, not Boolean. "OK" means sent properly, otherwise returns detailed error message. | |  | | Function | StopEvent(errorMessage as String) | |
Available only in synchronous events like Adding, Updating, Deleting. With this function you can throw error and don't allow to save user changes. | |  | | Function | Value(internalName as String) | depends on the type of the column |
Global function returning CURRENT values for currentListRow. Equivalent to currentListRow().Value(...). When you make mistake with the name "syntax check" will help you suggesting proper internal name. | |  | | Function | ValueOld(internalName as String) | depends on the type of the column |
Global function returning OLD values for currentListRow. Equivalent to currentListRow().ValueOld(...). Available only in Updating event (here we have old and new values and we can compare changes) | |  | | Operator | - | Int, Double | Minus (between INT and DOUBLE types) | |  | | Operator | * | Int, Double | Multiplication (between INT and DOUBLE types) | |  | | Operator | / | Double | Division (between INT and DOUBLE types, returning always DOUBLE) | |  | | Operator | ^ | Int, Double | Power (between INT and DOUBLE types) | |  | | Operator | + | Int, Double, String |
Sum between INT and DOUBLE types
Concatenation for STRING - when second argument is not of String type it automatically converts to safe String e.g. you can do "MyListUrl is: " & SomeList instead of "MyListUrl is: " & SomeList.Link.Url. Safe to call even if SomeList is null.
Combines two sets for USER objects (multivalues) | |  | | Operator | < | Boolean | Less than (between INT, DOUBLE, STRING, DATETIME types) | |  | | Operator | <= | Boolean | Less or equal (between INT, DOUBLE, STRING, DATETIME types) | |  | | Operator | <> | Boolean |
Is not equal (between INT, DOUBLE, STRING, DATETIME types, also available for USER, GUID).
Safe to call even if objects are null e.g Object<>Null returns TRUE, Null<>Null returns FALSE | |  | | Operator | == | Boolean |
Is equal (between INT, DOUBLE, STRING, DATETIME types, also available for USER, GUID).
Safe to call even if objects are null e.g Object==Null returns FALSE, Null==Null returns TRUE | |  | | Operator | > | Boolean | Greater (between INT, DOUBLE, STRING, DATETIME types) | |  | | Operator | >= | Boolean | Greater or equal (between INT, DOUBLE, STRING, DATETIME types) | |  | | Operator | AND | Boolean |
Logical AND (between BOOLEAN types) | |  | | Operator | NOT | Boolean |
Logical NOT (before BOOLEAN type) | |  | | Operator | OR | Boolean |
Logical OR (between BOOLEAN types) | |  Class : Boolean (2) |  | | Method | ToString() | String |
"True" or "False". Safe to call even if object is null. | |  | | Value | Dim x As Boolean | | | |  Class : DateTime (7) |  | | Attribute (ReadOnly) | DateOnly | String |
Gets the string representation of date in the format YYYY-MM-DD (useful e.g. for CAML queries). | 5.1 |  | | Method | Add(Amount as Int, Unit as String) | DateTime | Adds multiple intervals to current date and returns resulting DateTime e.g. set oneDayAfter=now().Add(1,"Day")
Units are based on const string: "Year", "Month", "Day", "Hour", "Minute", "Second". | |  | | Method | DatePart(Part as String) | Int |
Returns number representing part of the datetime e.g. just year or just minutes. Use one of part strings: "Year", "Month", "Day", "Hour", "Minute", "Second". | |  | | Method | Diff(SecondArgument as DateTime, Unit as String) | Int |
Returns difference in times: object DateTime MINUS second argument DateTime. Difference is expressed in full units based on Unit string: "Year", "Month", "Day", "Hour", "Minute", "Second". | |  | | Method | ToString() | String |
Returns using default format "yyyy-MM-dd HH:mm:ss". Safe to call even if object is null.
If you want another formatting you need to use DatePart method with string concatenations (+). | |  | | Method | WeekDay() | Int |
Returns 1 for Sunday, 2 for Monday... and 7 for Saturday | |  | | Value | Dim x As DateTime | | | |  Class : Double (6) |  | | Method | ToInt() | Int | Parsing, can result in error | |  | | Method | ToIntRoundDown() | Int | Conversion to lower integer | |  | | Method | ToIntRoundNearest() | Int | Conversion to nearest Int | |  | | Method | ToIntRoundUp() | Int | Conversion to upper integer | |  | | Method | ToString() | String |
Converts Double to String. Safe to call even if object is null. | |  | | Value | Dim x As Double | |
Number with precision of DOUBLE. Comma separated e.g. 23,45. Also SharePoint currencies are represented as Double. | |  Class : Guid (2) |  | | Method | ToString() | String |
Default format e.g. "9cac9a87-559b-4393-93b5-3045c16bace5". Safe to call even if object is null. | |  | | Value | Dim x As Guid | | Globally Unique Identificator (128 bit) | |  Class : Int (3) |  | | Method | ToDouble() | Double | | |  | | Method | ToString() | String |
Converts Int to String. Safe to call even if object is null. | |  | | Value | Dim x As Int | | Integer number (based on Int32) | |  Class : Link (5) |  | | Attribute (ReadOnly) | ForHtml | String |
Returns html form of the link <a href="Url">Name</a> usefull when sending links in HTML format when you want to show workign URL as Title e.g. Malcan Site | |  | | Attribute (ReadWrite) | Name | String | Display name of the link. | |  | | Attribute (ReadWrite) | Url | String | URL of the link e.g. http://... | |  | | Method | ToString() | String | Converts Link to String and returns URL part only. Safe to call even if object is null. | |  | | Value | Dim x as Link | String | Represents pair name and url. Suitable for SharePoint fields of type hypelink. To assign a new Link check helpful String.ToLink() conversion method. | |  Class : List (18) |  | | Attribute (ReadOnly) | Guid | Guid | Returns unique identificator of the list | |  | | Attribute (ReadOnly) | Link | Link | | |  | | Attribute (ReadOnly) | ParentWeb | Web | | |  | | Attribute (ReadWrite) | Title | String | | |  | | Method | AddRow(CommaSeparatedFields as String, Value1, Value2, ...) | Int |
Adds new row to the list and returns ID of this new row:
- CommaSeparatedFields are the internal field names.
- Value1, Value2, ... are the values to be assigned to the new row for given CommaSeparatedFields. You need to specify exactly the same number of fields and values.
Example with three fields and three values: currentList().AddRow("Title, MyDateField, MyUserField", "new title", now(), CurrentUser()) | |  | | Method | GetColumn(ColumnName as String) | ListColumn | | |  | | Method | GetRowByID(RowId as Int) | ListRow | Returns row with values from the list - if found. | |  | | Method | GetRowByQuery(Query as String) | ListRow |
Returns first row matching query - if found. Query is any CAML <WHERE> format, but without beginning and ending <WHERE> e.g.
to get first row with given Status field use SET resultRow=myList.GetRowByQuery("
<Eq>
<FieldRef Name='Status'/><Value Type='Text'>Completed</Value>
</Eq>")
Some usefull CAML tags are: Eq, Neq, Lt, Gt, Leq, Geq.
Note: CAML does not allow you to nest more than 2 arguments for <AND> <OR> so in case you need to use more arguments you need to nest <AND> <OR> e.g. BAD EXAMPLE <AND> one two three </AND> GOOD EXAMPLE <AND> one <AND> two three </AND></AND> | |  | | Method | GetRowRandom() | ListRow |
Returns random ListRow from this list. Each time you run it you may get different result. | |  | | Method | GetRowsAmountByQuery(Query as String) | Int | Returns amount of rows matching query. Query is any CAML <WHERE> format, but without beginning and ending <WHERE> e.g. to get number of rows in a given dates range (greater or equal to ... AND less than or equal to ...) use set rowsNo = someList.GetRowsAmountByQuery("
<And>
<Geq>
<FieldRef Name='Day'/><Value Type='DateTime'>"+someDateStart.ToString()+"</Value></Geq>
<Leq>
<FieldRef Name='Day'/><Value Type='DateTime'>"+SomeDateEnd".ToString()+"</Value></Leq>
</And>")
| |  | | Method | GetRowsAmountByValue(ColumnName as String, Value as String) | Int | Returning number of rows that match criteria of particular column equal to given value. This method is equivalent to GetRowsAmountByQuery(Query as String), but you don't need to use CAML "<Eq><FieldRef Name='MyColumnName'/><Value Type='Text'>MyValue</Value></Eq> and just write GetRowsAmountByValue(MyColumn, MyValue).
With this method you may easily check for uniqueness of values in the whole list e.g. when Adding new row you can easily check if some attribute is unique across all the list rows items comparing result to zero. | |  | | Method | GetRowsSumByQuery(ColumnName as String, Query as String) | Double | Returns sum of values in the given field ColumnName. Query is CAML query (check similarity to GetRowsAmountByQuery method). Please ensure that ColumnName values can be parsed to Double (Numeric fields), otherwise method will try to convert to Double and make sum for those values that succeed. | |  | | Method | HasUserPermission(u as User, PermissionLevelName as String) | Boolean |
Returns True when given user has given permission on this list e.g. CurrentList().HasUserPermission( CurrentUser(), "Read") will result with True when this user has Read permission (or any of the SharePoint groups this user belongs to).
In case given user is multivalue the function checks only the first user. | |  | | Method | SetPermissionAdd(PermissionLevelName as String, Users as User) | | Adding new permissions for List (also document library). Check description for similar ListRow.SetPermissionAdd().
| |  | | Method | SetPermissionClear() | |
Clears all the permissions for List (or document library) - usually used when you to start adding new permissions from scratch. Check description for similar ListRow.SetPermissionClear() | |  | | Method | SetPermissionInherit() | |
Sets List (or document library) permissions to be inherited from parent. Check description for similar ListRow.SetPermissionInherit(). | |  | | Method | ToString() | String |
Converts List to String and returns URL part of Link attribute only. Safe to call even if object is null. | |  | | Value | Dim x As List | | SharePoint List or Document Library (based on SpList) | |  Class : ListColumn (8) |  | | Attribute (ReadOnly) | InternalName | String | | |  | | Attribute (ReadOnly) | ParentList | List | | |  | | Attribute (ReadWrite) | ShowInDisplayForm | Boolean |
You can dynamically control which columns should be available for displaying details in a form. Applies to all the rows in the list.
OBSOLETE: starting with v.4.0 REPLACED with special "Managing MWS" form. | |  | | Attribute (ReadWrite) | ShowInEditForm | Boolean |
You can dynamically control which columns should be available for editting or not. Applies to all the rows in the list.
OBSOLETE: starting with v.4.0 REPLACED with special "Managing MWS" form. | |  | | Attribute (ReadWrite) | ShowInNewForm | Boolean |
You can dynamically control which columns should be available for new form. Applies to all the rows in the list.
OBSOLETE: starting with v.4.0 REPLACED with special "Managing MWS" form. | |  | | Attribute (ReadWrite) | Title | String | | |  | | Method | ToString() | String |
Converts List to String and returns field's TITLE only. Safe to call even if object is null. | |  | | Value | Dim x As ListColumn | | SharePoint one list field of the list - the column (based on SpField) | |  Class : ListRow (12) |  | | Attribute (ReadOnly) | Id | Int | | |  | | Attribute (ReadOnly) | Link | Link | | |  | | Attribute (ReadOnly) | ParentList | List | | |  | | Method | CopyAttachments(ToListRow as ListRow) | Boolean |
Copies all the attachments from the object's list row to another list row. Applicable only on lists (not document libraries). Note also that we don't overwrite existing files with the same attachment name (no error occurs).
Example copying items from current row to the row id 1 of the list "l2":
dim targetList as List dim targetRow as ListRow set targetList = CurrentWeb().GetListByName("l2") set targetRow = targetList.GetRowByID(1) CurrentListRow().CopyAttachments(targetRow) | |  | | Method | HasUserPermission(u as User, PermissionLevelName as String) | Boolean | Returns True when given user has given permission on this ListRow e.g. CurrentListRow().HasUserPermission( CurrentUser(), "Read") will result with True when this user has Read permission (or any of the SharePoint groups this user belongs to).
| |  | | Method | SetPermissionAdd(PermissionLevelName as String, Users as User) | |
In order to add new permissions for given row you need to know the permission level name that is available for this web site like "Contribute". Second object User is multivalued field so you can easily set permissions for more users at the same time. Usually you will start with SetPermissionClear() and then start adding yours.
Note: at the same time you break permissions inheritance. | |  | | Method | SetPermissionClear() | |
In order to clear all current permissions and start adding with blank permissions set.
Note: at the same time you break permissions inheritance. | |  | | Method | SetPermissionInherit() | | In order to clear custom permissions on the row and use default inherited once. | |  | | Method | ToString() | String |
Converts ListRow to String and returns URL part of Link attribute only. Safe to call even if object is null. | |  | | Method | Value(InternalName as String) | depends on the type of the column | Returning CURRENT values for currentListRow. Check also global function Value(...). | |  | | Method | ValueOld(InternalName as String) | depends on the type of the column | Returning OLD values for currentListRow. Check also global function ValueOld(...). | |  | | Value | Dim x As ListRow | | SharePoint one item on the list - the row (based on SpListItem) | |  Class : Lookup (5) |  | | Attribute (ReadOnly) | LookupList | List | Returns the parent List object e.g. value("myLookupField").LookupList.Title | |  | | Attribute (ReadOnly) | LookupListRow | ListRow |
Returns the associated parent row object (of Parent List) e.g. to get value from parent list you may use SET val = value("myLookupField").LookupListRow.value("someFieldFromParentList") | |  | | Attribute (ReadWrite) | LookupId | Int | Gets or sets first lookup row for given field. In order to set it properly please construct first Lookup variable based on given list row as follows:
dim LookupVariable as Lookup set LookupVariable = value("LookupField") set LookupVariable.LookupID = 5 # new lookup ID that should exist in the lookup list
set value("MyLookupField") = LookupVariable | |  | | Method | ToString() | String |
Converts Lookup to String and returns all comma separated TITLES (for multiple lookup references). Safe to call even if object is null. | |  | | Value | dim x as Lookup | | Represents lookup SharePoint field. | |  Class : String (13) |  | | Method | IndexFromLeft(SearchForString as String) | Int |
Returns 1-based index of found string (starting searching from left side). Zero otherwise. | |  | | Method | IndexFromRight(SearchForString as String) | Int |
Returns 1-based index of found string (starting searching from right side). Zero otherwise. | |  | | Method | Left(numberOfCharacters As Int) | String | | |  | | Method | Mid(StartingIndex As int, NumberOfCharacters As Int) | String |
Returns part of string starting with StartingIndex (1-based) and with the length of NumberOfCharacters. | |  | | Method | Replace(FindString as String, ReplaceString as String) | String | It replaces all occurances of FindString with ReplaceString e.g. dim S as String set S="abca" set S=S.Replace("a","X") will result with S value "XbcX" | |  | | Method | Right(numberOfCharacters As Int) | String | | |  | | Method | ToBoolean() | Boolean | Parsing, can result in error | |  | | Method | ToDateTime() | DateTime | Parsing, can result in error | |  | | Method | ToDouble() | Double | Parsing, can result in error | |  | | Method | ToGuid() | Guid | Parsing, can result in error | |  | | Method | ToInt() | Int | Parsing, can result in error | |  | | Method | ToLink() | Link | It tries to get both url and name from the string format: "http://malcan.com, Malcan" (Sharepoint style - please note comma and space between two). If comma not found both name and url are set same. Example value("myLinkField")="http://x.com" | |  | | Value | Dim x As String | | | |  Class : User (11) |  | | Attribute (ReadOnly) | ADDirects | User |
Returns all direct reports (multivalue) dynamically from Active Directory. If object consist of many users it returns directs of the first manager only. | |  | | Attribute (ReadOnly) | ADManager | User | Returns manager dynamically from Active Directory. If object consist of many users it returns manager of the first user only. | |  | | Attribute (ReadOnly) | Email | String |
Gets email (of the first user only). Compare also with attribute EmailsAll. | |  | | Attribute (ReadOnly) | EmailsAll | String |
Comma seperated string with all the EMAILS for all users. Usefull when sending mail to everybody. You can easily send messages to any Sharepoint Group in that way. (if object has more than one user) | |  | | Attribute (ReadOnly) | Id | Int | User identificator in the site collection (of the first user only) | |  | | Attribute (ReadOnly) | Name | String |
User full name (first name and surname). For multivalue you get first user only. In order to get all names use NamesAll attribute. | |  | | Attribute (ReadOnly) | NamesAll | String | Semicollon seperated string with all the NAMES for all users. (if field has more than one user) | |  | | Method | GetLogin(IsDomainIncluded as Boolean) | String |
Returns Login of the user (or the first user in the collection). Argument decides if we want full login name with domain or just an alias (SamAccountName usefull with ADGet method).
Examples:
CurrentUser().GetLogin(true) => malcan\jsmith
CurrentUser().GetLogin(false) => jsmith | 5.4 |  | | Method | IsUserIn(UserToFind as User) | Boolean |
Checks if UserToFind is available in the multivalue object User.
E.g. we have UserColection (as User) that consists of 5 people and we have UserToFind (as User) that is one person. UserCollection.IsUserIn(UserToFind) returns TRUE if that one person is in the group of five, otherwise FALSE. | |  | | Method | ToString() | String |
Converts User to String and returns all comma separated emails of users (for multivalue - the same as EmailsAll). Safe to call even if object is null. | |  | | Value | Dim x as User | | Representing user (based on SpUser). Note that it can be multivalue field and it can consist of many users, even groups. However when you read this field, groups are expanded to users e.g. you read a field that consists of two values: user X and group G, let's assume that G in Sharepoint consists of users Y and Z => your User object will then have 3 users X, Y, Z. | |  Class : Web (14) |  | | Attribute (ReadOnly) | Link | Link | | |  | | Attribute (ReadOnly) | UrlAlias | String |
Gets the Web UrlAlias. If for example you are on site http://server/site1/site11 when you call currentWeb().UrlAlias you will get "site11". Also compare with Title attribute. | |  | | Attribute (ReadWrite) | Title | String | | |  | | Method | CreateSubweb(UrlAlias as String, Title as String, Description as String, LCID as Int, SiteTemplate as String) | Web | Creates completely new subsite with given attributes. - UrlAlias must be unique across all subsites. - LCID if ZERO creates subsites with the same language, otherwise it uses the specified one. - SiteTemplate is the name of your site template saved in the sites gallery or you may use any of the default sites e.g. STS#0 for Team Site, BLOG#0 for Blog site (see reference at http://msdn.microsoft.com/en-us/library/ms473439.aspx) | |  | | Method | GetListByGuid(listGuid as Guid) | List |
Returns List object by unique list guid. | |  | | Method | GetListByName(listName as String) | List |
Returns List object by given list display name (or list title). | |  | | Method | GetSubweb(UrlAlias as String) | Web |
For security reasons you can manage subsites and never parent sites. | |  | | Method | GetUserByID(CommaSeparatedUserIDs as String) | User | Returns User object (single or multivalue) based on comma separated user IDs e.g. CurrentWeb().GetUserByID("5,6,7") will result in User object consisting of three SharePoint users (if found such ID's in given site collection). | |  | | Method | HasUserPermission(u as User, PermissionLevelName as String) | Boolean | Returns True when given user has given permission on this web site e.g. CurrentWeb().HasUserPermission( CurrentUser(), "Read") will result with True when this user has Read permission (or any of the SharePoint groups this user belongs to). | |  | | Method | SetPermissionAdd(PermissionLevelName as String, Users as User) | |
Adding new permissions for WebSite. Check description for similar ListRow.SetPermissionAdd().
For security reasons you are not allowed to change permissions on current and parent web sites - applies only to subsites. | |  | | Method | SetPermissionClear() | |
Clears all the permissions for this WebSite - usually to start adding new permissions from scratch. Check description for similar ListRow.SetPermissionClear()
For security reasons you are not allowed to change permissions on current and parent web sites - applies only to subsites. | |  | | Method | SetPermissionInherit() | |
Sets web permissions to be inherited from parent. Check description for similar ListRow.SetPermissionInherit().
For security reasons you are not allowed to change permissions on current and parent web sites - applies only to subsites. | |  | | Method | ToString() | String |
Converts Web to String and returns URL part of Link attribute only. Safe to call even if object is null. | |  | | Value | Dim x As Web | |
Declaring new variable of type SharePoint Web | |
|
|
|
|