Conditional expression needed for ViewDataForm property

Hi all, I've just edited the properties of our constituent interaction datalist so that it will display the Constituent Interaction View Form when a user clicks on an interaction in the datalist, by setting the ViewDataForm property.
However, this now generates an error when we click on an "interaction" that's actually a stewardship plan step, since the record doesn't exist in the interaction table.

I'd like to write an expression for the ViewDataForm property so that it loads the Constituent Interaction View Form for most interactions but loads the Stewardship Plan Step Details View Form for the stewardship steps. I assume it's going to be something like =IIF (record type = stewardship plan step, "Stewardship Plan Step Details View Form", "Constituent Interaction View Form") but I can't find the right field to use for the "record type = stewardship plan step" condition.

Anyone got any ideas please?

Answers

  • Hi Alan -

    I assume this is a custom datalist? As far as I know the OOB one does not show Major Giving or Stewardship plan steps. If so… one idea - return the INTERACTIONID as its own hidden GUID in the datalist. Allow it to be null for Stewardship Plan steps. Then connect the View Form to the Interaction ID instead of the ID. It will still work fine for Interactions and Plan Steps. It will not do anything (include show an error) on the Stewardship Plan Steps.

    Hope that helps!
    Aaron

  • Thanks for the suggestion Aaron! As far as I'm aware we're using the OOB datalist for constituent interactions, but I'll have to check

  • Hi Alan

    If you look in the 'Actions' for that data list, you'll see the 'Edit Interaction' exists four times, one for each record type in the data list (Interaction, Plan Step, Stewardship Step and something else I can't recall!). You'll likely need to expand your code to take these in to account, but you can see the fields you need to use in the 'visible' properties for these actions.

    E.g.: Visible =(Not CBool(Fields!ISMOVE) Or Len(Fields!ID)=0) And (Not CBool(Fields!ISSTEWARDSHIPSTEP))

    … for the interaction action.

    I've found you can often find a way to do what you want by looking at other areas. BB have often used a similar method for something else, that you can adapt for your need.

    Martin

  • Hmmm, actually, I've just noticed that we have a custom data list… it may be that my suggestion is not valid. My apologies if this is the case.

    Alternatively, you can easily create a custom data list for this, or edit yours if yours is already custom, to include the ISSTEWARDSHIPSTEP and similar fields to enable what you're looking to do. You'll see the fields in a Interaction/step query and, if needed, you can create the data list from that query once you are there.

    You may well have to update all the actions on that section though (if you create a new one), so it may not be a quick and simple job.

  • Even more interestingly, our data list doesn't have these Boolean fields in it. They must be system generated ones based on the InteractionID. This implies that you can use them with the OOB or a custom data list.

  • Thanks Martin, I'll take a look into that!

Categories