- 03 Jun 2022
- 1 Minute to read
- Print
- DarkLight
District Actions
- Updated on 03 Jun 2022
- 1 Minute to read
- Print
- DarkLight
getDistrict
Retrieves just one District.
Property | Value | Description |
id* | string | The ID of the District |
district = saveDistrict({"name": "District 1", "code": "123456", "ncesID": "123456", "stated": stateId})
district = getDistrict(district.id }
getAllDistricts
Retrieves all Districts.
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) |
districts = getAllDistricts()
districtId = " "
if (districts.length <1) {
district = saveDistrict({"name": "District 1", "code": "123456", "ncesID": "123456", "stated": stateId})
districtID = districtid
} else {
districtId = districts[0].id
district = getDistrict(districtId)
}
saveDistrict
Updates a District.
Property | Value | Description |
id* | string | The ID of the District |
districtRec = createRecord()
addRecordFieldValue(districtRec, 'name', districtName, false)
addRecordFieldValue(districtRec, "code", districtCode, false)
addRecordFieldValue(districtRec, "ncesId", ncesId, false)
addRecordFieldValue(districtRec, "stateId", stateId, false)
district = saveDistrict(districtRec)
return district
getDistrictRelationship
Retrieves just one District Relationship.
Property | Value | Description |
id* | string | The ID of the District Relationship |
district = saveDistrict({"name": "District 1", "code": "123456", "ncesID": "123456", "stated": stateId})
districtRel = saveDistrictRelationship({"districtId": districtId, "userId": user_id, "role": "ADMINISTRATOR"})
districtRel = getDistrictRelationship(districtRelId)
getAllDistrictRelationships
Retrieves all District Relationships.
Property | Value | Description |
districtId | string | The dID for which to fetch district relationships |
userId | string | The user ID for which to fetch district relationships |
role | string | The role for which to fetch district relationships |
pageSize | integer | The page size (required for a paging request) |
pageNum | integer | The page number (defaults to 1 for a paging request) |
districtRels = getDistrictRelationships(districtId, user_id)
districtRelId = " "
if (districtRels.length < 1) {
districtRel = saveDistrictRelationship({"districtId": districtId, "userId": user_id, "role": "ADMINISTRATOR"})
districtRelId = districtRel.id
} else {
districtRelId = districtRels[0].id
districtRel = getDistrictRelationship(districtRelId)
saveDistrictRelationship
Updates a District Relationship.
Property | Value | Description |
id* | string | The ID of the District Relationship |
district = saveDistrict({"name": "District 1", "code": "123456", "ncesID": "123456", "stated": stateId})
districtRel = saveDistrictRelationship({"districtId": districtId, "userId": user_id, "role": "ADMINISTRATOR"})
deleteDistrictRelationship
Deletes a District Relationship.
Property | Value | Description |
id* | string | The ID of the District Relationship |
Delete by District Relationship id.
deleteDistrict
Deletes a District.
Property | Value | Description |
id* | string | The ID of the District |
Delete by District id.