Community
Showing results for 
Search instead for 
Do you mean 
Reply

Note Button not creating a CreateNoteComplete event

Highlighted
New Member
Posts: 3
Country: USA

Note Button not creating a CreateNoteComplete event

Hello, I am using Act v21 and am running into an issue with trying to get an event to fire off and be responded to in my C# plugin.

 

My company uses Act with three buttons to create notes. Of those buttons is the default New Note button. I have the following code to add my method to the CreateNoteComplete event with the following:

 

act.ActFramework.Notes.CreateNoteComplete += Notes_CreateNoteComplete;

 

This is occurring after logon. This works when using custom built tools to create notes, but not the default note button and I could not find any indication of what events the New Note button creates or what methods it uses. Any idea how I can add my method to the eventhandler of a specific toolbar button?

 

Furthermore, when the Notes_createNoteComplete method is called, the contact does not update unless I insert messageboxes in between. Any ideas why?

I'm updating the Fields by doing the following:

 

string SA = UpdateSAField(act.ApplicationState.CurrentContact);
if (!SA.Equals(""))
{

SACField.SetValue(act.ApplicationState.CurrentContact, SA);
act.ApplicationState.CurrentContact.Update();
MessageBox.Show("" + act.ApplicationState.CurrentContact.Fields["SA", FieldNameType.Alias] + "\n\n" + SA);
}

SADateCField.SetValue(act.ApplicationState.CurrentContact, DateTime.Today);
act.ApplicationState.CurrentContact.Update();

MessageBox.Show(act.ApplicationState.CurrentContact.Fields["Company", FieldNameType.Alias] + "\n\n" + act.ApplicationState.CurrentContact.Fields["SA Note Date", FieldNameType.Alias] + "\n\n" + act.ApplicationState.CurrentContact.Fields["SA", FieldNameType.Alias]);
Highlighted
New Member
Posts: 3
Country: USA

Re: Note Button not creating a CreateNoteComplete event

I resolved the latter issue a little roundabout, so I'm open to tips:

 var currContact = act.ApplicationState.CurrentContact;
currContact.Fields["SA Note Date", FieldNameType.Alias] = null;
currContact.Update();

currContact = act.ApplicationState.CurrentContact;
currContact.Fields["SA Note Date", FieldNameType.Alias] = DateTime.Today;
currContact.Update();

Seems like it's because Alias fields don't like being changed unless they're already null.