AnsweredAssumed Answered

Look-up not working

Question asked by NaturSalus on Feb 15, 2013
Latest reply on Feb 18, 2013 by NaturSalus

Title

Look-up not working

Post

     Hello,

     I have tried to set up a look-up both the standard way and through scripting but with no success: My feeling is that I have made  a conceptual mistake.

     On table A, I record tasks (what ) and the name of the person who carried out each task (who).

     On table B,  I record people names

     I have the join table AB used to establish a realtionship between tables A and B.

      

Relationships

     table A TO --< tableAB TO >-- table B TO

     table A TO x selection table B TO

      

     On a layout to table A TO I have several one row portals to table AB TO.

     There is one portal for each person that does a task.

     The portal when used without the look-up has the following fields:

         
  •           table AB TO:: Task
  •      
  •           table B TO::NameLastFirst
  •      
  •           tableB TO:: Job Title

      

     The portal shows all the values correctly when the Picker isused without the look-up setup.

      

     I use a picker based on Phil's EnhancedValueSelection demo that works smoothly to use persons' name and establish the relationships between table A and B records.

     No issues with the picker, I can add the names of the people who carried out the diffferent tasks and each person's name is shown on the one row portal that also displays the person's job title and the task name.

     For example:

     Proposed by --- John Smith ---  Plant Supervisor

      

      

     The portal when used with the look-up has the following fields:

         
  •           table AB TO:: Task
  •      
  •           table A TO::NameLastFirstForTask 
  •      
  •           tableB TO:: Job Title

      

     The portal shows all the values correctly but that of table A TO::NameLastFirst  that is empty.

      

      

      

     My goal is to keep track of who did what in table A and make sure that it is not modified by any changes made  in table B records (keeps people's names). And I thought that a lookup was the answer.

      

     Let's imagine that there are 5 different tasks and each is carried out by a person (yes it is possible that the same person does more than one task)

     Therefore my setting is:

     table A::namefortask1 field will hold the name of the person  who did task 1

     table A::namefortask2 field will hold the name  of the person who did task 2

     ....

     table A::namefortask5 field will hold the name  of the person who did task 5

      

     As mentioned before, I tried without success 3 things:

      

     My first approach is probably doomed based on how FM lookup feature works.

      I made tableA::namefortask1 field a text and  looked-up value field.

     Once I made a name selection through the picker no value was added to the tableA::task1 field and no value was shown on the portal row field: table B TO::NameLastFirst.

     My second approach was similar to first, but in this case the tableA::task1 field was made a calculation field, with the calculation = Lookup ( tableB TO::NameLastFirst) and calculation result is Text

     My third and last approach was to use scripting and add the following line:

     Set Field [table A TO::namefortask1; Lookup (table B TO::NameLastFirst)

     to the Portal Selection script used in the Picker since it is from this script that the table AB TO records are created and the table A TO to table B TO relationshipsare established.

     But I got the same result:

     no value is shown on the table A TO::namefortask1 field be it by itself or a a cell of the one row portal to the table AB TO

     So I guess, my reasoning is at fault since I am getting zero results.

     Any clues as to how to get home?

     Thanks,

     natursalus

      

Outcomes