Forums
Extending Daylite
Building Reports and Print Layouts
conditional if...then fscript help needed in report layout|
Go
![]() |
New
![]() |
Find
![]() |
Notify
![]() |
Tools
![]() |
Reply
![]() |
|
|
Apprentice |
Hello all. I'm building a simple report template, reporting on Opportunities. I have a calculated field Weighted GP = Probability * Cached Total Amount / 100. This works fine except when no-one has entered a value in Probability. In this case the report shows something like *0/100. I need to define the Weighted GP field as a script which shows a blank result if no value for Probability has been entered. I've scoured the fscript manual and Developer Kit but can't find the answer. My amateur fscripting efforts have failed miserably. I'm not a programmer (though I can do a mean FileMaker script) and have difficulty in understanding a lot of the terminology. Any help gratefully received.
|
||
|
|
Apprentice |
Courtesy of Oscar at Marketcircle:
Hi Nicholas, Insert a script token found under the special tab and insert the following script. "start" probability := element valueForKeyPath:'insert path here '. totalAmount := element valueForKeyPath:'inesert path here'. (probability == nil) ifTrue: [ probability := 0. ]. gp := probability * totalAmount / 100. gp. "end" Make sure to insert the proper key path for both probability and totalAmount. You can find these by just inserting the token into the dynamic field, copy the Path and insert them where my script says insert path here. Thanks for this Oscar - it works perfectly. This message has been edited. Last edited by: Nick Eley, |
|||
|
|
Marketcircle Team |
No problem
|
|||
|
|
Apprentice |
any chance of getting a copy of this script nick? i'm new to daylight and have been scratching my head over creating this exact script.. TIA |
|||
|
|
Apprentice |
Hi Simon,
This is what Oscar from MarketCircle sent me and it worked perfectly: Insert a script token found under the special tab and insert the following script. "start" probability := element valueForKeyPath:'insert path here '. totalAmount := element valueForKeyPath:'inesert path here'. (probability == nil) ifTrue: [ probability := 0. ]. gp := probability * totalAmount / 100. gp. "end" Make sure to insert the proper key path for both probability and totalAmount. You can find these by just inserting the token into the dynamic field, copy the Path and insert them where my script says insert path here. Hope that helps. |
|||
|
| Previous Topic | Next Topic | powered by eve community |
| Please Wait. Your request is being processed... |
|
Forums
Extending Daylite
Building Reports and Print Layouts
conditional if...then fscript help needed in report layout
