I have a “File loaded Drop Combo” which fills the form with the contact person’s name, phone number and e-mail address. The problem is that I only want to change the phone number and e-mail address if the target fields are empty or if the contact person’s name is changed.
I can’t find any place to write code to do this check.
The only place where I can find references to the variables (Con:PhoneNo and Con:Email) is in “ThisWindow.Init PROCEDURE”, but I cannot find any way to surround them without surrounding the hole “! Process field templates”.
ConPersQ.AddField(Con:PhoneNo,ConPersQ.Q.Con:PhoneNo) !List box control field - type derived from field
ConPersQ.AddField(Con:email,ConPersQ.Q.Con:email) !Browse hot field - type derived from field
On the other hand, I do not think this is the right place to make a conditional statement, but I cannot find the variables Con:PhoneNo and Con:Email anywhere else in the source.
Hi Trond - I didn’t get an email notice about your reply. Sorry for the delay.
Looking at abdrops.clw, the assignment happens within several different methods and there’s not really a single place to put conditional code in the proper location. If you search for SELF.UpdateFields.AssignLeftToRight in abdrops.clw, you can see what I mean. There are several occurrences :-\
I wonder if it would be the least disruptive to create LOCAL variables to assign the values, and call a ROUTINE that does the actual assignment based on your conditions.
Then call your ROUTINE after the PARENT call in the following methods:
If I understand correctly, there should be a button on the drop-combo actions that says “More Field Assignments”. Your other fields should be listed there, or add something new for testing. If you search the source for one of those fields, you should find the derived method that you can put embed code in… I think.
I set up some conditions in the TakeNewSelection() and assigned local variables to the con: variables and it looks like it solved the problem.
The problem was that I wanted “More Field Assignments” only when the target fields where empty, and that I could not find where to do the check. But after “PARENT.TakeNewSelection(Field)” in “TakeNewSelection PROCEDURE(SIGNED Field)” I could set up some conditions and assign values when I wanted. Thanks.