OnAfterChange event doesn't get called

B

Bev Kaufman

I'm a newbie, currently working my way through Lab 8 from this site:
http://msdn2.microsoft.com/en-us/library/aa167916(office.11).aspx.

The current task is to populate the price field based on the item just
entered. I entered the code exactly as instructed, and it doesn't work. In
fact, the code isn't even getting called, because I put a debug point on the
first line of the function, and it never stops at that line.

The text property name is itemName. From text box properties, I select
Data Validation, and from there, Sript: Events: OnAfterChange > Edit. That
takes me directly to
function msoxd_ns1_itemName::OnAfterChange(eventObj)

I wanted to step through the code to figure out why it's not working, but it
never enters the function.

There's another thing that I thought strange. When I reopened text box
properties, at first I thought the code never got saved because the Script:
Events: box was blank. But when I selected OnAfterChange and hit Edit, it
took me directly to the code that I'd written. Is that simply how InfoPath
works?
 
B

Bev Kaufman

I found the bug. I entered priceAuxNode.txt instead of priceAuxNode.text.

I am troubled by the program reaction. Instead of bombing, preferably at
the line of invalid code, it appeared to ignore the code altogether, so I
couldn't tell what the problem was.

Also, why don't the debug breakpoints work? I assumed that the code wasn't
being run because the code wasn't stopping on the breakpoints. But it turns
out, the breakpoints are ignored when the code is run. So why have them in
the first place?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top