May 16, 200817 yr Hi Everyone I would like to set a repetition by specifying the repetition number to set using a calculation. See example of my failure : best Stuart SetRepByCalc.fp7.zip
May 16, 200817 yr Interesting. The repetition of the target field seems to be evaluated outside the context of the portal. It looks like you need to use a script parameter instead.
May 17, 200817 yr BTW: If you set the rep with this calc: Let( rep = Related::Repetition ; rep ) the rep variable contains the right number, but with this: Let( $rep = Related::Repetition ; $rep ) the $rep variable contains always 1 WHILE if you set this calc: Let ( $data = Related::Data ; $data ) $data contains ALWAYS the right data So, the final question is: Why $rep contains always 1 ?
May 17, 200817 yr Why $rep contains always 1 ? I think that FM haven't time to evaluate... So the solution is to make a script of two steps: Set Variable [ $rep; Value: Related::Repetition ] Set Field [ Main:: Repeating Field [ $rep ] ; Related::Data ] ... and attach that to the button. SetRepByCalcSolved.fp7.zip
May 17, 200817 yr If you set the rep with this calc: Let( rep = Related::Repetition ; rep ) the rep variable contains the right number I don't see that. Why $rep contains always 1 ? I think that FM haven't time to evaluate... It doesn't always contain 1. It contains the value from the first related record. Because it is evaluated from the context of the parent record, not from the context of the portal row (or at least that's the way it seems) . So the solution is to make a script of two steps: Set Variable [ $rep; Value: Related::Repetition ] Set Field [ Main:: Repeating Field [ $rep ] ; Related::Data ] Or just one step, if you use the script parameter as suggested. Another option is to set the repetition to: GetNthRecord ( Related::Repetition ; Get ( PortalRowNumber ) ) but this will work ONLY IF the portal's sort order is the same as the sort order of the relationship. Edited May 17, 200817 yr by Guest Removed the part about filtered portal
May 17, 200817 yr I don't see that. You are right... I had seen that ONLY in the Data Viewer putting the calc into it.
May 17, 200817 yr I'll tell you for sure when I get one! But I would assume the answer is yes, because the delay is intentional, not due to a processing problem. BTW, they are not PCed, they are Macs with an Intel processor. :
Create an account or sign in to comment