In Config, Fields it is possible to set your own fields to be required or not. For example if I wanted every organisation record in Raiser’s Edge to have a profession then I would tick the profession tick box as being required. In order to future proof my code it is necessary to check to see which fields are required so that when creating a new organization I can also prompt for the required fields too. This is not such a difficult task really only that the code below does not work as expected.
Public Sub test() Dim org As New COrganization2 org.Init SessionContext Dim meta As IBBMetaField Set meta = org Dim i As Integer For i = 1 To meta.Count If meta.UserRequired(i) Then MsgBox "User required: " & meta.DisplayText(i) End If Next i org.Closedown Set org = Nothing End Sub
If I mark all the config field for organisations required only two of them (relationship and reciprocal) appear. I was not sure why profession and contact type do not appear.
When I looked at an organization record contact type was not in blue (designated a required field). When I ticked the contact tick box the contact type field was no longer disabled and became blue. This does not explain why profession was not included in the but relationship and reciprocal were included.
When I initialise the code above with an actual record, i.e. I load the record and run the loop again profession does appear.
This is a pain as I am not able to work out which fields are required without actually supplying a loaded object. I may not know the id of an object to load and to select an arbitrary org to load just seems somehow wrong.
Blackbaud are aware of this problem (well I told them about it) and I am waiting to see if I hear anything.
If anyone knows of a workaround or another solution then I would be happy to hear about it.