Page 1 of 1

Need Word Syntax Help

Posted: Mon Mar 20, 2017 4:34 pm
by slind
I would like to do the following but I'm not sure of the correct syntax. I placed a support call but they replied to post it here. Sorry!


<IF (SystemDate < “04/01/2017”)>
REF (NSTitle_Letterhead##)
<ELSE>
REF (RLTitle_Letterhead##)
</IF>

And

<IF (Left({{Order.Attorneys[1].LookupCode}},2}}=”NS”)>
REF (NSTitle_Letterhead##)
<ELSE>
REF (RLTitle_Letterhead##)
</IF>

Re: Need Word Syntax Help

Posted: Tue Mar 21, 2017 7:10 am
by Phil Barton
For the first set of conditions, SystemDate is a function. Thus, it has to end with open- and close-parentheses. So, rewritten, it looks like:

<IF (SystemDate() < “04/01/2017”)>
REF (NSTitle_Letterhead##)
<ELSE>
REF (RLTitle_Letterhead##)
</IF>

For the second one, we use the formula function BeginsWith(...) to see if the lookup code starts with the pattern you're looking for. It takes as its first parameter the source value (in this case the lookup code) and as a second parameter the pattern we're looking for:

<IF (BeginsWith({{Order.Attorneys[1].LookupCode}}, ”NS”))>
REF (NSTitle_Letterhead##)
<ELSE>
REF (RLTitle_Letterhead##)
</IF>

For future reference, you can use the formula editor to find out all the functions that it has and how they're used. If you press F8 and bring up the formula editor in any field, you'll see in the toolbar a button with a large sigma character. This is the list of all the functions. available. Hope this helps!