Jump to content

Multiple if statements OnRecordStart


Recommended Posts

I am trying to execute 2 independent if statements in the OnRecordStart rule.


One is meant to manage a text box:

if (Field("FieldName") =="")
FindTextFrame("MyTextFrame").fillColorName = "white";
FindTextFrame("MyTextFrame").content = "<span color=white>" + FindTextFrame("MyTextFrame").content;


The other activates a page in the document:

if (Field("FieldName2") != "")


Can anyone explain how to keep these two statements independent of each other? I am unable to create 2 different OnRecordStart rules, so I am forced to place them in the same rule. I assume I can insert instructions to treat these statements on their own, but my searches for a solution have been fruitless so far.


Thank you for taking the time to look at this.

Edited by RSloan
fixed CODE tags
Link to comment
Share on other sites

You can just put both statements, one after the other, in your OnRecordStart rule. They shouldn't interfere with each other in any way.


Although I'm not sure what you're trying to accomplish by setting a frame's fill to white and setting all the text to white as well. Obviously you're not going to see any text that way. Maybe you just want to suppress the frame instead?

Link to comment
Share on other sites

Thank you very much, Dan.


The code does seem to be executing properly as the statements are currently laid out. I was just worried that they may somehow misfire without some sort of END statement.


As for the text frame rule, I am using it to "white-out" a portion of the background art for certain records. For the other records, this box is transparent allowing the background to show through (along with the black text in the box).


Thanks again for the quick reply!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...