My if statement fieldcode works.
{ If {DOCVARIABLE cms_assign_empl_name} = {DOCVARIABLE cms_resp_ptr_name} "" { DOCVARIABLE cms_assign_empl_rate \#$,##0.00 \*charformat } }
I update the fieldcode. To replace the text dollar symbol $, I add a new fieldcode which displays international currency codes from the database system {cms_currency_symbol}
{ If {DOCVARIABLE cms_assign_empl_name} = {DOCVARIABLE cms_resp_ptr_name} "" { DOCVARIABLE cms_currency_symbol \* charformat } { DOCVARIABLE cms_assign_empl_rate \#,##0.00 \*charformat} }
The results
The data values now don’t display. only the new fieldcode data displays which is the correct currency symbol.
What am I doing wrong.
Is my syntax wrong.
Do I need to add the new fieldcode cms_currency_symbol and cms_assign_empl_rate into curly brackets
TIA
--dd
If statement Fieldcode add a new fieldcode the result Errors
-
- 3StarLounger
- Posts: 279
- Joined: 01 Jun 2010, 00:27
-
- gamma jay
- Posts: 25455
- Joined: 17 Mar 2010, 17:33
- Location: Cape Town
Re: If statement Fieldcode add a new fieldcode the result Er
It seems your IF statement has too many arguments:
Your current format has 3 arguments:
If {DOCVARIABLE cms_assign_empl_name} = {DOCVARIABLE cms_resp_ptr_name}
(1) ""
(2) { DOCVARIABLE cms_currency_symbol \* charformat }
(3) { DOCVARIABLE cms_assign_empl_rate \#,##0.00 \*charformat}
Try this version:
(I have removed the "" which is the TRUE argument, which now makes the international symbol the TRUE statement and the $ symbol the FALSE statement.)
If {DOCVARIABLE cms_assign_empl_name} = {DOCVARIABLE cms_resp_ptr_name} { DOCVARIABLE cms_currency_symbol \* charformat } { DOCVARIABLE cms_assign_empl_rate \#,##0.00 \*charformat}
Note: I have removed the outer curly braces as this will be added automatically by Word when you insert the field again.
Your current format has 3 arguments:
If {DOCVARIABLE cms_assign_empl_name} = {DOCVARIABLE cms_resp_ptr_name}
(1) ""
(2) { DOCVARIABLE cms_currency_symbol \* charformat }
(3) { DOCVARIABLE cms_assign_empl_rate \#,##0.00 \*charformat}
Try this version:
(I have removed the "" which is the TRUE argument, which now makes the international symbol the TRUE statement and the $ symbol the FALSE statement.)
If {DOCVARIABLE cms_assign_empl_name} = {DOCVARIABLE cms_resp_ptr_name} { DOCVARIABLE cms_currency_symbol \* charformat } { DOCVARIABLE cms_assign_empl_rate \#,##0.00 \*charformat}
Note: I have removed the outer curly braces as this will be added automatically by Word when you insert the field again.
Regards,
Rudi
If your absence does not affect them, your presence didn't matter.
Rudi
If your absence does not affect them, your presence didn't matter.
-
- 3StarLounger
- Posts: 279
- Joined: 01 Jun 2010, 00:27
Re: If statement Fieldcode add a new fieldcode the result Er
Thank you Rudi
sorry perhaps I wasn’t clear.
The new fieldcode international currency symbol will now be in front of the empl_rate
ie { DOCVARIABLE cms_currency_symbol \* charformat } { DOCVARIABLE cms_assign_empl_rate \#,##0.00 \*charformat}
eg £400
Ive updated the fieldcode to what you suggested eg
{ If {DOCVARIABLE cms_assign_empl_name} = {DOCVARIABLE cms_resp_ptr_name} { DOCVARIABLE cms_currency_symbol \* charformat } { DOCVARIABLE cms_assign_empl_rate \#,##0.00 \*charformat} }
The result is
only displays the empl_rate
I thought perhaps I need to insert cms_currency_symbol and empl_rate in an one outer curly bracket eg
{ If {DOCVARIABLE cms_assign_empl_name} = {DOCVARIABLE cms_resp_ptr_name} "" { { DOCVARIABLE cms_currency_symbol \* charformat } { DOCVARIABLE cms_assign_empl_rate \#,##0.00 \*charformat } } }
the results
no values displays
sorry perhaps I wasn’t clear.
The new fieldcode international currency symbol will now be in front of the empl_rate
ie { DOCVARIABLE cms_currency_symbol \* charformat } { DOCVARIABLE cms_assign_empl_rate \#,##0.00 \*charformat}
eg £400
Ive updated the fieldcode to what you suggested eg
{ If {DOCVARIABLE cms_assign_empl_name} = {DOCVARIABLE cms_resp_ptr_name} { DOCVARIABLE cms_currency_symbol \* charformat } { DOCVARIABLE cms_assign_empl_rate \#,##0.00 \*charformat} }
The result is
only displays the empl_rate
I thought perhaps I need to insert cms_currency_symbol and empl_rate in an one outer curly bracket eg
{ If {DOCVARIABLE cms_assign_empl_name} = {DOCVARIABLE cms_resp_ptr_name} "" { { DOCVARIABLE cms_currency_symbol \* charformat } { DOCVARIABLE cms_assign_empl_rate \#,##0.00 \*charformat } } }
the results
no values displays
-
- Administrator
- Posts: 78917
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: If statement Fieldcode add a new fieldcode the result Er
How about placing double quotes around the entire "else" part:
{ If {DOCVARIABLE cms_assign_empl_name} = {DOCVARIABLE cms_resp_ptr_name} "" "{ DOCVARIABLE cms_currency_symbol \* charformat } { DOCVARIABLE cms_assign_empl_rate \#,##0.00 \*charformat}" }
{ If {DOCVARIABLE cms_assign_empl_name} = {DOCVARIABLE cms_resp_ptr_name} "" "{ DOCVARIABLE cms_currency_symbol \* charformat } { DOCVARIABLE cms_assign_empl_rate \#,##0.00 \*charformat}" }
Best wishes,
Hans
Hans
-
- gamma jay
- Posts: 25455
- Joined: 17 Mar 2010, 17:33
- Location: Cape Town
Re: If statement Fieldcode add a new fieldcode the result Er
Sorry... I misread...
I see Hans already answered while I was searching and tested to verify this.... (it confirms his advice)
Try this:
To merge multiple fields simply place the various {MERGEFIELD some_field} strings in double quotes.
If {DOCVARIABLE cms_assign_empl_name} = {DOCVARIABLE cms_resp_ptr_name} "" "{ DOCVARIABLE cms_currency_symbol \* charformat } { DOCVARIABLE cms_assign_empl_rate \#,##0.00 \*charformat}"
I see Hans already answered while I was searching and tested to verify this.... (it confirms his advice)
Try this:
To merge multiple fields simply place the various {MERGEFIELD some_field} strings in double quotes.
If {DOCVARIABLE cms_assign_empl_name} = {DOCVARIABLE cms_resp_ptr_name} "" "{ DOCVARIABLE cms_currency_symbol \* charformat } { DOCVARIABLE cms_assign_empl_rate \#,##0.00 \*charformat}"
Regards,
Rudi
If your absence does not affect them, your presence didn't matter.
Rudi
If your absence does not affect them, your presence didn't matter.
-
- 3StarLounger
- Posts: 279
- Joined: 01 Jun 2010, 00:27
Re: If statement Fieldcode add a new fieldcode the result Er
Thank you Hans, thank you Rudi
that worked!
So it was incorrect syntax. correction in the syntax worked
many thanks again
that worked!
![Clapping :clapping:](./images/smilies/clapping.gif)
So it was incorrect syntax. correction in the syntax worked
many thanks again