GetViewLayer()

Summary

Gets the name of the layer that corresponds to a view.

Syntax

layer_name = GetViewLayer(string view_name)

Argument Contents
view_name The input view, or null for the current view

Returns

A string indicating the name of the layer to which the input view is mappable, or null if the input view is not mappable to any layer.

Notes

  • Several views may be mapped to the same layer; e.g., the States layer may have been linked to two separate tables through separate join operations.

  • GetViewLayer() is most useful for testing if a view is mappable. If a non-null layer name is returned, then the view is mappable; otherwise it is not.

  • If view_name is actually the name of a layer, then the return value is identical to view_name.

Example

jv = JoinViews("Sales Table", "U.S. States|Name", "Sales|State", )
result = GetViewLayer("Sales Table") // result should equal "U.S. States"

Error Codes

Error Type Meaning
NotFound The specified view does not exist, or view_name is null and there is no current view

See Also

Function Summary
GetView() Gets the name of the current view
SetView() Sets the current view (and the current layer)
GetViews() Gets information on views in the system or views associated with a layer
GetViewJoinInfo() Gets the join information for a view
GetViewNames() Gets a list of all views
GetViewParents() Gets the parentage of a view