#7167
Support 1
Participant

As I understand your enquiry, you are looking at how to add custom fields to a GroupWise message. In the GroupWise Object API, the Message object has a property Fields which is a collection of Field (ie. ‘custom field’) objects. Fields is not available via GroupWise.ComposingMessage; as a result you will need to use either an existing message, or else create a new message entirely in code.

Here is a simple example:

  const CUSTOM_FIELD_ID = "Acme Electrical Hardware"

  ...

  dim oFieldDef, oFieldDefs, oMsg

  ' Initialize oMsg to something we can compare.
  set oMsg = nothing

  ' Get a reference to the open (not composing) message view.
  set oMsg = Client.ClientState.CommandMessage

  ' (Alternatively, create a new message.)
  ' set oMsg = GroupWise.Account.MailBox.Messages.Add("GW.MESSAGE.MAIL", fgwDraft)
  ' Initialize other fields...

  ' Add a custom field.
  if not (oMsg is nothing) then
    set oFieldDefs = GroupWise.Account.FieldDefinitions

    ' Is our custom field defined?
    set oFieldDef = nothing
    set oFieldDef = oFieldDefs.Item(CUSTOM_FIELD_ID, fgwString)
    if oFieldDef is nothing then
      ' No - add a definition now.
      call oFieldDefs.Item(CUSTOM_FIELD_ID, fgwString)
    end if

    call oMsg.Fields.Add(CUSTOM_FIELD_ID, fgwString, _
      "Acme Electrical goods are the best!")
  end if

For more details, see the online documentation for Fields.

I hope this helps you.

Advansys Support