School Actions
  • 03 Jun 2022
  • 1 Minute to read
  • Dark
    Light

School Actions

  • Dark
    Light

Article Summary

getSchool

Retrieves just one School.

Property

Value

Description

id*

string

The ID of the School


school = saveSchool({"name": "The School", "code": "234", "ncesId": 123451234512, "districtId": district.id})
school = getSchool(school.id)

getAllSchools

Retrieves all Schools.

Property

Value

Description

pageSize

integer

The page size (required for a paging request)

pageNum

integer

The page number (defaults to 1 for a paging request)


schools = getAllSchools()
SchoolId = " "
if (schools.length <1) {
school = saveSchool({"name": "School 1", "code": "321654", "ncesId": "123456789123", "districtId": districtId})
} else {
schoolId = schools[0].id
school = getSchool(schoolId)
}

saveSchool

Updates a School.

Property

Value

Description

id*

string

The ID of the School

schoolRec = createRecord()
addRecordFieldValue(schoolRec, 'name', schoolName, false)
addRecordFieldValue(schoolRec, "code", schoolCode, false)
addRecordFieldValue(schoolRec, "ncesId, ncesId, false)
addRecordFieldValue(schoolRec, "districtId", districtId, false)
school = saveSchool(schoolRec)
return school

getSchoolRelationship

Retrieves just one School relationship.

Property

Value

Description

id*

string

The ID of the School relationship

school = saveSchool({{"name": "The School", "code": "234", "ncesId": 123451234512, "districtId": district.id})
schoolRel = saveSchoolRelationship ("schoolId": schoolId, "userId": user_id, "role": ADMINISTRATOR})
schoolRel = getSchoolRelationships(schoolRel.id)

getAllSchoolRelationships

Retrieves all School Relationships.

Property

Value

Description

schoolId

string

The school ID for which to fetch school relationships

userId

string

The user ID for which to fetch school relationships

role

string

The role for which to fetch school relationships

pageSize

integer

The page size (required for a paging request)

pageNum

integer

The page number (defaults to 1 for a paging request)

schoolRels = getSchoolRelationship(schoolId, user_id)
schoolRelId = " "
if (schoolRels.length <1) {
schoolRel = saveSchoolRelationship ("schoolId": schoolId, "userId": user_id, "role": ADMINISTRATOR})
schoolRelID = schoolRel.id
} else {
schoolRelID = schoolRels[0].id
schoolRel = getSchoolRelationships(schoolRelId)
}

saveSchoolRelationship

Updates a School relationship.

Property

Value

Description

id*

string

The ID of the School relationship

id = "cc913124-c1d6-4716-9462-42e5577c730f"
schoolId = "aef284b-9c6fe-4ad1-8e12-8cd7ee0b7c4f"
conn = openMetadirLDAPConnection()
schoolRel = saveSchoolRelationship({"userId": id, "schoolId": schoolID, "role": "ADMINISTRATOR"})
log('Adding User with Email: "' + email + '" as an Administrator for School with ID: "' + schoolID + '"')
close(conn)
return id

deleteSchoolRelationship

Deletes a School Relationship.

Property

Value

Description

id*

string

The ID of the School Relationship

Delete by School Relationship id.

deleteSchool

Deletes a School.

Property

Value

Description

id*

string

The ID of the School

Delete by School id.

deleteSchoolType

Deletes a School Type.

Property

Value

Description

id*

string

The ID of the School Type

Delete by School Type id.


Was this article helpful?

What's Next