Hi PK,
After going through complete post did you already considered the suggestion proposed by expert Dogboy 49 of using CTM. If your business requirement is to prioritize sales orders which is standard functionality in CTM to prioritize demands, why not to opt the same instead of developing such complex solution?
Regards
Rahul