onafterchange setting a fields value

L

littleccguy

First let me point out I am not a programmer but understand the basics
OOP and OOD. I am working with InfoPath 2007 in 2003 compatibility
mode using C#.

I have a table I "receive" data from call EMPLOYEES_ACTIVE. The two
main fields are EMPL_ID and LAST_FIRST_NAME.

I have 2 text boxes on the form. The first box the user types in an
employee id and I want the second to fill in the name.

I am pretty sure I need to use the onafterchange method, but I don't
know what to do with it.

Maybe I should be doing something completely different.

[InfoPathEventHandler(MatchPath = "/dfs:myFields/dfs:dataFields/
d:EMPLOYEES_ACTIVE/@EMPL_ID", EventType =
InfoPathEventType.OnAfterChange, DataObject = "EMPLOYEES_ACTIVE")]
public void
EMPLOYEES_ACTIVE__EMPL_ID_attr_OnAfterChange(DataDOMEvent e)
{
// Write your code here to restore the global state.


if (e.IsUndoRedo)
{
// An undo or redo operation has occurred and the DOM
is read-only.
return;
}

// A field change has occurred and the DOM is writable.
// Write your code here.
}
 
C

Clay Fox

Have you looked at just using rules in InfoPath rather than code? It may be
simpler.
 
C

Clay Fox

Typically the missing component is a filter.

Set field
From Secondary connection field with a filter value = dropdown list.

When selecting a field the filter button is in the lower left.
 

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