show another dataform programmatically when a value is changed using VB.net/C#

Hello everyone,

Is there anyway to pop up another dataform when a value in existing form is changed using SDK (VB/C#).

I have not problem creating event listener for the value changed, but am still looking for method to make it happen.

server.loaddataform() only loads the form data instead of popping the form.

I aslo tried using a UIAction, but wasnt able to trigger the action on the fly

Dim customFormInvokeArgs = New InvokeFormActionArgs()

'Dim test2 = New ShowCustomFormUIAction()

testAction.Invoke(customFormInvokeArgs)

I am struggling finding a method in SDK to make this happen?

Anyone has any suggestions using vb/c# or instead of using js, or any example I can check in BBCRM to see how it was implemented?

Thanks in advance.

Joe

Comments

  • @Joe Huang
    If you're trying to approach this from a strictly VB/C# approach, I would suggest setting up a UIAction that will have your default dataform ID in it. Then have your logic change the dataformid associated with that given UIAction and then whenever you're ready just fire the action either manually or via code. Here's a basic example (please note the xml won't live in the same files as the C#)


    <UIAction ActionID="SHOWADDFORM" Caption="ShowAddForm">
    <ShowDataForm DataFormInstanceID="de833d24-4bc1-4515-9ed7-02071e5d3654"/></UIAction>


    private void SOMETHING_ValueChanged(object sender, Blackbaud.AppFx.UIModeling.Core.ValueChangedEventArgs e)
    {
    this.SHOWADDFORM.DataFormInstanceId= <YOUR OTHER DATAFORMINSTANCEID HERE>
    }

    After you set your logic up like above you should just be able to invoke the SHOWADDFORM action when you're ready and it should fire the way you expect (only issue would be if you're switching between add and edit/view forms. This same example should work for the CustomFormAction as well.

Categories