Get prefix of field, get distinct list, insert list as new records in new form
I'm trying to get fetch records in a form, get the first section of data from one of the text fields (everything before a "-"), then filter out duplicates, then use that list to make new entries in a new form. Here's what I think it should look like but it doesn't work:
- void insertUniqueList()
- {
- var = form1[ID !=0].textField1.getPrefix("-").getAll().distinct();
- for each index uniqueValue in var
- {
- x = insert into newForm
- [
- newField = uniqueValue
- ];
- }
- }