Update a textfield in batch row based on the selected value of a drop down list within the same row
I have TSQL code in my Add and Edit specs to correctly update the text field depending upon the value in my drop-down list. This works fine, but of course, the value in my text field does not update when the drop-down list is changed, only when the batch is saved, closed, and re-opened..
Through a UIModel class, I am trying to detect when the drop-down list has changed (or when the list or row loses focus), then I am trying to set the value in another text field within the same row. I've been trying to refresh the control, the row \\ record, or even the whole dataset, but haven't had any luck.
What's the best way to do this? Any recommendations?
Thank you,
Ernie
Comments
-
Ernie,
The best way to alter behaviors in the batch is through a batch handler. Here is some documentation on how to implement a FieldChangedHandler that allows you to delegate methods to handle different fields changing. Hope this helps!1 -
Thanks Nick. I am reading it now.
0 -
The documentation was extremely helpful, and I am close to having something functioning now. I have a lot working, but two points of failure. I am using this documentation as suggested. Blackbaud - Step By Step: Retrieving Default Data when a Field Changes
Next I create an ID and populate it using the example syntax, if I understand correctly this is expected to be the batch row \\ record ID to be used later.
I am able to add and call the field changed handler. This is working.
Dim ID = DirectCast(GetValueFromFieldID(e.Model, e.Field.Name, Guid.Empty), Guid)ID is empty when written this way. Seems like we are asking for the model and field name or the field which called the subprocedure. This is the field we are watching to see if it changed. If I hard code ID to my batch row GUID or if I set my ID = Me.ActiveModel.ContextId the rest of my code executes but still does not work. I am confused as to why the suggested syntax is not firing and I am concerned I have misinterpreted what is needed. Replacing the code suggested in the documentation seems wrong, but its the only way I can get anywhere.
Next, we inspect the ID to make sure its not empty (it's ok if I hard code it or call Me.ActiveModel.ContextID, otherwise this check fails, the subprocedure returns and we are done.
If ID.Equals(Guid.Empty) Then ReturnWe build a DataFormLoadRequest referencing the form that will (reload data to be used a few lines later. I am using the Edit Form in my batch, and assume it references the LOAD stored procedure defined within. This runs fine. It uses the ID defined above, and I am worried about that variable.
Next we create a DataFormLoadReply. No problems
We try to populate the Reply
reply = Blackbaud.AppFx.Server.DataFormLoad(request, Me.RequestContext)This works and returns something. We get all the way to our call to:
TrySetValuesFromDFI(e.Model, reply.DataFormItem, "MYFORMFIELDNAME", "MYDATAFIELDNAME")This executes but does not update my field. Nothing happens.
I can call TrySetValueForFieldID() all day long with succes, but not TrySetValuesFromDFI.
No errors, just no change to the desired field.
Any suggestions?
Thanks,
Ernie0
Categories
- All Categories
- 6 Blackbaud Community Help
- 213 bbcon®
- 1.4K Blackbaud Altru®
- 403 Blackbaud Award Management™ and Blackbaud Stewardship Management™
- 1.2K Blackbaud CRM™ and Blackbaud Internet Solutions™
- 15 donorCentrics®
- 360 Blackbaud eTapestry®
- 2.6K Blackbaud Financial Edge NXT®
- 656 Blackbaud Grantmaking™
- 577 Blackbaud Education Management Solutions for Higher Education
- 3.2K Blackbaud Education Management Solutions for K-12 Schools
- 940 Blackbaud Luminate Online® and Blackbaud TeamRaiser®
- 84 JustGiving® from Blackbaud®
- 6.7K Blackbaud Raiser's Edge NXT®
- 3.7K SKY Developer
- 249 ResearchPoint™
- 119 Blackbaud Tuition Management™
- 165 Organizational Best Practices
- 241 Member Lounge (Just for Fun)
- 34 Blackbaud Community Challenges
- 37 PowerUp Challenges
- 3 (Open) PowerUp Challenge: Grid View Batch
- 3 (Closed) 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
- 796 Community News
- 3K Jobs Board
- 54 Blackbaud SKY® Reporting Announcements
- 47 Blackbaud CRM Higher Ed Product Advisory Group (HE PAG)
- 19 Blackbaud CRM Product Advisory Group (BBCRM PAG)

