Stuart Taylor Posted May 16, 2008 Posted May 16, 2008 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
comment Posted May 16, 2008 Posted May 16, 2008 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.
Raybaudi Posted May 17, 2008 Posted May 17, 2008 See example of my failure : So works... SetRepByCalcMod.fp7.zip
Raybaudi Posted May 17, 2008 Posted May 17, 2008 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 ?
Raybaudi Posted May 17, 2008 Posted May 17, 2008 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
comment Posted May 17, 2008 Posted May 17, 2008 (edited) 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, 2008 by Guest Removed the part about filtered portal
Raybaudi Posted May 17, 2008 Posted May 17, 2008 I don't see that. You are right... I had seen that ONLY in the Data Viewer putting the calc into it.
Raybaudi Posted May 17, 2008 Posted May 17, 2008 Another option is to use ToolTip to set the $rep SetRepByCalc.fp7.zip
comment Posted May 17, 2008 Posted May 17, 2008 Not on a Mac (because of the delay in calculating the tip).
comment Posted May 17, 2008 Posted May 17, 2008 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. :
Recommended Posts
This topic is 6035 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now