===== THISDATACOLL ===== \\ As with the treatment of dataobjects, when we speak of the **datacoll** scope, we do not refer to an object with a fixed name that remains active throughout the execution of the application. Unlike **appdata**, this field does not have a specific name, but rather the user, through the work process with collections, decides to assign such name. \\ At the following example, we see how the objects of coll type would be as ":CollTestigos" as "a". To make easier the understanding and maintenance of the code, it is preferable using a notation similar than "CollTestigos". \\ Set CollTestigos=appdata.GetCollection("TestigosCYCIn") Set a=appdata.GetCollection("TAREAID") \\ So, in this section we are going to describe functions which utility makes reference to collections, and in turn, they will be composed of objects which we can work with. \\ ===AccesString=== \\ ^ Type |Property| ^ Access |Reading| ^ Type of data returned |Text| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ It returns the access string to data of the collection, with the macros replaced, with no filters and no subqueries. \\ \\ It is basically used to debug and something like that.\\ \\ ===AddItem=== \\ ^ Type |Method| ^ Parameters |**Item**: Object to be added to the collection .**Index**: Optional. Index in which we want to insert the object.| ^ Type of data returned |None| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ \\ It adds the object passed as parameter to the collection. \\ \\ Optionally it allows to insert it in the position we want within the set of objects there is inside the collection. \\ \\ If the **Index** parameter is not passed (its value is **Empty**), the object will be insered at the end of the collection. \\ \\ This is the most used behaviour.\\ \\ **Example of Use:** Set Obj=Coll.CreateObject Obj("LOGIN")=This("MAP_USUARIO") Obj("FECHAATT")=Now Obj("UPWD")=This("MAP_PWD") Coll.AddItem Empty,ObjG Obj.save Set Obj=nothing \\ ===BrowseDeleteAll=== \\ ^ Type |Method| ^ Type of data returned |None| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ \\ It deletes from the database all the objects that meet the conditions of the access string and the filters of the collection. \\ It is the equivalent to run a collection with **StartBrowse, MoveNext** and delete each of them. \\ \\ It is the most recommended method to delete sets of big objects, since loading all the objects with **LoadAll** and then delete them with **DeleteAll** it is a waste.\\ \\ **Example of Use:** \\ this.contents("Presupuesto").BrowseDeleteAll ----- Set Coll=AppData.GetCollection("TerminadasBorradoFinalizadas") filtro=Coll.LinkFilter Coll.LinkFilter="ACEPTADA=2 OR (ESTADO=1 AND FECHA<"+CStr(ahora)+")" Coll.BrowseDeleteAll Coll.LinkFilter=filtro Set Coll=Nothing \\ ===BrowseDeleteWithNoRules=== \\ ^ Type |Method| ^ Type of data returned |None| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ It is similar than **BrowseDeleteAll]** but the rules for removing objects are not checked.\\ \\ This system is used to delete quicly and with no interruption a big deal of object. \\ \\ As the removing rules are not checked, the actions are executed with greater speed and there is no possibility to interrup the cycle by failing any delete rule. \\ \\ **Example of use:** \\ this.contents("Presupuesto").BrowseDeleteWithNoRules \\ ===BrowseLength=== \\ ^ Type |Property| ^ Access |Reading| ^ Type of data returned |Integer| ^ Plataorm |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ \\ It returns the amount of object that will be run in the**StartBrowse**active cycle.\\ If there is no cycle active, or if the one has been activated by passing **False** (or not passing anything) to the call to **StartBrowse**, this property returns -1. In the Win32 platforms(PC, Web, Windows Mobile) this property always returns -1 unless that the database supports records counting, or in negative case, that the collection has the **alternate-counter=true** attribute. \\ \\ In cases such as MySQL this is always like that. \\ \\ The mobile platforms different than WM always use the alternative method, so they do not depend on the type of database used. \\ \\ **Example of Use:** \\ ..... coll.StartBrowse true nLenData=coll.BrowseLength ..... \\ ===Clear=== \\ ^ Type |Method| ^ Type of data returned |None| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ It clears the collection (downloading the objects it has).\\ \\ The call to this method does not affect the **StartBrowse** actives browse, so **CurrentItem** won´t be affected by the call to this method. \\ \\ It is important that if we have references to objects that are loaded in the collection, such references are canceled before calling to **Clear**, since in platforms working with COM errors can occur when trying to cancel the references later, or when exiting from the script, since when the references come out from the scope they will try to release and being the objects destroyed, errors will occur.\\ \\ This same scripts, when executing in backgrounds that not use COM, they wouldn´t give error whereas we do not try to use the references later, which wouldn´t imply that they were well programmed, but just they are develooped by using a different technology. \\ \\ The order at the time to release memory:\\ - Cancel references to objects. - Clear collections. - Cancel references to collections. \\ **Example of use:** .... obj.save set obj=Nothing coll.Clear set coll=Nothing \\ ===CollPropertyValue=== \\ ^ Type |Property| ^ Access |Reading| ^ Parameters |**AttrName**: Name of the attribute of the collection which value we want to get.| ^ Type of data returned |Text| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ It returns the value of an attribute of the collection heading. \\ \\ coll.CollPropertyValue("title") If there is an active platform and there is the <**platfom**> node for it within the collection, the value will be searched first within such node. \\ \\ If the attribute doesn´t exist or it has no value, the property will return an empty string. \\ \\ ===Count=== \\ ^ Type |Property| ^ Access |Reading | ^ Type of data returned |Integer| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)|\\ \\ It returns the amount of objects loaded in memory by this collection. \\ \\ The objects can be loaded by calling to **LoadAll**, by calling to **AddItem**, or by making searches that load objects in memory (Item o FindObject).\\ .... Set Coll=appdata.GetCollection("UserAttempts") Coll.filter="t1.LOGIN="+appdata.varianttostring(This("MAP_USUARIO")) Coll.LoadAll cantidad=Coll.Count if cantidad<5 then .... \\ ===CreateClone=== \\ ^ Type |Method| ^ Type of data returned |XOneDataCollection| ^ Platform | Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ It creates a copy of the collection and it returns it. \\ \\ The content of the collection is not copied, in case we want to copy also the data, we have to do it by hand. \\ Set Usuarios=AppData.GetCollection("Usuarios").CreateClone Usuarios.Filter="t1.LOGIN='" + Cstr(This("MAP_USUARIO")) + "'" Usuarios.StartBrowse Set Usuario=Usuarios.CurrentItem Set UCorrecto=false If Not Usuario Is Null Then If This("MAP_PWD") = Usuario("PWD") Then UCorrecto = True End if End If Usuarios.EndBrowse Set Usuario=nothing Set Usuarios=Nothing \\ ===CreateObject=== \\ ^ Type |Method| ^ Parameters |**NewObj**: Optional. **True** to create a new object (Value by default) or **False** to create an object that will be used to load the database, etc. | ^ Type of data returned |XOneDataObject| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ It creates a new object by using the collection templates. \\ \\ The class used to build the object will be taken from the "progid" attribute of the collection. \\ \\ Each platform uses a map to transfer the names of the progids to the names of the class recognaised by such platform.\\ \\ In those ones in which there is the possibility to use reflection, it can be used the “**classname**” attribute to indicate directly the class name, although the most advisable is using the same progid as always and let the platform makes the conversion. \\ \\ Whatever the class used, it will be descendent from the **XoneDataObject** base class or whatever it is called in any platform.\\ \\ Now, the createObject method can be passed parameters.\\ \\ ^PARAMETERS^ |It initializes the props indicated in the object.| |It adds the object to the “addItem” coll, possible values true/false.| \\ **Examples:**\\ \\ var param = { USUARIO:”usuario 1”, DESCRIPCION:”Descripción de usuario 1” } var obj = appData.getCollection(“Usuarios”).createObject(param); \\ var param = { USUARIO:”usuario 1”, DESCRIPCION:”Descripción de usuario 1” } var obj = appData.getCollection(“Usuarios”).createObject(param,true); Set coll=appdata.getcollection("Previstas") Set det=coll.CreateObject coll.AddItem Empty, det det("IDENCARGO")=this("IDENCARGO") det("IDEMPRESA")=this("IDEMPRESA") det("IDUSUARIO")=this("IDUSUARIO") det("MODELOPLATAFORMA")=this("MODELOPLATAFORMA") det("NUMCOMPLETO")=this("NUMCOMPLETO") det("FECHA")=this("FPREVISTA") det("HORA")=this("HPREVISTA") det.Save set det=nothing set coll=nothing \\ ===CurrentItem=== \\ ^ Type |Property| ^ Access |Reading| ^ Type of data returned |XOneDataObject| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ It returns the current object of the **StartBrowse** active browser.\\ \\ If there is no active browser, this property worths **Nothing**. This is what is used to know that a browser is over. \\ \\ Appart from the PC and web platforms, all the rest use by default the same object and only replace the properties when moving by the browse, so the references must be not compared but the values (prefereably from the keys) in order to know which object is the one that is active in every moment or if the current object has changed. \\ \\ \\ Set Coll=appdata.GetCollection("ClasificarBlanco") Coll.StartBrowse Set Obj=Coll.CurrentItem If not Obj is nothing then .... \\ ===DeleteAll=== \\ ^ Type |Method| ^ Type of data returned |None| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ It deletes all the object that are loaded in the collection. \\ \\ The objects are deleted from the database (if the delete conditions are met) and then they are removed from the collection. \\ \\ If any of the If any of the rules of elimination of any of the objects fails, the execution is interrupted at that moment.\\ \\ It is most advisable thing could be use the BrowseDeleteAll method, but if we already have done a LoadAll we can use this one. \\ \\ ===DeleteItem=== \\ ^ Type |Method| ^ Parameters |**ObjectKey**: Key of the object that will be deleted. It can be a string that identifies the key or an integer that identifies the index inside the collection. | ^ Type of data returned |None| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ It deletes the object which key or index is indicated, both of the collection and the database. \\ \\ If the delete rules are not met, the method fails and launch an error. \\ \\ If the execution of any delete actions fails, the object is not deleted either and an error will be launched. \\ \\ The example that follows, browse a collection of sale details, it checks if the field IDARTICULO=0, then it deletes the line. \\ \\ Set cDetVenta=This.Contents("DetVenta") i =0 While i \\ ===DevelopedAccessString=== \\ ^ Type |Property| ^ Access |Reading| ^ Type of data returned |Text| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ It returns the access string to data of the collection with all the macros replaced, the filters applied and in case it is about a collection supporting subqueries, already prepared to be used in the database or in the remote connection that is going to be executed. \\ \\ ===DevelopedFilter=== \\ ^ Type |Property| ^ Access |Reading| ^ Type of data returned |Text| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ It returns the main filter of the collection already developed with the macros replaced and ready to be used inside the data access string.\\ \\ ===DevelopedLinkFilter=== \\ ^ Type | Property| ^ Access |Reading | ^ Type of data returned |Text| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ It returns the link filter of the collection (**LinkFilter**) already developed and with the macros replaced, ready to be used in the data acces string. \\ \\ AppData.CurrentEnterprise.Variables("COLLFILTER")=this.contents("ImpDocumento").DevelopedLinkFilter+" AND t1.id="+cstr(IDDoc) \\ ===EndBrowse=== \\ ^ Type |Method| ^ Type of data returned |None | ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed) | \\ It ends the active browse in the collection. \\ \\ If there is no browse, this function does nothing.\\ \\ The call to this method always cancels **CurrentItem**, but it doesn´t affect to the objects loaded in memory through **LoadAll**, searches or calls to **AddItem**.\\ \\ Set Usuarios=AppData.GetCollection("Usuarios").CreateClone Usuarios.Filter="t1.LOGIN='" + Cstr(This("MAP_USUARIO")) + "'" Usuarios.StartBrowse Set Usuario=Usuarios.CurrentItem Set UCorrecto=false If Not Usuario Is Null Then If This("MAP_PWD") = Usuario("PWD") Then UCorrecto = True End if End If Usuarios.EndBrowse Set Usuario=nothing Set Usuarios=Nothing \\ ===ExecuteSqlString=== \\ ^ Type | Method| ^ Parameters | CommandString -SentenciaSQL| ^ Type of data returned | Text| ^ Platform | Win32, Web,.NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed) | \\ It executes a SQL sentence by using a collection. It is useful for the maintenances, since if we define a ForMaintenance collection without replica, the sentences executed through would not be replicated. If it is used as source in a "traditional" collection, the ExecuteSqlString functioning is equivalent to AppData.ExecuteSQL.\\ \\ \\ Example of use: 'Actualizar el campo REPORTADO localmente, no replicar appdata.GetCollection("ForMaintenance").ExecuteSqlString "UPDATE gen_instalaciones SET REPORTADO=0 WHERE ID=" + CStr(This("ID")) 'Actualizar el campo REPORTADO y replicarlo appdata.GetCollection("ForUpdates").ExecuteSqlString "UPDATE gen_instalaciones SET REPORTADO=0 WHERE ID=" + CStr(This("ID")) \\ ===Filter=== \\ ^ Type |Property| ^ Access |Reading-Writing| ^ Type of data returned |Text | ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ It returns or assigns value to the main filter of the collection. \\ \\ The filter there is in the **filter** attribute of the collection in the mappings, **IT IS NOT** this filter. \\ \\ This filter is the one used in the UI when the content is filtered through the visual controls. \\ \\ \\ Modifying this filter does not affect to a contents selection, since it is not the one used to limit the objects that are part of such contents. \\ Coll.filter="t1.LOGIN="+appdata.varianttostring(This("MAP_USUARIO")) \\ ===FindObject=== \\ ^ Type |Method| ^ Parameters |**SearchCriteria**: Search criteria. This string has the same format than the used one to put filters to the collection, and in fact, it can even have macros and else. | ^ Type of data returned |[XOneDataObject| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ It searchs an object by following the search criteria passed as parameter. \\ \\ The format used is the same than the one to filter the collection. \\ \\ If the object is not found as result of the query, the method returns **Nothing**.\\ \\ set Coll=Appdata.GetCollection("ConsultaExistencias") set Obj = Coll.FindObject("SERIE='"+Cstr(this("MAP_SERIE"))+"' AND IDALMACEN="+Cstr(this("IDALMACEN"))) If not Obj is nothing then Obj("EXIST")=Obj("EXIST")+1 Obj.Save End If Set Obj=Nothing Coll.Clear Set Coll=Nothing \\ ===Full=== \\ ^ Type |Property| ^ Access |Reading| ^ Type of data returned |Boolean (Integer)| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ It returns **True** (not zero) if the collection is full (it has been named **LoadAll** and every object that met with the criterium have been loaded.). It returns **False** (zero) if the collection has not been loaded with **LoadAll**, or after loading it some objects have been deleted or some searches have been made which modify the load status of the collection. \\ \\ ===GenerateRowID=== \\ ^ Type |Method| ^ Type of data returned |Text| ^ Platform | Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ It generates a ROWID by using the replica data of the connection used in the collection, as well as the table data and else. \\ \\ This method encapsulates to the internal system of ROWIDs generation so it is quite safe to use it to generate unique values. \\ \\ In all the environments that support it the GUIDs generation methods are used. In those in which this mechanism is not available, it is about to use a machinery of En todos los entornos que lo soporten se usan los métodos de generación de GUIDs. En aquellos en que este mecanismo no está disponible se trata de usar una random number generation machinery as secure as possible.\\ \\ Example of use: \\ 'Usar para generar un nombre único y asignárselo a un fichero jpg This("MAP_FILENAME")="FT" + User("LOGIN")+ "_" + AppData.GetCollection("CollParaRowid").GenerateRowId + ".jpg" \\ ===Group=== \\ ^ Type |Property| ^ Access |Reading| ^ Parameters |**Index**: ID of the group which name we want to get. | ^ Type of data returned |Text| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ It returns the visible name of a group of the collection given its ID.\\ \\ If the group has inside **platform** node and there is active platform, first it will be searched in such node and after in the name of group.\\ \\ ===GroupCount=== \\ ^ Type |Property| ^ Access |Reading| ^ Type of data returned |Integer| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ It returns the amount of groups there are declared in the collection. \\ \\ ===IDFieldName=== \\ ^ Type |Property| ^ Access |Reading| ^ Type of data returned |Text| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ It returns the name of the key field of the collection. \\ \\ Usually, key field is not declared, but it is used the value by default (ID). In case the key field has another name, it will be defined in the collection heading and that is the valud that this property returns. \\ \\ ===IDOutCurrency=== \\ ^ Type |Property| ^ Access |Reading-Writing| ^ Type of data returned |Integer| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ It returns the ID of the currency to be used to clean monetary amounts in the list, and in the outputs used by this collection. \\ \\ This property only works in the platforms displayed in the table, although they can be consulted in any platform, except that its value always be zero. \\ \\ Assigning value to this property in another platform different than the diplayed ones in the table neither will have any effect.\\ \\ ===IsBrowsing=== \\ ^ Type |Property| ^ Access |Reading| ^ Type of data returned |Boolean (Integer)| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ It returns True (not zero) if the collection has a browse open **:StartBrowse**. The **CurrentItem** also can be checked, but in case the browse is at the end, **CurrentItem** will be **Nothing** and nevertheless it will have an open browse, that is, resources of the connection in use. \\ \\ It returns **False** (zero) if there is no active browse. \\ \\ ===IsLocked=== \\ ^ Type |Property| ^ Access |Reading| ^ Type of data returned |Boolean (Integer)| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ It returns **True** (not zero) if the collection is locked by using **Lock**. It returns **False** (zero) if the collection is free (its normal status).\\ \\ ===Item=== \\ ^ Type |Property| ^ Access |Reading| ^ Parameters |**Key**: Key (in text format), Numeric index of the object, or field name by which we want to search. **Val**: Optional. Value by which we want to search. Missed if we are going to search by key. | ^ Type of data returned |XOneDataObject| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ It returns an object of the collection given its key taken to text, its index inside the collection or the value of one of its fields. \\ \\ The numeric index search is always made in memory. The search by key of by field pair, value is done first in memory and in case not finding the object with these features, the search will be made in the data connection. \\ \\ This allows to accelerate the searchs in collections that have few elements by loading them in memory and keeping them there during the execution of the application. \\ \\ ===LinkFilter=== \\ ^ Type |Property| ^ Acces |Reading| ^ Type of data returned |Text| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ It returns the value of the link filter of the collection. \\ \\ This is the filter which is declared in the **filter** attribute of the collection in the mappings, or in the contents declaration and as its name indicates it is an auxiliary filter that wouldn´t be modified in execution time. \\ \\ \\ Even so, everyone can do what he thinks fit.\\ \\ ===LoadAll=== \\ ^ Type |Method| ^ Type of data returned |None| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ It loads in memory all the objects that meet with the filtering criteria the collection has. \\ \\ It is important before calling to this method to make sure there are filters put already, since in case there are too many objects that meet the criteria, a problem with lack of memory may occur.\\ \\ \\ Example of use:\\ \\ Set cDetVenta=This.Contents("DetVenta") cDetVenta.filter="d.IDDOCUMENTO=" + CStr(This("ID")) cDetVenta.LoadAll \\ ===Lock=== \\ ^ Type |Method| ^ Type of data returned |None| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ It locks the collection to avoid its content will be modified. \\ \\ If the collection is locked, the **LoadAll** and **Clear** methods won´t have any effect over the collection content. \\ \\ The objects search is not affected by the lock status of the collection.\\ \\ The following example, clears and filters a collection of sales details, and then, it locks it in order not to modify it. \\ \\ Set cDetVenta=This.Contents("DetVenta") cDetVenta.UnLock cDetVenta.Clear cDetVenta.filter="d.IDDOCUMENTO=" + CStr(This("ID")) cDetVenta.LoadAll cDetVenta.Lock \\ ===Macro=== \\ ^ Type |Property| ^ Access |Reading-Writing| ^ Parameters |Name: Macro name which value we want to read or assign.| ^ Type of data returned |Text| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ It returns or assigns value to the macro which name it is indicated. \\ \\ The macros are replaced when the access strings, the filters and else are evaluated, so this is a way to achieve that the change of these data is made in a dynamic way during the execution of the program. \\ \\ ....... 'Después en un script, asignar valor a la macro ##NUMINCIDENCIA## para modificar el filtro de la colección Set cPiezas=AppData.GetCollection("ContarPiezas") cPiezas.macro("##NUMINCIDENCIA##")=AppData.VariantToString(nInc) cPiezas.StartBrowse ....... \\ ===MacroCount=== \\ ^ Type |Property| ^ Access |Reading| ^ Type of data returned |Integer| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ It returns the amount of macros there are defined in the collection, both those that have received value dynamically and those that have been declared in the mappings.\\ \\ ===MoveFirst=== \\ ^ Type |Method| ^ Type of data returned |None| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ It moves the browse to the first object of the collection. \\ \\ The method is defined in all the platforms, but in those in which are not shown, it has no effect.\\ \\ \\ In the platforms shown only works when the database associated to the connection supports it. \\ \\ \\ ===MoveLast=== \\ ^ Type |Method| ^ Type of data returned |None| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ It moves the browse to the last object of the collection. \\ \\ Same than **MoveFirst**, it only works in those platforms that work with several databases and specifically in those that allow this operation. \\ \\ In the platforms not shown, the method has no effect.\\ \\ ===MovePrevious=== \\ ^ Type |Method| ^ Type of data returned |None| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ It moves the browse to the previous object. Here, the same observations are fulfilled as for the **MoveFirst** or for **MoveLast**.\\ \\ ===MoveNext=== \\ ^ Type |Method| ^ Type of data returned |None| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ It moves the browse toward the next object. \\ \\ If as a result of the movement, the end of the browse is reached, the current object (**CurrentItem**) will be **Nothing** to indicate that the browse has ended.\\ \\ Set cRec =AppData.GetCollection("RecPend") cRec.filter="r.IDCLIENTE=" + CStr(This("IDCLIENTE")) cRec.StartBrowse While Not cRec.Currentitem is Nothing Set ObjRec = cRec.Currentitem ....... Set ObjRec = Nothing cRec.MoveNext Wend ..... \\ ===MultipleKey=== \\ ^ Type |Property| ^ Access |Reading| ^ Type of data returned |Boolean (Integer)| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ \\ It returns **true** (not zero) if the key of the object is multiple or **False** (zero) if the key is a single field.\\ \\ This property always returns **False** in the platforms that are not listed in the table, since in these platforms the use of multiple keys is not supported.\\ \\ Actually, the multiple keys are designed to use the XOne machinery with databases designed for other apps use, something that in mobility is not the case, since the idea is that the mobile application has a database designed from the first moment. \\ \\ The integration interface with the possible backend must take care of translate the multiple keys into a single key (usually an autonumeric field).\\ \\ ===Name=== \\ ^ Type |Property| ^ Access |Reading| ^ Type of data returned |Text| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ It returns the collection name, such as declared in the mappings.\\ \\ Example of use:\\ \\ ' Se comprueba si el nombre de la colección padre es MenuPersonalizado antes de modificar la propiedad MAP_IDSELECCIONADO If This.OwnerCollection.Name="MenuPersonalizado" Then This("MAP_IDSELECCIONADO")=0 End If \\ ===OwnerApp=== \\ ^ Type |Property| ^ Access |Reading| ^ Type of data |XOneApplication| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ It returns the application owner of the collection. \\ \\ Because in an execution environment there can not be more than one application, the value of this property is the same one as that of the **AppData** global variable .\\ \\ ===OwnerObject=== \\ ^ Type |Property| ^ Access |Reading| ^ Type of data returned |XOneDataObject| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ It returns the owner object of the collection.\\ \\ This owner has value only when the collection is a contents. \\ \\ If it is about a global collection or if it is a copy of a contents, the value of this property is **Nothing**.\\ \\ \\ ===PropertyCount=== \\ ^ Type |Property| ^ Access |Reading| ^ Type of data returned |Integer| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ It returns the amount of properties the collection has. \\ \\ If the collection inherit from another one, this property returns the correct amount of properties (the own ones plus those inherited from the father). Although the inheritance mechanism is not very decent, at least, what works works on all platforms.\\ \\ \\ Anyway, that of trying not to use the mechanism of inheritance remains valid until further notice.\\ \\ ===PropertyName=== \\ ^ Type |Property| ^ Access |Reading| ^ Parameters |**Index**:Numeric index of the property which name we want to know. | ^ Type of data returned |Text| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ It returns the name of a property of the collection given its numeric index (in order of declaration in the mappings. ).\\ \\ With this name we can access the properties and methods that have as parameter a field name. \\ \\ ===PropertyTitle=== \\ ^ Type |Property| ^ Access |Reading| ^ Parameters |**FieldName**:Field name as declared in the mapping.| ^ Type of data returned |Text| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ It returns the property title (data field) of the collection. \\ \\ If there is an active platform and this property has a **platform** node, firstly, it will be searched in this node the **title** attribute. If it is not found, the **title** attribute of the property will be searched, and in case of not appearing, the text of the **prop** node will be returned. \\ \\ If the node has no text, the field name will be returned. \\ \\ \\ ===PropertyGroup=== \\ ^ Type |Property| ^ Access |Reading| ^ Parameters |**FieldName**:Name of the field as declared in the mapping.| ^ Type of data returned |Text| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ ===PropType=== \\ ^ Type |Property| ^ Access |Reading| ^ Parameters |**FieldName**:Name of the field as declared in the mappings. | ^ Type of data returned |Text| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ It returns the type of the data property as declared in the mappings. \\ \\ It returns the name of the group to which the property belongs in the collection.\\ \\ In order to search the name, the rules of the platforms displayed in the previous properties are followed.\\ \\ ===PropVisibility=== \\ ^ Type |Property| ^ Access |Reading| ^ Parameters |**FieldName**:Name of the field as declared in the mapping.| ^ Type of data returned |Text| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ It returns the value of the **visible** field of the property. \\ \\ It meets the rules of the platforms previously described. If at the end of all the tests there is no value to return, it will be returned **1**, since the value by default of visibility is always **1**.\\ \\ \\ ===RemoveItem=== \\ ^ Type |Method| ^ Parameters |**Index**:Numeric index of the object we want to take from the collection or text key to search in the collection and remove it from it.| ^ Type of data returned |None| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ It removes from the collection the object which index or key is passed as parameter. \\ \\ The object is not removed from the database, only from the collection. \\ \\ ===SaveAll=== \\ ^ Type |Method| ^ Type of data returned |None| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ It saves all the object that the collection has. \\ \\ If any recording fails the method will stop and the occurred error will be launched.\\ \\ ===Sort=== \\ ^ Type |Property| ^ Access |Reading-Writing| ^ Type of data returned |Integer| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ It returns or assigns the sorting string to the collection. \\ \\ The sintax is the same one than an ORDER BY sentence must have in a SQL string. \\ The value that this property has when the collection is created is the value of the **sort** atribute of the collection heading. \\ \\ .... 'Ordenar la colección Kilometraje por FECHA descendente, antes de comenzar a recorrerla Set cKm = AppData.GetCollection("Kilometraje") cKm.sort="FECHA DESC" cKm.StartBrowse ... \\ === StartBrowse === \\ ^ Type |Method| ^ Parameters |**Count**: Optional. True to count the objects that will be browsed or False (value by default) for not launching the counting.| ^ Type of data returned |Integer| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ It starts a browse by following the rules of the access string, filters and collection sorting. \\ \\ If there is at least an object, this one will be loaded in the **CurrentItem**. If it is passed to **True** as parameter, the collection counts the amount of objects that are going to be browsed. \\ \\ Set Usuarios=AppData.GetCollection("Usuarios").CreateClone Usuarios.Filter="t1.LOGIN='" + Cstr(This("MAP_USUARIO")) + "'" Usuarios.StartBrowse Set Usuario=Usuarios.CurrentItem Set UCorrecto=false If Not Usuario Is Null Then If This("MAP_PWD") = Usuario("PWD") Then UCorrecto = True End if End If Usuarios.EndBrowse Set Usuario=nothing Set Usuarios=nothing \\ ===StringKey=== \\ ^ Type |Property| ^ Access |Reading| ^ Type of data returned |Boolean (Integer)| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ It returns **True** (Not zero) if the collection uses a non-numeric key (usually is used together with “**idfieldname**” to use keys set different than the ones used in the XOne databases).\\ \\ **It returns False** (zero) when the key is numeric (value by default).\\ The way of counting will depend on the platforma and the database.\\ \\ ===Unlock=== \\ ^ Type |Method| ^ Type of data returned |None| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ It unlocks the collection in order to use **Clear** and **LoadAll** again.\\ \\ The following example, clears and filters a collection of sales details and then, it locks it so that it does not change. \\ \\ Set cDetVenta=This.Contents("DetVenta") cDetVenta.UnLock cDetVenta.Clear cDetVenta.filter="d.IDDOCUMENTO=" + CStr(This("ID")) cDetVenta.LoadAll cDetVenta.Lock \\ ===UpdateIdFieldName=== \\ ^ Type |Property| ^ Access |Reading| ^ Type of data returned |Text| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ It returns the name of the key field used for the updates. \\ \\ Usually, this field is the same than **IdFieldName**, although there may be cases in which it is read in one object and written in another, so the update field may be different. \\ \\ Also, it may happen that the key field is qualified and we want to use it without qualifying in order to be able to update the data. \\ \\ ===Variables=== \\ ^ Type |Property| ^ Access |Reading-Writing| ^ Parameters |**Item**:Name of the variable we want to read or assign. | ^ Type of data returned |Text| ^ Platform |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ It returns or assigns value to the variable which name is indicated. \\ \\ The collections also may have variables, what allows there to be an really global environment to storage values that go beyond the scripts scopes, since the global collection always are. \\ \\ \\ The values stored in the variables of the global collections can be kept there while the execution of the application is maintained or while the variables are not cleaned. \\ \\ \\ /* Esta referencia apunta a la colección dentro de la cual se está ejecutando el script actual. Los scripts que se ejecuten dentro de un ámbito de objeto tendrán esta referencia a **Nothing**.\\ \\ ====AccesString==== \\ ^ Tipo |Propiedad| ^ Acceso |Lectura| ^ Tipo de Dato devuelto |Texto| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ Devuelve la cadena de acceso a datos de la colección, con las macros sustituidas, sin los filtros y sin subqueries ni nada.\\ \\ Se usa básicamente para depurar y cosas por el estilo.\\ \\ ====AddItem==== \\ ^ Tipo |Método| ^ Parámetros |**Item**: Objeto que se va a adicionar a la colección **Index**: Opcional. Índice en el que se quiere insertar el objeto.| ^ Tipo de Dato devuelto |Ninguno| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ \\ Adiciona el objeto que se pasa como parámetro a la colección.\\ \\ Opcionalmente permite insertarlo en la posición que se quiera dentro del conjunto de objetos que haya dentro de la colección.\\ \\ Si el parámetro **Index** no se pasa (lleva valor **Empty**), se insertará el objeto al final de la colección.\\ \\ Este es el comportamiento más usado.\\ \\ **Ejemplo de Uso:** Set Obj=Coll.CreateObject Obj("LOGIN")=This("MAP_USUARIO") Obj("FECHAATT")=Now Obj("UPWD")=This("MAP_PWD") Coll.AddItem Empty,ObjG Obj.save Set Obj=nothing ====BrowseDeleteAll==== \\ ^ Tipo |Método| ^ Tipo de Dato devuelto |Ninguno| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ \\ Elimina de la base de datos todos los objetos que cumplen las condiciones de la cadena de acceso y los filtros de la colección.\\ \\ Es el equivalente a recorrer una colección con **StartBrowse-MoveNext** y borrar cada uno de ellos. \\ \\ Es el método más recomendable para borrar conjuntos de objetos grandes, ya que cargar todos los objetos con **LoadAll** y después borrarlos con **DeleteAll** es un desperdicio.\\ \\ **Ejemplo de Uso:** this.contents("Presupuesto").BrowseDeleteAll ----- Set Coll=AppData.GetCollection("TerminadasBorradoFinalizadas") filtro=Coll.LinkFilter Coll.LinkFilter="ACEPTADA=2 OR (ESTADO=1 AND FECHA<"+CStr(ahora)+")" Coll.BrowseDeleteAll Coll.LinkFilter=filtro Set Coll=Nothing ====BrowseDeleteWithNoRules==== \\ ^ Tipo |Método| ^ Tipo de Dato devuelto |Ninguno| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ Similar a **BrowseDeleteAll** pero no se comprueban las reglas de eliminación de los objetos.\\ \\ Este sistema es usado para borrar de forma rápida y sin interrupción una cantidad grande de objetos.\\ \\ Como no se comprueban las reglas de eliminación, las acciones se ejecutan con mayor velocidad y no hay posibilidad de que se interrumpa el ciclo al fallar alguna regla de borrado.\\ \\ **Ejemplo de Uso:** this.contents("Presupuesto").BrowseDeleteWithNoRules ====BrowseLength==== \\ ^ Tipo |Propiedad| ^ Acceso |Lectura| ^ Tipo de Dato devuelto |Entero| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ \\ Devuelve la cantidad de objetos que serán recorridos en el ciclo **StartBrowse** activo.\\ Si no hay activo ningún ciclo, o si el que hay se ha activado pasando **False** (o no pasando nada) a la llamada a **StartBrowse**, esta propiedad devuelve -1. En las plataformas Win32 (PC, Web, Windows Mobile) esta propiedad devuelve siempre -1 a menos que la base de datos soporte conteo de registros, o en caso negativo, que la colección tenga el atributo **alternate-counter=true**. \\ \\ En casos como MySQL esto es siempre así. \\ \\ Las plataformas móviles diferentes de WM siempre usan el método alternativo, por lo que no dependen del tipo de base de datos usado.\\ \\ **Ejemplo de Uso:** ..... coll.StartBrowse true nLenData=coll.BrowseLength ..... ====Clear==== \\ ^ Tipo |Método| ^ Tipo de Dato devuelto |Ninguno| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ Limpia la colección (descarga los objetos que contiene).\\ \\ La llamada a este método no afecta los recorridos **StartBrowse** activos, por lo que **CurrentItem** no se verá afectado por la llamada a este método. \\ \\ Es importante que si se tienen referencias a objetos que están cargados en la colección, dichas referencias se anulen antes de llamara a **Clear**, ya que en plataformas que trabajan con COM pueden ocurrir errores al tratar de anular las referencias posteriormente, o al salir del script, ya que cuando las referencias salen de ámbito intentarán liberarse y al estar destruidos los objetos, se producirán errores.\\ \\ Estos mismos scripts, al ejecutarse en entornos que no usen COM, no darían error mientras no se traten de usar las referencias posteriormente, lo cual no implicaría que estuvieran bien programados, sino que simplemente están desarrollados usando una tecnología diferente.\\ \\ El orden a la hora de liberar memoria:\\ - Anular referencias a objetos. - Limpiar colecciones. - Anular referencias a colecciones. **Ejemplo de Uso:** .... obj.save set obj=Nothing coll.Clear set coll=Nothing ====CollPropertyValue==== \\ ^ Tipo |Propiedad| ^ Acceso |Lectura| ^ Parámetros |**AttrName**: Nombre del atributo de la colección cuyo valor se quiere obtener.| ^ Tipo de Dato devuelto |Texto| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ Devuelve el valor de un atributo de la cabecera de la colección.\\ \\ coll.CollPropertyValue("title") Si hay una plataforma activa y existe el nodo <**platfom**> para la misma dentro de la colección, el valor se buscará primero dentro de dicho nodo.\\ \\ Si el atributo no existe o no tiene valor, la propiedad devolverá una cadena vacía.\\ \\ ====Count==== \\ ^ Tipo |Propiedad| ^ Acceso |Lectura | ^ Tipo de Dato devuelto |Entero| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)|\\ \\ Devuelve la cantidad de objetos cargados en memoria por esta colección.\\ \\ Los objetos se pueden cargar llamando a **LoadAll**, llamando a **AddItem**, o efectuando búsquedas que carguen objetos en memoria (Item o FindObject).\\ .... Set Coll=appdata.GetCollection("UserAttempts") Coll.filter="t1.LOGIN="+appdata.varianttostring(This("MAP_USUARIO")) Coll.LoadAll cantidad=Coll.Count if cantidad<5 then .... ====CreateClone==== \\ ^ Tipo |Método| ^ Tipo de Dato devuelto |XOneDataCollection| ^ Plataforma | Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ Crea una copia de la colección y la devuelve.\\ \\ El contenido de la colección no se copia, en caso de que se quieran copiar también los datos hay que hacerlo a mano.\\ Set Usuarios=AppData.GetCollection("Usuarios").CreateClone Usuarios.Filter="t1.LOGIN='" + Cstr(This("MAP_USUARIO")) + "'" Usuarios.StartBrowse Set Usuario=Usuarios.CurrentItem Set UCorrecto=false If Not Usuario Is Null Then If This("MAP_PWD") = Usuario("PWD") Then UCorrecto = True End if End If Usuarios.EndBrowse Set Usuario=nothing Set Usuarios=Nothing ====CreateObject==== \\ ^ Tipo |Método| ^ Parámetros |**NewObj**: Opcional. **True** para crear un objeto nuevo (Valor por defecto) o **False** para crear un objeto que se usará para cargar de base de datos, etc. | ^ Tipo de Dato devuelto |XOneDataObject| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ Crea un nuevo objeto usando las plantillas de la colección. \\ \\ La clase usada para construir el objeto se sacará del atributo “progid” de la colección. \\ \\ Cada plataforma utiliza un mapa para pasar los nombres de los progids a los nombres de clase reconocidos por dicha plataforma. \\ \\ En aquellas en las que hay posibilidad de usar reflexión, se puede usar el atributo “**classname**” para indicar directamente el nombre de clase, aunque lo más recomendable es utilizar el progid de siempre y dejar que la plataforma efectúe la conversión.\\ \\ Cualquiera que haya sido la clase utilizada, será descendiente de la clase base **XoneDataObject** o como se llame en cada plataforma.\\ Set coll=appdata.getcollection("Previstas") Set det=coll.CreateObject coll.AddItem Empty, det det("IDENCARGO")=this("IDENCARGO") det("IDEMPRESA")=this("IDEMPRESA") det("IDUSUARIO")=this("IDUSUARIO") det("MODELOPLATAFORMA")=this("MODELOPLATAFORMA") det("NUMCOMPLETO")=this("NUMCOMPLETO") det("FECHA")=this("FPREVISTA") det("HORA")=this("HPREVISTA") det.Save set det=nothing set coll=nothing ====CurrentItem==== \\ ^ Tipo |Propiedad| ^ Acceso |Lectura| ^ Tipo de Dato devuelto |XOneDataObject| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ Devuelve el objeto actual del recorrido **StartBrowse** activo.\\ \\ Si no hay ningún recorrido activo, esta propiedad vale **Nothing**. Esto es lo que se utiliza para saber que un recorrido se ha acabado, pero claro, eso ya lo saben, así que para qué profundizar.\\ \\ Excepto las plataformas de PC y web, todas las demás utilizan por defecto el mismo objeto y solamente sustituyen las propiedades al moverse por el recorrido, así que no se deben comparar las referencias sino los valores (preferiblemente de las claves) para saber qué objeto es el que está activo en cada momento o si ha cambiado el objeto actual.\\ Set Coll=appdata.GetCollection("ClasificarBlanco") Coll.StartBrowse Set Obj=Coll.CurrentItem If not Obj is nothing then .... ====DeleteAll==== \\ ^ Tipo |Método| ^ Tipo de Dato devuelto |Ninguno| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ Borra todos los objetos que están cargados en la colección.\\ \\ Los objetos se borran de la base de datos (si se cumplen las condiciones de borrado) y después se eliminan de la colección.\\ \\ Si falla alguna de las reglas de eliminación de alguno de los objetos, la ejecución se interrumpe en ese momento.\\ \\ Es más recomendable utilizar el método BrowseDeleteAll, pero si ya hemos hecho un LoadAll podemos utilizar éste. ====DeleteItem==== \\ ^ Tipo |Método| ^ Parámetros |**ObjectKey**: Clave del objeto que se va a borrar. Puede ser una cadena que identifique la clave o un entero que identifique el índice dentro de la colección.| ^ Tipo de Dato devuelto |Ninguno| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ Borra el objeto cuya clave o índice se indica, tanto de la colección como de la base de datos.\\ \\ Si las reglas de borrado no se cumplen el método falla y lanza un error. \\ \\ Si falla la ejecución de alguna de las acciones de borrado, el objeto tampoco se elimina y se lanza un error.\\ \\ El siguiente ejemplo, recorre una colección de detalles de venta, comprueba si el campo IDARTICULO=0, entonces elimina la línea.\\ \\ Set cDetVenta=This.Contents("DetVenta") i =0 While i ====DevelopedAccessString==== \\ ^ Tipo |Propiedad| ^ Acceso |Lectura| ^ Tipo de Dato devuelto |Texto| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ Devuelve la cadena de acceso a datos de la colección con todas las macros sustituidas, los filtros aplicados y en caso de que se trate de una colección que soporte subqueries, ya preparada para usarse en la base de datos o en la conexión remota en que se vaya a ejecutar.\\ \\ ====DevelopedFilter==== \\ ^ Tipo |Propiedad| ^ Acceso |Lectura| ^ Tipo de Dato devuelto |Texto| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ Devuelve el filtro principal de la colección (Filter) ya desarrollado con las macros sustituidas y listo para usarse dentro de la cadena de acceso a datos.\\ \\ ====DevelopedLinkFilter==== \\ ^ Tipo | Propiedad| ^ Acceso |Lectura | ^ Tipo de Dato devuelto |Texto| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ Devuelve el filtro de enlace de la colección (**LinkFilter**) ya desarrollado y con las macros sustituidas listo para usarse en la cadena de acceso a datos.\\ AppData.CurrentEnterprise.Variables("COLLFILTER")=this.contents("ImpDocumento").DevelopedLinkFilter+" AND t1.id="+cstr(IDDoc) ====EndBrowse==== \\ ^ Tipo |Método| ^ Tipo de Dato devuelto |Ninguno | ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed) | \\ Termina el recorrido activo en la colección. \\ \\ Si no hay ningún recorrido, esta función no hace nada.\\ \\ La llamada a este método siempre anula **CurrentItem**, pero no afecta a los objetos cargados en memoria mediante **LoadAll**, búsquedas o llamadas a **AddItem**.\\ Set Usuarios=AppData.GetCollection("Usuarios").CreateClone Usuarios.Filter="t1.LOGIN='" + Cstr(This("MAP_USUARIO")) + "'" Usuarios.StartBrowse Set Usuario=Usuarios.CurrentItem Set UCorrecto=false If Not Usuario Is Null Then If This("MAP_PWD") = Usuario("PWD") Then UCorrecto = True End if End If Usuarios.EndBrowse Set Usuario=nothing Set Usuarios=Nothing ====ExecuteSqlString==== \\ ^ Tipo | Método| ^ Parámetros | CommandString/SentenciaSQL| ^ Tipo de Dato devuelto | Texto| ^ Plataforma | Win32, Web,.NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed) | \\ Ejecuta una sentencia SQL utilizando una colección. Es útil para los mantenimientos, ya que si se define una colección ForMaintenance sin réplica, las sentencias que se ejecuten a través de ella, no se replicarían. Si se usa como origen una colección "tradicional", el funcionamiento del ExecuteSqlString es equivalente al AppData.ExecuteSQL\\ \\ Ejemplo de Uso: 'Actualizar el campo REPORTADO localmente, no replicar appdata.GetCollection("ForMaintenance").ExecuteSqlString "UPDATE gen_instalaciones SET REPORTADO=0 WHERE ID=" + CStr(This("ID")) 'Actualizar el campo REPORTADO y replicarlo appdata.GetCollection("ForUpdates").ExecuteSqlString "UPDATE gen_instalaciones SET REPORTADO=0 WHERE ID=" + CStr(This("ID")) ====Filter==== \\ ^ Tipo |Propiedad| ^ Acceso |Lectura/Escritura| ^ Tipo de Dato devuelto |Texto | ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ Devuelve o asigna valor al filtro principal de la colección. \\ \\ El filtro que está en el atributo “**filter**” de la colección en el mappings **NO** es este filtro. \\ \\ Este filtro es el que se utiliza en el UI cuando se filtra el contenido mediante los controles visuales. \\ \\ Modificar este filtro tampoco afecta la selección de un contents, ya que no es el que se usa para limitar los objetos que forman parte de dicho contents.\\ Coll.filter="t1.LOGIN="+appdata.varianttostring(This("MAP_USUARIO")) ====FindObject==== \\ ^ Tipo |Método| ^ Parámetros |**SearchCriteria**: Criteros de búsqueda. Esta cadena tiene el mismo formato que la usada para poner filtros a la colección, y de hecho puede incluso contener macros y demás.| ^ Tipo de Dato devuelto |XOneDataObject| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ Busca un objeto siguiendo los criterios de búsqueda que se pasan como parámetro.\\ \\ El formato usado es el mismo que para filtrar la colección. \\ \\ Si el objeto no se encuentra como resultado de la búsqueda, el método devuelve **Nothing**.\\ set Coll=Appdata.GetCollection("ConsultaExistencias") set Obj = Coll.FindObject("SERIE='"+Cstr(this("MAP_SERIE"))+"' AND IDALMACEN="+Cstr(this("IDALMACEN"))) If not Obj is nothing then Obj("EXIST")=Obj("EXIST")+1 Obj.Save End If Set Obj=Nothing Coll.Clear Set Coll=Nothing ====Full==== \\ ^ Tipo |Propiedad| ^ Acceso |Lectura| ^ Tipo de Dato devuelto |Booleano (Entero)| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ Devuelve **True** (no cero) si la colección está llena (se ha llamado **LoadAll** y se han cargado todos los objetos que cumplen con el criterio). Devuelve **False** (cero) si la colección no se ha cargado con **LoadAll**, o después de cargarla se han eliminado objetos o se han efectuado búsquedas que modifican el estado de carga de la colección.\\ \\ ====GenerateRowID==== \\ ^ Tipo |Método| ^ Tipo de Dato devuelto |Texto| ^ Plataforma | Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ Genera un ROWID utilizando los datos de réplica de la conexión utilizada en la colección, así como datos de tabla y demás.\\ \\ Este método encapsula al sistema interno de generación de ROWIDs por lo que es bastante seguro usarlo para generar valores únicos. \\ \\ En todos los entornos que lo soporten se usan los métodos de generación de GUIDs. En aquellos en que este mecanismo no está disponible se trata de usar una maquinaria de generación de números aleatorios lo más segura posible.\\ \\ Ejemplo de uso: 'Usar para generar un nombre único y asignárselo a un fichero jpg This("MAP_FILENAME")="FT" + User("LOGIN")+ "_" + AppData.GetCollection("CollParaRowid").GenerateRowId + ".jpg" ====Group==== \\ ^ Tipo |Propiedad| ^ Acceso |Lectura| ^ Parámetros |**Index**: ID del grupo cuyo nombre se quiere obtener| ^ Tipo de Dato devuelto |Texto| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ Devuelve el nombre visible de un grupo de la colección dado su ID. \\ \\ Si el grupo tiene nodo <**platform**> dentro y hay plataforma activa, se buscará primero en dicho nodo y después en el nombre del grupo.\\ \\ ====GroupCount==== \\ ^ Tipo |Propiedad| ^ Acceso |Lectura| ^ Tipo de Dato devuelto |Entero| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ Devuelve la cantidad de grupos que hay declarados en la colección.\\ \\ ====IDFieldName==== \\ ^ Tipo |Propiedad| ^ Acceso |Lectura| ^ Tipo de Dato devuelto |Texto| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ Devuelve el nombre del campo clave de la colección.\\ \\ Normalmente no se declara campo clave, sino que se usa el valor por defecto (ID). En caso de que el campo clave tenga otro nombre, se define en la cabecera de la colección y ese es el valor que devuelve esta propiedad.\\ \\ ====IDOutCurrency==== \\ ^ Tipo |Propiedad| ^ Acceso |Lectura/Escritura| ^ Tipo de Dato devuelto |Entero| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ Devuelve el ID de la moneda que se va a usar para imprimir cantidades monetarias en los listados y en las salidas usadas por esta colección.\\ \\ Esta propiedad solamente funciona en las plataformas mostradas en la tabla, aunque se puede consultar en cualquier plataforma, solo que su valor será siempre cero. \\ \\ Asignarle valor a esta propiedad en otra plataforma que no sea las que se muestran en la tabla tampoco tendrá efecto ninguno.\\ \\ ====IsBrowsing==== \\ ^ Tipo |Propiedad| ^ Acceso |Lectura| ^ Tipo de Dato devuelto |Booleano (Entero)| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ Devuelve True (no cero) si la colección tiene abierto un recorrido **StartBrowse**. Claro que también se puede comprobar el **CurrentItem**, pero en caso de que el recorrido esté al final, **CurrentItem** será **Nothing** y sin embargo, habrá un recorrido abierto, es decir, recursos de la conexión en uso. \\ \\ Devuelve **False** (cero) si no hay ningún recorrido activo.\\ \\ ====IsLocked==== \\ ^ Tipo |Propiedad| ^ Acceso |Lectura| ^ Tipo de Dato devuelto |Booleano (Entero)| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ Devuelve **True** (no cero) si la colección está bloqueada usando **Lock**. Devuelve **False** (cero) si la colección está libre (su estado normal).\\ \\ ====Item==== \\ ^ Tipo |Propiedad| ^ Acceso |Lectura| ^ Parámetros |**Key**:Clave (en formato texto), Indice numérico del objeto, o nombre del campo por el cual se quiere buscar. **Val**: Opcional. Valor por el que se quiere buscar. Omitido si se va a buscar por clave. | ^ Tipo de Dato devuelto |XOneDataObject| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ Devuelve un objeto de la colección dada su clave llevada a texto, su índice dentro de la colección o el valor de uno de sus campos.\\ \\ La búsqueda por índice numérico siempre se hace en memoria. La búsqueda por clave o por pareja campo, valor se hace primero en memoria y en caso de no encontrarse el objeto con estas características, se efectúa la búsqueda en la conexión de datos.\\ \\ Esto permite que se puedan acelerar las búsquedas en colecciones que tienen pocos elementos cargándolos en memoria y manteniéndolos allí durante la ejecución de la aplicación.\\ \\ ====LinkFilter==== \\ ^ Tipo |Propiedad| ^ Acceso |Lectura| ^ Tipo de Dato devuelto |Texto| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ Devuelve el valor del filtro de enlace de la colección. \\ \\ Este es el filtro que se declara en el atributo “**filter**” de la colección en el mappins, o en la declaración de los contents y como indica su nombre es un filtro auxiliar que no debería modificarse en tiempo de ejecución.\\ \\ Aún así, cada cual puede hacer lo que estime conveniente.\\ \\ ====LoadAll==== \\ ^ Tipo |Método| ^ Tipo de Dato devuelto |Ninguno| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ Carga en memoria todos los objetos que cumplan con los criterios de filtrado que tiene la colección. \\ \\ Es importante antes de llamar a este método asegurarse que hay filtros puestos, ya que en caso de que haya demasiados objetos que cumplan los criterios, se puede producir un problema de falta de memoria.\\ \\ Ejemplo de uso:\\ \\ Set cDetVenta=This.Contents("DetVenta") cDetVenta.filter="d.IDDOCUMENTO=" + CStr(This("ID")) cDetVenta.LoadAll ====Lock==== \\ ^ Tipo |Método| ^ Tipo de Dato devuelto |Ninguno| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ Bloquea la colección para evitar que se modifique su contenido. \\ \\ Si la colección está bloqueada los métodos **LoadAll** y **Clear** no tendrán efecto sobre el contenido de la colección.\\ \\ La búsqueda de objetos no se ve afectada por el estado de bloqueo de la colección.\\ \\ El siguiente ejemplo, limpia y filtra una colección de detalles de venta y luego, la bloquea para que no se modifique .\\ \\ Set cDetVenta=This.Contents("DetVenta") cDetVenta.UnLock cDetVenta.Clear cDetVenta.filter="d.IDDOCUMENTO=" + CStr(This("ID")) cDetVenta.LoadAll cDetVenta.Lock ====Macro==== \\ ^ Tipo |Propiedad| ^ Acceso |Lectura/Escritura| ^ Parámetros |Name: Nombre de la macro cuyo valor se quiere leer o asignar| ^ Tipo de Dato devuelto |Texto| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ Devuelve o asigna valor a la macro cuyo nombre se indica.\\ \\ Las macros se sustituyen cuando se evalúan las cadenas de acceso, los filtros y demás, por lo que esta es una forma de lograr que el cambio de estos datos se efectúe de forma dinámica durante la ejecución del programa.\\ \\ ....... 'Después en un script, asignar valor a la macro ##NUMINCIDENCIA## para modificar el filtro de la colección Set cPiezas=AppData.GetCollection("ContarPiezas") cPiezas.macro("##NUMINCIDENCIA##")=AppData.VariantToString(nInc) cPiezas.StartBrowse ....... ====MacroCount==== \\ ^ Tipo |Propiedad| ^ Acceso |Lectura| ^ Tipo de Dato devuelto |Entero| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ Devuelve la cantidad de macros que hay definidas en la colección, tanto las que han recibido valor de forma dinámica como las que se han declarado en el mappings.\\ \\ ====MoveFirst==== \\ ^ Tipo |Método| ^ Tipo de Dato devuelto |Ninguno| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ Mueve el recorrido al primer objeto de la colección. \\ \\ El método está definido en todas las plataformas, pero en las que no se muestran no tiene ningún efecto. \\ \\ En las plataformas que se muestran solamente funciona cuando la base de datos asociada a la conexión lo soporta.\\ \\ ====MoveLast==== \\ ^ Tipo |Método| ^ Tipo de Dato devuelto |Ninguno| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ Mueve el recorrido al último objeto de la colección. \\ \\ Al igual que **MoveFirst**, solamente funciona en aquellas plataformas que trabajan con varias bases de datos y en concreto en aquellas que permiten esta operación. \\ \\ En las plataformas no mostradas el método no tiene efecto ninguno.\\ \\ ====MovePrevious==== \\ ^ Tipo |Método| ^ Tipo de Dato devuelto |Ninguno| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ Mueve el recorrido al objeto anterior. Aquí se cumplen las mismas observaciones que para **MoveFirst** o para **MoveLast**.\\ \\ ====MoveNext==== \\ ^ Tipo |Método| ^ Tipo de Dato devuelto |Ninguno| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ Mueve el recorrido hacia el siguiente objeto. \\ \\ Si como resultado del movimiento se llega al final del recorrido, el objeto actual (**CurrentItem**) se pondrá a **Nothing** para indicar que el recorrido ha terminado.\\ \\ Set cRec =AppData.GetCollection("RecPend") cRec.filter="r.IDCLIENTE=" + CStr(This("IDCLIENTE")) cRec.StartBrowse While Not cRec.Currentitem is Nothing Set ObjRec = cRec.Currentitem ....... Set ObjRec = Nothing cRec.MoveNext Wend ..... ====MultipleKey==== \\ ^ Tipo |Propiedad| ^ Acceso |Lectura| ^ Tipo de Dato devuelto |Booleano (Entero)| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ \\ Devuelve **True** (no cero) si la clave del objeto es múltiple o **False** (cero) si la clave es un solo campo.\\ \\ Esta propiedad devuelve siempre **False** en las plataformas que no están listadas en la tabla, ya que en esas plataformas no se soporta el uso de claves múltiples. \\ \\ En realidad las claves múltiples están pensadas para utilizar la maquinaria XOne con bases de datos diseñadas para uso de otras aplicaciones, algo que en la movilidad no es el caso, ya que la idea es que la aplicación móvil lleve una base de datos diseñada desde el primer momento.\\ \\ La interfaz de integración con el posible backend deberá encargarse de traducir las claves múltiples a una clave única (normalmente un campo autonumérico).\\ \\ ====Name==== \\ ^ Tipo |Propiedad| ^ Acceso |Lectura| ^ Tipo de Dato devuelto |Texto| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ Devuelve el nombre de la colección, tal como se ha declarado en el mappings.\\ \\ Ejemplo de uso:\\ \\ ' Se comprueba si el nombre de la colección padre es MenuPersonalizado antes de modificar la propiedad MAP_IDSELECCIONADO If This.OwnerCollection.Name="MenuPersonalizado" Then This("MAP_IDSELECCIONADO")=0 End If ====OwnerApp==== \\ ^ Tipo |Propiedad| ^ Acceso |Lectura| ^ Tipo de Dato devuelto |XOneApplication| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ Devuelve la aplicación propietaria de la colección. \\ \\ Debido a que en un entorno de ejecución no puede haber más de una aplicación, el valor de esta propiedad es el mismo que el de la variable global **AppData**.\\ \\ ====OwnerObject==== \\ ^ Tipo |Propiedad| ^ Acceso |Lectura| ^ Tipo de Dato devuelto |XOneDataObject| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ Devuelve el objeto propietario de la colección. \\ \\ Esta propiedad tiene valor solamente cuando la colección es un contents. \\ \\ Si se trata de una colección global o si es una copia de un contents, el valor de esta propiedad es **Nothing**.\\ \\ ====PropertyCount==== \\ ^ Tipo |Propiedad| ^ Acceso |Lectura| ^ Tipo de Dato devuelto |Entero| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ Devuelve la cantidad de propiedades que tiene la colección.\\ \\ Si la colección hereda de otra, esta propiedad devuelve el número correcto de propiedades (propias más las heredadas del padre). Aunque el mecanismo de herencia no es lo que se dice muy decente, al menos lo que funciona funciona en todas las plataformas.\\ \\ De todas maneras aquello de tratar de no usar el mecanismo de herencia sigue vigente hasta nuevo aviso.\\ \\ ====PropertyName==== \\ ^ Tipo |Propiedad| ^ Acceso |Lectura| ^ Parámetros |**Index**:Indice numérico de la propiedad cuyo nombre se quiere conocer.| ^ Tipo de Dato devuelto |Texto| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ Devuelve el nombre de una propiedad de la colección dado su índice numérico (en orden de declaración en el mappings).\\ \\ Con este nombre se pueden acceder las propiedades y métodos que llevan como parámetro un nombre de campo.\\ \\ ====PropertyTitle==== \\ ^ Tipo |Propiedad| ^ Acceso |Lectura| ^ Parámetros |**FieldName**:Nombre del campo tal y como está declarado en el mapping.| ^ Tipo de Dato devuelto |Texto| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ Devuelve el título de la propiedad (campo de datos) de la colección.\\ \\ Si hay una plataforma activa y esta propiedad tiene nodo <**platform**> se buscará primero en dicho nodo el atributo “**title**”. Si no se encuentra, se buscará el atributo “**title**” de la propiedad, y en caso de no aparecer se devuelve el texto del nodo <**prop**>.\\ \\ Si el nodo no tiene texto, se devuelve el nombre del campo. \\ \\ ====PropertyGroup==== \\ ^ Tipo |Propiedad| ^ Acceso |Lectura| ^ Parámetros |**FieldName**:Nombre del campo tal y como está declarado en el mapping.| ^ Tipo de Dato devuelto |Texto| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ ====PropType==== \\ ^ Tipo |Propiedad| ^ Acceso |Lectura| ^ Parámetros |**FieldName**:Nombre del campo tal y como está declarado en el mapping.| ^ Tipo de Dato devuelto |Texto| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ Devuelve el tipo de la propiedad de datos tal como está declarado en el mappings.\\ \\ Devuelve el nombre del grupo a que pertenece la propiedad en la colección. \\ \\ Para buscar el nombre se siguen las reglas de plataformas mostradas en las propiedades anteriores.\\ \\ ====PropVisibility==== \\ ^ Tipo |Propiedad| ^ Acceso |Lectura| ^ Parámetros |**FieldName**:Nombre del campo tal y como está declarado en el mapping.| ^ Tipo de Dato devuelto |Texto| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ Devuelve el valor del campo “visible” de la propiedad. \\ \\ Cumple las reglas de plataformas descritas anterioremente. Si al final de todas las pruebas no hay ningún valor que devolver, se devuelve “1”, ya que el valor por defecto de visibilidad es siempre 1.\\ \\ ====RemoveItem==== \\ ^ Tipo |Método| ^ Parámetros |**Index**:Indice numérico del objeto que se quiere sacar de la colección o clave de texto para buscar el objeto en la colección y sacarlo de ella.| ^ Tipo de Dato devuelto |Ninguno| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ Elimina de la colección el objeto cuyo índice o clave se pasa como parámetro.\\ \\ El objeto no se elimina de la base de datos, solamente de la colección.\\ \\ ====SaveAll==== \\ ^ Tipo |Método| ^ Tipo de Dato devuelto |Ninguno| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ Graba todos los objetos que contiene la colección. \\ \\ Si alguna grabación falla el método se detiene y se lanza el error ocurrido.\\ \\ ====Sort==== \\ ^ Tipo |Propiedad| ^ Acceso |Lectura/Escritura| ^ Tipo de Dato devuelto |Entero| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ Devuelve o asigna la cadena de ordenamiento a la colcción. \\ \\ La sintaxis es la misma que debe tener una sentencia ORDER BY en una cadena SQL. \\ El valor que tiene esta propiedad cuando se crea la colección es el valor del atributo “sort” de la cabecera de la colección.\\ \\ .... 'Ordenar la colección Kilometraje por FECHA descendente, antes de comenzar a recorrerla Set cKm = AppData.GetCollection("Kilometraje") cKm.sort="FECHA DESC" cKm.StartBrowse ... ==== StartBrowse ==== \\ ^ Tipo |Método| ^ Parámetros |**Count**: Opcional. True para contar los objetos que se recorrerán o False (valor por defecto) para no lanzar el conteo.| ^ Tipo de Dato devuelto |Entero| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ Inicia un recorrido siguiendo las reglas de la cadena de acceso, filtros y ordenamiento de la coleccóin. \\ \\ Si hay al menos un objeto, éste se carga en el **CurrentItem**. Si se pasa **True** como parámetro, la colección cuenta la cantidad de objetos que se van a recorrer. \\ Set Usuarios=AppData.GetCollection("Usuarios").CreateClone Usuarios.Filter="t1.LOGIN='" + Cstr(This("MAP_USUARIO")) + "'" Usuarios.StartBrowse Set Usuario=Usuarios.CurrentItem Set UCorrecto=false If Not Usuario Is Null Then If This("MAP_PWD") = Usuario("PWD") Then UCorrecto = True End if End If Usuarios.EndBrowse Set Usuario=nothing Set Usuarios=nothing ====StringKey==== \\ ^ Tipo |Propiedad| ^ Acceso |Lectura| ^ Tipo de Dato devuelto |Booleano (Entero)| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ Devuelve **True** (no cero) si la colección utiliza una clave que no es numérica (normalmente se emplea junto con “**idfieldname**” para utilizar juegos de claves diferentes a los que se emplean en las bases de datos XOne).\\ \\ **Devuelve False** (cero) cuando la clave es numérica (valor por defecto).\\ La forma de contar dependerá de la plataforma y de la base de datos.\\ \\ ====Unlock==== \\ ^ Tipo |Método| ^ Tipo de Dato devuelto |Ninguno| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ Desbloquea la colección para que se puedan usar nuevamente **Clear** y **LoadAll**.\\ \\ El siguiente ejemplo, limpia y filtra una colección de detalles de venta y luego, la bloquea para que no se modifique .\\ \\ Set cDetVenta=This.Contents("DetVenta") cDetVenta.UnLock cDetVenta.Clear cDetVenta.filter="d.IDDOCUMENTO=" + CStr(This("ID")) cDetVenta.LoadAll cDetVenta.Lock ====UpdateIdFieldName==== \\ ^ Tipo |Propiedad| ^ Acceso |Lectura| ^ Tipo de Dato devuelto |Texto| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ Devuelve el nombre del campo clave que se usa para las actualizaciones.\\ \\ Normalmente este campo es el mismo que **IdFieldName**, aunque pueden darse casos en los que se lea en un objeto y se escribe en otro, por lo que el campo de actualización puede ser diferente. \\ \\ También puede ocurrir que el campo clave esté cualificado y se quiera utilizar este sin cualificar para poder actualizar los datos.\\ \\ ====Variables==== \\ ^ Tipo |Propiedad| ^ Acceso |Lectura/Escritura| ^ Parámetros |**Item**:Nombre de la variable que se quiere leer o asignar.| ^ Tipo de Dato devuelto |Texto| ^ Plataforma |Win32, Web, .NET, .NET CF, WM (2003, 2005, 6.0, 6.5) Blackberry (5.0), iPhone, Linux, MC+, Symbian (3ed, 5ed)| \\ Devuelve o asigna valor a la variable cuyo nombre se indica. \\ \\ Las colecciones también pueden tener variables, lo que permite que haya un entorno realmente global para almacenar valores que vayan más allá de los ámbitos de script, ya que las colecciones globales siempre lo son.\\ \\ Los valores almacenados en las variables de las colecciones globales pueden mantenerse allí mientras se mantenga la ejecución de la aplicación o mientras no se limpien las variables.\\ \\ */