Marketcircle    Forums  Hop To Forum Categories  Extending Daylite  Hop To Forums  Building Reports and Print Layouts    I need help with an F-Script
Go
New
Find
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Apprentice
Posted
I have a print layout that prints notes to send to my clients and includes the "Nickname" field. I would like to make the table cell conditional: if there is data in the Nickname field, print Nickname, otherwise print Firstname. I note that I can use an F-Script to populate the cell, so now I just need to know how to write the F-script! I think this is a pretty common thing for people to do so perhaps several list members would profit from the information. Thanks!

Bob
 
Posts: 25 | Location: Illinois | Registered: June 22, 2006Reply With QuoteEdit or Delete MessageReport This Post
Journeyman
Posted Hide Post
I'd like to bump this up- Here is a conditional that should work but only resolves one or the other and I'm not sure why-

nick := element valueForKeyPath:'parent.reportData.object.nickname'.
first := element valueForKeyPath:'parent.reportData.object.firstname'.


(nick length > 0) ifTrue:
[
nick.
]
ifFalse:
[
first.
]

So if there is a nickname, it will show, but does not show first name if false. Syntax passes ok, can someone at MC point out why this wouldn't work? I can reverse it as well and show what is ifFalse: but then the ifTrue: doesn't return a value..

Thanks! (And sorry Bob for the thread hijack..)
 
Posts: 96 | Location: San Francisco | Registered: June 22, 2006Reply With QuoteEdit or Delete MessageReport This Post
Marketcircle Team
Posted Hide Post
Try this...

nick := element valueForKeyPath:'parent.reportData.object.nickname'.
first := element valueForKeyPath:'parent.reportData.object.firstname'.

x := first.

( ( nick == nil ) not ) ifTrue:
[
	( nick length > 0 ) ifTrue:
	[	
		x := nick.
	].
].

x.
 
Posts: 60 | Registered: June 13, 2006Reply With QuoteEdit or Delete MessageReport This Post
Journeyman
Posted Hide Post
Nice. It really helps to see syntax in context like this..

Thank you!
-Eric
 
Posts: 96 | Location: San Francisco | Registered: June 22, 2006Reply 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    I need help with an F-Script

© Copyright 2006 Marketcircle Inc. All rights reserved.