4D v16.3

METHOD GET ATTRIBUTES

Home

 
4D v16.3
METHOD GET ATTRIBUTES

METHOD GET ATTRIBUTES 


 

METHOD GET ATTRIBUTES ( path ; attributes {; *} ) 
Parameter Type   Description
path  Text, Text array in Method path(s)
attributes  Object, Object array in Attribute(s) 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 GET ATTRIBUTES command returns, in attributes, the current value of all attributes for the method(s) specified in the path parameter.

This command only works with project methods. If you pass an invalid path, an error is generated.

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 (variable or array) in attributes in order to get the appropriate attributes.

In attributes, you pass an object or an array of objects, depending on the kind of parameter passed in path. All the attributes for the method(s) are returned as object properties, with "True"/"False" values for Boolean attributes, and text or additional values if necessary (for example, "scope":"table" for the 4D Mobile property).

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 Get attribute command is still supported but since it can only return Boolean values, it cannot be used for extended attributes such as 4D Mobile properties.

Example  

You want to get the attributes of the sendMail project method. You can write:

 C_OBJECT($att)
 METHOD GET ATTRIBUTES("sendMail";$att)

After execution, $att contains, for example:

{
    "invisible":false,
    "preemptive":"capable",
    "publishedWeb":false,
    "publishedSoap":false,
    "publishedWsdl":false,
    "shared":false,
    "publishedSql":false,
    "executedOnServer":false,
    "published4DMobile":{
        "scope":"table",
        "table":"Table_1"
    }
}



See also 

METHOD SET ATTRIBUTES

 
PROPERTIES 

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

 
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)