I have made an EFx to issue material to a job, to include options for a single serial or lot number. I made a separate one to return material, and it works mostly, but I haven’t figured out how to return serial numbers.
I was surprised that (1) there’s not a lot of chatter on here about IssueReturn (the biz obj) because if anything needs to be streamlined, issuing material is high on that list. And (2) there seems to be no one that’s specifically tackled returning serial-tracked material - and shared their code.
So I’ll just ask generically if anyone has any tips if they’ve ever done this. I figured since I had conquered issuing serial numbers, that returning them would be a cinch. Nope.
Error(s) are:
There are no records in the table dsIssue.SelectedSerialNumbers
The number of serial numbers you have selected doesn't match the number required. You have 0 serial numbers selected. You must select 1 serial numbers.
As expected, the failure is - selecting the serial numbers!
In code-speak, I am doing this:
Use GetByID method on the SerialNo object to create a temp table
Use Fill Table By Query to take the data from step 1 and add a row to the SelectedSerialNumbers table inside the IssueReturn dataset
Oh, FYI, I have two different functions - one for issues and one for returns. So, this “fill table” strategy worked perfectly in my issue-material EFx, but it’s not cutting it in the return EFx.
Also, the trace shows some imaginary method for adding serial numbers, so that doesn’t help:
I’m looking at the ‘Map table to ds’ widget and I noticed you didn’t set the TransType there. I’m wondering if that could be the issue as I don’t think it’s set by default when you do the GetNew. Try to set that and see if it works - you could do a trace and see what the correct values are for both issue and return.
You said that the function for issue material works - if you look in Serial Number Tracker, do you see the correct transaction types there ?
LE: the MyQuery you’re using to update the SN’s, you have the filter there SNStatus=‘INVENTORY’ - are you sure that’s correct for returning the materials ?
No problem. Check the Serial Number Tracker for the material you ran the function for. In the Transactions tab, you have all the transactions there just like the Part Transaction History Tracker. See if the TranType is correct there.