iOS SDK Samples - Metadata Operations

Get All Modules' Metadata
          
          
ZCRMSDKUtil.getModules { ( result ) in
            switch result
            {
            case .success(let module, let response) :
                print ("ResponseJSON : \( response.responseJSON )")
            case .failure(let error) :
                print ( "Throws exception : \(error)" )
            }
        }
 
Get a Module's Metadata
          
          
ZCRMSDKUtil.getModule(moduleAPIName: "Leads") { ( result ) in
            switch result
            {
            case .success(let module, let response) :
                print ("ResponseJSON : \( response.responseJSON )")
            case .failure(let error) :
                print ( "Throws exception : \(error)" )
            }
}
 
Get All Fields' Metadata
          
          
// module is the object of getModuleDelegate()
$module.getFields{ ( result ) in
            switch result
            {
            case .success(let field, let response) :
                print ("ResponseJSON : \( response.responseJSON )")
            case .failure(let error) :
                print ( "Throws exception : \(error)" )
            }
}
 
Get All Fields' Metadata from the Server
          
          
// module is the object of getModuleDelegate()
$module.getFieldsFromServer{ ( result ) in
            switch result
            {
            case .success(let field, let response) :
                print ("ResponseJSON : \( response.responseJSON )")
            case .failure(let error) :
                print ( "Throws exception : \(error)" )
            }
}
 
Get a Field's Metadata by its ID
          
          
// module is the object of getModuleDelegate()
$module.getField( id : 1234565436, withHeaders : [ "X_CRM_ORG" : "1234567" ]){ ( result ) in
            switch result
            {
            case .success(let field, let response) :
                print ("ResponseJSON : \( response.responseJSON )")
            case .failure(let error) :
                print ( "Throws exception : \(error)" )
            }
}
 
Get a Field's Metadata by its ID from the Server
          
          
// module is the object of getModuleDelegate()
$module.getFieldFromServer( id : 1234565436, withHeaders : [ "X_CRM_ORG" : "1234567" ]){ ( result ) in
            switch result
            {
            case .success(let field, let response) :
                print ("ResponseJSON : \( response.responseJSON )")
            case .failure(let error) :
                print ( "Throws exception : \(error)" )
            }
}
 
Get All Layouts' Metadata
          
          
// module is the object of getModuleDelegate()
$module.getLayouts{ ( result ) in
            switch result
            {
            case .success(let layout, let response) :
                print ("ResponseJSON : \( response.responseJSON )")
            case .failure(let error) :
                print ( "Throws exception : \(error)" )
            }
}
 
Get All Layouts' Metadata from the Server
          
          
// module is the object of getModuleDelegate()
$module.getLayoutsFromServer{ ( result ) in
            switch result
            {
            case .success(let layout, let response) :
                print ("ResponseJSON : \( response.responseJSON )")
            case .failure(let error) :
                print ( "Throws exception : \(error)" )
            }
}
 
Get a Layout's Metadata by its ID
          
          
// module is the object of getModuleDelegate()
$module.getLayout(id : 123456765){ ( result ) in
            switch result
            {
            case .success(let layout, let response) :
                print ("ResponseJSON : \( response.responseJSON )")
            case .failure(let error) :
                print ( "Throws exception : \(error)" )
            }
}
 
Get a Layout's Metadata by its ID from the Server
          
          
// module is the object of getModuleDelegate()
$module.getLayoutFromServer(id : 123456765){ ( result ) in
            switch result
            {
            case .success(let layout, let response) :
                print ("ResponseJSON : \( response.responseJSON )")
            case .failure(let error) :
                print ( "Throws exception : \(error)" )
            }
}
 
Get All Related Lists' Metadata
          
          
// module is the object of getModuleDelegate()
$module.getRelatedLists{ ( result ) in
            switch result
            {
            case .success(let relatedlist, let response) :
                print ("ResponseJSON : \( response.responseJSON )")
            case .failure(let error) :
                print ( "Throws exception : \(error)" )
            }
}
 
Get All Related Lists' Metadata from the Server
          
          
// module is the object of getModuleDelegate()
$module.getRelatedListsFromServer{ ( result ) in
            switch result
            {
            case .success(let relatedlist, let response) :
                print ("ResponseJSON : \( response.responseJSON )")
            case .failure(let error) :
                print ( "Throws exception : \(error)" )
            }
}
 
Get a Related List's Metadata by its ID
          
          
// module is the object of getModuleDelegate()
$module.getRelatedList(id : 123456543){ ( result ) in
            switch result
            {
            case .success(let relatedlist, let response) :
                print ("ResponseJSON : \( response.responseJSON )")
            case .failure(let error) :
                print ( "Throws exception : \(error)" )
            }
}
 
Get a Related List's Metadata by its ID from the Server
          
          
// module is the object of getModuleDelegate()
$module.getRelatedListFromServer(id : 123456543){ ( result ) in
            switch result
            {
            case .success(let relatedlist, let response) :
                print ("ResponseJSON : \( response.responseJSON )")
            case .failure(let error) :
                print ( "Throws exception : \(error)" )
            }
}
 
Get All Custom Views' Metadata
          
          
// module is the object of getModuleDelegate()
$module.getCustomViews{ ( result ) in
            switch result
            {
            case .success(let customview, let response) :
                print ("ResponseJSON : \( response.responseJSON )")
            case .failure(let error) :
                print ( "Throws exception : \(error)" )
            }
}
 
Get All Custom Views' Metadata from the Server
          
          
// module is the object of getModuleDelegate()
$module.getCustomViewsFromServer{ ( result ) in
            switch result
            {
            case .success(let customview, let response) :
                print ("ResponseJSON : \( response.responseJSON )")
            case .failure(let error) :
                print ( "Throws exception : \(error)" )
            }
}
 
Get a Custom View's Metadata by its ID
          
          
// module is the object of getModuleDelegate()
$module.getCustomView(id : 123456543) {( result ) in
            switch result
            {
            case .success(let customview, let response) :
                print ("ResponseJSON : \( response.responseJSON )")
            case .failure(let error) :
                print ( "Throws exception : \(error)" )
            }
}
 
Get a Custom View's Metadata by its ID from the Server
          
          
// module is the object of getModuleDelegate()
$module.getCustomView(id : 123456543) {( result ) in
            switch result
            {
            case .success(let customview, let response) :
                print ("ResponseJSON : \( response.responseJSON )")
            case .failure(let error) :
                print ( "Throws exception : \(error)" )
            }
}