Announcement

As of April 17, 2018, this site is now in read-only mode. To start new Blackbaud Developer’s discussions, you will find Developer Discussions in the Blackbaud CRM Community.

To post or respond to Blackbaud Community discussions, you will have to login using a www.blackbaud.com login. Learn how to login here. If you have questions or need assistance, please email community@blackbaud.com.

1.7k questions

3.2k answers

401 users

Categories

1.7k questions

3.2k answers

401 users

I have built some customizations for the Opportunity forms that allow us to track "Expected Close Date" on opportunities, and for that, I've added a view data form extension to show this on two OOB forms.

We have another extension that allows us to associate revenue other than gifts and pledges (grants and planned gifts, for example).

On the opportunity details form, I have a form extension that shows Expected Close Date and Other Associated Revenue as additional fields (the OOB form name is "Opportunity Details Tab View Form").

I'd like to hide the Other Associated Revenue field (easy enough) and ADD that amount to the Revenue Committed field in the OOB form.

I have tried doing this as a form addin on the main form, but I don't see to have access to the extension fields. And I can't seem to add an add in to the extension itself. My plan was to try to use the Form AddIn OnInit() method to make the adjustment.

Suggestions?

asked by rickroot (273 points)
Is there a specific reason you are using a separate addin and not the original extension to do this?
Exactly how would I use the original extension to do this?  The extension only extends a form, it doesn't change the original form does it?

I want to modify something in the original form with data from the form extension.
You should have access to the host model from the extension.  I believe you can pull it from from the HostModelChanged event.  https://www.blackbaud.com/files/support/guides/infinitydevguide/infsdk-developer-help.htm#../Subsystems/dataforms-developer-help/Content/InfinityDataForms/coAddingEventsToExistingFields.htm
Oh, you made the assumption that my extension has a UI model, but it doesn't.  I suppose that's more sensible though than trying to do it with an Add In....

I only did my first UI Model earlier today :)

Thanks.
So I've attempted this and am not having any luck.  When I add the UI Model to the form extension, it doesn't show at all.  I debugged it, and it errors, because Me.HostModel is not defined (is Nothing)

Here's my code

Imports Blackbaud.AppFx.MajorGiving.UIModel

Public Class UNCOpportunityExtensionViewDataFormUIModel

    Private Sub UNCOpportunityExtensionViewDataFormUIModel_Loaded(ByVal sender As Object, ByVal e As Blackbaud.AppFx.UIModeling.Core.LoadedEventArgs) Handles Me.Loaded

        Dim _parentModel As MajorGiving.UIModel.Opportunity.OpportunityDetailsTabViewFormUIModel
        _parentModel = DirectCast(Me.HostModel, MajorGiving.UIModel.Opportunity.OpportunityDetailsTabViewFormUIModel)
        _parentModel.REVENUECOMMITTED.Value = Me.UNCASSOCIATEDREVENUE.Value
    End Sub

End Class
I don't know off the top of my head when the host model is set and if that is before the loaded event fires.  Does it work from HostModelChanged like the example link in the comments above?

Please log in or register to answer this question.

...