0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

power apps 複数予定

Last updated at Posted at 2025-09-17
// 1) 统一设置表单模式与当前主记录 varAppt
If(
    // —— New 模式:没有 ctxActivityId
    Coalesce(ctxMode, "") = "New" || IsBlank(ctxActivityId),
    /* New */
    NewForm(frmPlan);
    Set(varAppt, Blank());
,
    /* Edit */
    EditForm(frmPlan);
    Set(varAppt, LookUp(Appointment, activityid = ctxActivityId))
);

// 2) 准备「活動種別(大項目)」默认集合:
//    Edit:从交叉表映射到大項目记录;New:设为空集合
If(
    frmPlan.Mode = FormMode.Edit,
    ClearCollect(
        colMajorSelected,
        ForAll(
            Filter(
                '活動種別(大項目)x活動明細',
                appointmentid = varAppt.activityid
            ),
            LookUp('活動種別(大項目)', majorid = ThisRecord.majorid)
        )
    ),
    // New 模式
    Clear(colMajorSelected)
);
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?