I want to take 2 form inputs (Value(txt_sp_id.Text) and txt_cl_code.Text) and check for duplicates in collection:SessionInfo.
If there are no duplicates, it will use 'cl_code' created in form:ClassDetailsForm and extract the 'c_id' associated with the new 'cl_code' in table:Class and patch it to table:Sessions.
'c_id' is the primary key of Class, each 'cl_code' is identified by 'c_id'.
'sp_id' is the primary key of Speaker.
SessionInfo is a collection containing multiple tables, ie Class and Speaker.
This is how it is linked:
This is what part of SessionInfo looks like:
These are my current formulae (for Class, Speaker, and Sessions, respectively):
ForAll(Class,
If(cl_code <> txt_cl_code.Text,
SubmitForm(ClassDetailsForm)));
ForAll(Speaker,
If(sp_id <> Value(txt_sp_id.Text),
SubmitForm(SpeakerDetailsForm)));
ForAll(SessionInfo,
If(And((sp_id <> Value(txt_sp_id.Text)),(cl_code <> txt_cl_code.Text)),
Patch(
Sessions,
Defaults(Sessions),
{
c_id: ?
sp_id: Value(txt_sp_id.Text)
}
)));

Report
All responses (
Answers (