Marketcircle    Forums  Hop To Forum Categories  Extending Daylite  Hop To Forums  Building Reports and Print Layouts    conditional if...then fscript help needed in report layout
Go
New
Find
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Apprentice
Posted
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. banghead
 
Posts: 16 | Registered: July 03, 2007Reply With QuoteEdit or Delete MessageReport This Post
Apprentice
Posted Hide Post
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,
 
Posts: 16 | Registered: July 03, 2007Reply With QuoteEdit or Delete MessageReport This Post
Marketcircle Team
Picture of Oscar
Posted Hide Post
No problem smile
 
Posts: 420 | Location: Toronto | Registered: February 20, 2007Reply With QuoteEdit or Delete MessageReport This Post
Apprentice
Posted Hide Post
quote:
Originally posted by Nick Eley:
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. banghead


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
 
Posts: 4 | Location: Bay Area | Registered: January 24, 2008Reply With QuoteEdit or Delete MessageReport This Post
Apprentice
Posted Hide Post
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.
 
Posts: 16 | Registered: July 03, 2007Reply With QuoteEdit or Delete MessageReport This Post
 Previous Topic | Next Topic powered by eve community  
 

Marketcircle    Forums  Hop To Forum Categories  Extending Daylite  Hop To Forums  Building Reports and Print Layouts    conditional if...then fscript help needed in report layout

© Copyright 2006 Marketcircle Inc. All rights reserved.