I am trying to write a code for taking an number entered in a Data Form and compare it to the part table to see if the number already exists. If it does I want to add 1 to it and test it again until it gets to a part number that doesn’t exist yet, and then assign the new part number to the CallContextBOMData.Character01 field for use later. I have been reading all the documentation and examples I can find and am a bit stuck. I have never written anything like this in ABL. What I have cobbled together so far is below. Am I on the right track? I have bolded the 2 parts where I am not sure what I need to do. Any ideas, help or places to find some help are appreciated
Thanks,
Melissa
Define Variable iCount AS Integer No-Undo Initial 1.
Define Variable NewPartNumber AS Integer
Outerloop:
FOR each NEWPARTFIELD:
If ttCallContextBPMData.Character01 = Part.PartNum Then NewPartNumber = (ttCallContextBPMData.Character01+iCount)
Innerloop:
REPEAT WHILE NewPartNumber = Part.PartNum :
(Not sure what I need here to make it do this step) NewPartNumber = (NewPartNumber + 1)
(Don’t know what I need here about stopping the Repeat)
Then assign NewPartNumber = ttCallContextBPMData.Character01.
END.