I have a dataverse table where the primary key is an autonumber field called Name.
I use Jobnumbers in my database for EACH record and when I'm ready to pay a job I want to show the jobnumbers in a gallery, then mark them all "Ready to Pay" in a field called Status in the same database. Each record is a Purchase order (PO) to my suppliers for that Job.
So I made a gallery of unique JobNumbers, put a checkbox in it and in the Onselect i have this:
//Collect(jobsToPay,ThisItem)
ClearCollect(
jobsToPay,
Filter(
'Mprinted Business Operations',
'Job Number' = ThisItem.JobNumber
)
);
This Filters all the matching PO's with the same Jobnumber and builds a collection so that I can mark them "Ready to Pay" with a Patch Command.
When testing the patch command with a hard coded value - this code works:
/*
Patch(
'Mprinted Business Operations',
LookUp('Mprinted Business Operations', Name = "3776"),
{Status: "Ready To Pay"}
)
*/
However, when I try to iterate the jobsToPay collection, I get this:
My thinking:
1. poRecordsToPatch - a new collection to build all the full records I need to patch.
2. ForAll - let's iterate all of the jobsToPay collection
3. Lookup each full record in my db where the unique identifier Name matches the current record we are iterating
Again, Each PO record in the 'Mprinted Business Operations' db has a unique field called Name. I thought it best to save that unique number so I could patch the exact records later, so I collected it and am now trying to use it in my iterated lookup.
I have worked on this most of the day. Any help is appreciated.