Calculation field or script at portal?

Discussion created by lokaty on Mar 10, 2014
Latest reply on Mar 11, 2014 by erolst

Hello Everybody,



This is my first post and I would like ask you guys to help me find solution with portal and calculation field in it.

At begining I really sorry for my poor english - I'm doing my best and still learning.



What I have:


- portal with building selector

- when building is selected, portal shows floor number, room number and room area at the building

- last field assigned to that portal - room area * (n+1) - is calculation field where count this formula:


"Let ( [$var1 = $var1 + 1; RoomAreaCalc = RoomArea * $var1; $var1 = $var1 + 1]; RoomAreaCalc )"


- this field increments room area by "n+1" number (and increment stored values again when building have been choosen again)



What I would achieve:


- calculation should be done once when I again select same building (not increment stored values again)

- multiplication should be done from 1 not from 0 (as you see I tried to set variable to 1 but first calculation shows that don't work properly)

- is this can be implement as script? I really thinking about using an IF/LOOP/... formula with script parametr but at this moment I don't understand how script parametr is working and how script can be implemented with portal

- if I can clean variables each time when building have been selected than part of my idea can be done (searching at FM forums shows me that can't be done when project is loaded except when project have been closed and loaded again then all variable values will be restarted)



I really appreciate any suggestion that can solve this problem.


Best regards,




PS. Attachment contain main whole and very first project and it's a little bit messy - you should interest buildings_portal layout.