/ Forums / Advansys Formativ / Creating Solutions with Formativ / LastName property problem in Dutch Groupwise (part 2) / Reply To: LastName property problem in Dutch Groupwise (part 2)
It appears that the native field name for the last name field is not being correct translated. We have not had this reported previously, so I am not entirely sure why this would be the case. Formativ 1.5 uses a different technique when handling different language field definitions, so this issue should not be a problem.
To work around the issue, you need to determine the internal name for the last name field in the Dutch client. The following applet shows all the internal field names for the given book. Execute it and make a note of the last name field as displayed:
Sub Main(Client, GWEvent)
Dim iAddressBooks
Dim iAddressBook
Dim iObject
Dim iFieldDefs
Dim iFieldDef
Set iAddressBooks = GroupWise.AddressBooks
Set iAddressBook = iAddressBooks.Item("test2")
Set iObject = iAddressBook.Object
for each iFieldDef in iObject.FieldDefinitions
MsgBox iFieldDef.Name
next
End Sub
You then need to use the AddressBookEntry.Object property to access the native address book entry, then use the extact field name you obtained from the applet above to write the last name to the entry. I have modified your applet to show how this is done. Note that you will have to change the text “Last Name” with the Ducth string as output by the applet shown above:
const egwString = 1
Sub Main(Client, GWEvent)
Dim AddressBooks
Dim AddressBook
Dim oAddressBookEntries
Dim oAddressBookEntry
Dim iObject
Set AddressBooks = GroupWise.AddressBooks
Set AddressBook = AddressBooks.Item("Test Book")
if IsEmpty(AddressBook) then
MsgBox("Could not locate that address book")
else
MsgBox(AddressBook.Name)
Set oAddressBookEntry = AddressBook.AddContact("Bill Smith")
oAddressBookEntry.FirstName = "Bill"
' Get the native GroupWise address book entry object
set iObject = oAddressBookEntry.Object
on error resume next
call iObject.Fields.Add("Last Name", egwString, "Smith")
end if
Set AddressBooks = nothing
MsgBox("Done")
End Sub
I hope this helps.
Advansys Support