PENDING_FLOW_URL and SET_MO_FLOW_URL in the script.
Flow A · Load (HTTP trigger, body: { "mode": "pending" | "sync" })
mode = pending → Get items Job Master, Filter: MO# is empty
mode = sync → Get items Job Master, Filter: MO# is not empty
(optional) per job: count Job Order List rows where MO# is empty → "missing"
Response body: { "items": [ { masterId, projectCode, jobId, jobDesc, sub, requester, releaseDate, requiredDate, mo, missing } ] }
Flow B · Set MO# (HTTP trigger, body: { "items": [ { masterId, jobId, mo } ] })
Apply to each items
├ Update item Job Master Id = masterId MO# = mo Status = (your "has MO#" status)
├ Get items Job Order List Filter: JobID eq masterId (JobID = lookup to Job Master)
└ Apply to each → Update item Job Order List MO# = mo
Response: { "ok": true }
会写入 Job Master,并同步到 Job Order List 里这些 job 的所有 part。