I’m recreating a SN Selection slide out in a UD Entry screen and my last step after the user selects one or more serial number is to write all the selections into a single text box (with a comma delimiter) upon clicking the OK button.
I have an event with a dataview-condition widget and a related iteration event–which I think is the correct way to go about this based on a few other posts–however, I’m having a few issues getting it to work.
In one setup, debugging shows it iterating how many times equal to how many rows are selected, but in every iteration it’s only pulling the last row. On top of that, I cannot get it to write even that last row to my UD field (UD100 table).
In the second setup, I can get it to write to my UD field, except it’s only iterating once then stopping.
Questions: 1. What am I doing wrong? Is this even the way to go about this? 2. Assuming this is the correct way to do it, what’s the correct way to get it to write the SN from each selected row into a single field?
In your row update “value”… can you try "{matches.SerialNo_SerialNumber}, "
When you do the dataview-condition, it goes through your SerialNumbersAvailable dataview and makes a virtual copy of all rows which passes your condition and adds them to your “matches” dataview.
~~ can you verify in debugger, looking at your dataviews, that you’re getting the correct rows in your matches dataview? ~~
Your iterative event is then going to work through the rows from your “matches” result set. So, I think you need to get your “values” from there.
Because your current value is referencing: "{SerialNumbersAvailable.SerialNo_SerialNumber}, "
Its getting the value from THAT dataview and its just going to use the last row selected there. At least, that’s why I think you keep getting the same value in your Scenario 1.
That being said… I don’t know if you’re going to get a concatenated list, or if it is just going to overwrite the value you’re putting in matches.SerialList_c multiple times. I’ve never played with that to build a list. But at least you can see if the value changes with each iteration in debugger.
Ok, I thought I had tried that, but apparently not. That does correctly iterate through and pull the value from each row. It’s still not writing anything to my UD100 column, though.
Yeah, the idea that I may have to do that has been rattling around in the back of my mind. I’ve done several of them with help from others/in a class, but I still don’t understand them enough to ever know where to start with designing one. And I know zero C#, so that makes them more daunting to try to tackle.
I’ve never tried to do an “if check” in a row update… but row updates are javascript so, if that works… it will check to see if UD100 has a value, if not, it’ll add the first serialnumber. If it does, I’m hoping it will update UD100.SerialList_c by taking the existing value of UD100.SerialList_c and add the next serial number.
I’ve created exactly two so I’m far from any expert either. This one doesn’t sound too daunting as it appears you already got getting the serial numbers in a dataset working. But it’s just a thought.
Got me thikning, what is the javascript for concatenate strings? Google says it’s:
haha, no worries! Experimenting is what I’ve been doing on this since yesterday.
Would the expression need to end with a semicolon perhaps, as in @Randy’s example above? I was getting a token error with his example, too, until I added the semicolon.