Invoking a data form action from within the UI model code.
I have the following action in my data form:
//
//_filecontactreport
//
_filecontactreport.Name = "FILECONTACTREPORT";
_filecontactreport.Caption = "File contact report";
_filecontactreport.DataFormInstanceId = new System.Guid("8f5cdf69-8f03-4d3c-b6b5-3f5d29e2fce8");
_filecontactreport.RecordIdDefinition = "Fields!STEPID";
_stepid.LinkedActions.Add(_filecontactreport);
this.Actions.Add(_filecontactreport);
I want to invoke this action when a field is populated instead of waiting for the user to click the action button. I am not sure how to do this. Here is what I've tried unsuccessfully. I'm not sure what the invoke args are supposed to be. This code does not error. It just does nothing.
//invoking this does not seem to work
InvokeFormActionArgs invokeargs = new InvokeFormActionArgs();
System.Collections.Specialized.NameValueCollection parameters = new System.Collections.Specialized.NameValueCollection();
invokeargs.Cancel = true;
invokeargs.Model = _model;
invokeargs.Parameters = parameters;
_filecontactreport.Invoke(invokeargs);
Anyone have any ideas?
Comments
-
Hey Harry,
It sounds like you'll want to create an event listener for the value being changed. You can do this easily by specifying what you want to happen in the OnCreated() method that gets generated automatically when you create a UI Model, similar to the example below:
partial void OnCreated()
{
this.Loaded += YourUIModel_Loaded;
this.SOMEVALUE.ValueChanged += SOMEVALUE_InvokeAction;
}
The this.Loaded line is auto generated so don't worry about that but when you get to the += of the second line Visual Studio will prompt you to hit tab twice to auto generate the method for the event listener that you're trying to set up (that is if you're typing it out). Once you have your method you can specify inside of it what it does.
One thing to keep in mind is you'll probably want to change it so that when the focus changes from that box and the value is changed that it executes what you want (otherwise any time you type in an extra character it'll run the action)
Does this make sense?
0 -
Hey Steven,
Thanks for the response. Yep, I know how to do the event listener part. I'm trying to figure out how to call the action once I'm in the handler.
0 -
If you already have the event handler set up I would just include the Blackbaud.AppFx.Server package into your project and just call the dataform or other component you're trying to call inside of the event handler method that gets generated. Unfortunately this won't cause the dataform to appear so if that's what you're going for I've not had any experience with that.
This might help you if you're trying to get a dataform to pop up instead.0
Categories
- All Categories
- 6 Blackbaud Community Help
- 213 bbcon®
- 1.4K Blackbaud Altru®
- 400 Blackbaud Award Management™ and Blackbaud Stewardship Management™
- 1.1K Blackbaud CRM™ and Blackbaud Internet Solutions™
- 15 donorCentrics®
- 360 Blackbaud eTapestry®
- 2.6K Blackbaud Financial Edge NXT®
- 655 Blackbaud Grantmaking™
- 576 Blackbaud Education Management Solutions for Higher Education
- 3.2K Blackbaud Education Management Solutions for K-12 Schools
- 939 Blackbaud Luminate Online® and Blackbaud TeamRaiser®
- 84 JustGiving® from Blackbaud®
- 6.6K Blackbaud Raiser's Edge NXT®
- 3.7K SKY Developer
- 248 ResearchPoint™
- 119 Blackbaud Tuition Management™
- 165 Organizational Best Practices
- 241 Member Lounge (Just for Fun)
- 34 Blackbaud Community Challenges
- 34 PowerUp Challenges
- 3 (Open) PowerUp Challenge: Chat for Blackbaud AI
- 3 (Closed) PowerUp Challenge: Data Health
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Product Update Briefing
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Standard Reports+
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Email Marketing
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Gift Management
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Event Management
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Home Page
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Standard Reports
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Query
- 790 Community News
- 2.9K Jobs Board
- 53 Blackbaud SKY® Reporting Announcements
- 47 Blackbaud CRM Higher Ed Product Advisory Group (HE PAG)
- 19 Blackbaud CRM Product Advisory Group (BBCRM PAG)
