4D v16.3

METHOD SET ATTRIBUTES

Home

 
4D v16.3
METHOD SET ATTRIBUTES

METHOD SET ATTRIBUTES 


 

METHOD SET ATTRIBUTES ( path ; attributes {; *} ) 
Parameter Type   Description
path  Text, Text array in Method path(s)
attributes  Object, Object array in Attribute(s) to set for selected method(s)
Operator in If passed = command applies to host database when executed from a component (parameter ignored outside of this context)

The METHOD SET ATTRIBUTES command allows you to set the attributes values for the method(s) specified in the path parameter.

In path, you can pass either a text containing a method path, or a text array containing an array of paths. You will need to pass the same kind of parameter (string or array) in attributes in order to set the appropriate attributes. This command only works with project methods. If you pass an invalid path, an error is generated.

In attributes, you pass an object or an array of objects (depending on the kind of parameter you passed in path) containing all the attributes that you want to set for the method(s).

Method attributes must be set using the OB SET or OB SET ARRAY commands, with True or False values for Boolean attributes, or specific values for extended attributes (for example, "scope":"table" for the 4D Mobile property). Only attributes that are present in the attributes parameter will be updated in the method attributes.

If the command is executed from a component, by default it applies to the component methods. If you pass the * parameter, it accesses the methods of the host database.

Note: The existing METHOD SET ATTRIBUTE command is still supported but since it can only handle Boolean values, it cannot be used for extended attributes such as 4D Mobile properties.

 

The supported attributes are:

{
    "invisible" : false, // true if visible
    "preemptive" : "capable" // or "incapable" or "indifferent"
    "publishedWeb" : false,  // true if available through 4D tags and URLs
    "publishedSoap": false,  // true if offered as Web Service
    "publishedWsdl": false,  // true if published in WSDL
    "shared" : false,  // true if shared by components and host database
    "publishedSql" : false,  // true if available through SQL
    "executedOnServer" : false, // true if executed on server
    "published4DMobile" : {
        "scope": "table",  // "none" or "table" or "currentRecord" or "currentSelection" 
        "table": "aTableName"  // present if scope is different from "none" 
    }
}

Note: Regarding "published4DMobile" attributes, if the "table" value does not exist or if the "scope" is invalid, these attributes are ignored.

You want to set a single attribute:

 C_OBJECT($attributes)
 OB SET($attributes;"executedOnServer";True)
 METHOD SET ATTRIBUTES("aMethod";$attributes//Only the "executedOnServer" attribute is modified

You want a method to be unavailable through 4D Mobile (the "none" value must be passed for the "scope" attribute):

 C_OBJECT($attributes)
 C_OBJECT($fourDMobileAttribute)
 OB SET($fourDMobileAttribute;"scope";"none")
 OB SET($attributes;"published4DMobile";$fourDMobileAttribute)
 METHOD SET ATTRIBUTES("aMethod";$attributes)



See also 

METHOD GET ATTRIBUTES
METHOD SET ATTRIBUTE

 
PROPERTIES 

Product: 4D
Theme: Design Object Access
Number: 1335

 
HISTORY 

Created: 4D v15
Modified: 4D v15 R5

 
ARTICLE USAGE

4D Language Reference ( 4D v16)
4D Language Reference ( 4D v16.1)
4D Language Reference ( 4D v16.2)
4D Language Reference ( 4D v16.3)