Created
January 30, 2015 13:55
-
-
Save setap/0b3886fd8ae95f8f37a1 to your computer and use it in GitHub Desktop.
Загрузка подразделений.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function iterate() { | |
| var dept = new SCFile("dept"); | |
| var ret = dept.doSelect("true"); | |
| while (ret == RC_SUCCESS) { | |
| R(dept); | |
| ret = dept.getNext(); | |
| } | |
| } | |
| function R(record) { | |
| if (record.atc_parent_id != "10000359") { | |
| var file = new SCFile("dept"); | |
| file.doSelect("dept.id=\"" + record.atc_parent_id + "\""); | |
| R(file); | |
| var parenName; | |
| if (file.parent == null) { | |
| parentName = file.dept_name; | |
| print(file.dept_name); | |
| } else { | |
| parentName = file.parent + "/" + file.dept_name; | |
| } | |
| record.parent = parentName; | |
| record.doAction("save"); | |
| // fill(record); | |
| } | |
| } | |
| iterate(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment