Forums
Extending Daylite
Building Reports and Print Layouts
I need help with an F-Script|
Go
![]() |
New
![]() |
Find
![]() |
Notify
![]() |
Tools
![]() |
Reply
![]() |
|
|
Apprentice |
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 |
||
|
|
Journeyman |
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..) |
|||
|
|
Marketcircle Team |
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. |
|||
|
|
Journeyman |
Nice. It really helps to see syntax in context like this..
Thank you! -Eric |
|||
|
| Previous Topic | Next Topic | powered by eve community |
| Please Wait. Your request is being processed... |
|
Forums
Extending Daylite
Building Reports and Print Layouts
I need help with an F-Script
