April 1, 200520 yr Newbies We are using repeating fields over our solutions, but we found that we didn
April 1, 200520 yr You can't do it that way actually. You may use one of the three workarounds : 1) a loop in a repeating field set with a correct tab order and stop the loop when Get(ActiveRepetitionNumber)= TheParameter, then proceed with SetField[(empty);TheValue] 2) change your repeating field to a calculated repeating field and use the Get(RepetitionCalculationNumber) to grab the position where TheValue should be set. cRepeat*** = Case(Extend(TheParameter)=Get ( CalculationRepetitionNumber ) and not IsEmpty(Extend(TheValue));Extend(TheValue);cRepeat) 3) use a new occurrence of the Base Table linked to the original from any text id you may have, and set the repeating field to be a lookup from the previous calculation in 2) . SetField[MyParameter;N] SetField[iD;ID] CommitRecord/Request ***the not IsEmpty(Extend(TheValue)) would make sure an empty value cannot be set. If this condition can be valid, then remove it from the calc so that you can delete a specific "row" if needed. Or use "ClearThisRep" as a marker so that if TheValue = "ClearThisRep", it will be deleted. HTH
April 8, 200520 yr Thanks comment, for pointing me to this thread. So,repeating fields are kinda' discouraged? I needed a stack and thought a repeating field would be just the ticket. And as you know I ran ino the same "I can't write to a calculated index" thing as well. Just to get things going I did a nasty hack.. if [index=1] SetField[stack[1],MyParameter] else if [index=2] SetField[stack[2],MyParameter] else if... On and on, actually up to 20. Yuch what a mess! But it got me up and running. For reading the stack I used a calculated field. GetRepetition ( stack ; index) "they're breaking 1NF which dictates one fact per field." Not being a database person, this may be a really obtuse question but; Why is this something that shouldn't be broken? -jim lee
April 8, 200520 yr Repeating fields are a tool. Like any tool, it depends on the task at hand if the tool fits or not. Using repeating fields to store "real data", i.e. data that needs to be reported, summarized, extracted, etc., is generally a bad idea. The classic example is an invoice with repeating fields to hold invoice items. Any kind of reporting on the items (e.g. how many of #23 widgets have we sold this year?) becomes virtually impossible. Repeating fields can ve VERY useful for auxiliary data, such as calculating multi-line keys, or storing values used for other calculations, and certainly for displaying data.
Create an account or sign in to comment