Auto Populate a field in a Form

Hi :slight_smile:

I have a software database, which is used to enter information about all new software we purchase. I have modified the existing Software form in order to add new fields like ‘Owner’ of the software and his phone number. Now the way this works is that the Owner field is a Name type field which is picked up from our internal department address book (NAB) by enabling the property —> ‘use address dialog for choices’, and as soon as this field contains a name it thens auto populate the 'Phone Number" field by getting the information also from the NAB. Now this works fine with all new documents I create, but as soon as I open an old document in order to update the missing information, the old document picks up the name like it should but does not auto populate the phone number field. Anyone has an ideal?

THanks

Subject: Auto Populate a field in a Form

your phone number field is likely beneath the name field and has a default value doing the lookup but since the doc is not new the default does not recalculate. Try putting the code for your phone number field lookup in the input translation event and precede it with a check to see if the field is blank and if it is then do your lookup:

@If(PhoneNumber != “”; PhoneNumber; )

Subject: RE: Auto Populate a field in a Form

Hi Paul, thanks this makes sense, now I’m trying to get my formula working, here is what I got but does not give me anything. My Phone Number field is computer and I have this code in the Imput Translation :

@If(PhoneNumber != “”; PhoneNumber; @DbLookup( “”; “APP04” : “csb//imsd//hcdir3.nsf” ; “Emp” ; @Right(Owner; “”) ; “OffficePhoneNumber” ; “” ))

for @Right(Owner;“”) I’m really trying to get the full name of the Owner on the form.