Bharat_Naik
Senior Member Members
    Offline
 Ever ready to learn and share
Posts: 1202
Location: Chicago, Illinois
Joined: Dec 16 th, 2003
|
Re: UserSelect Question
Reply #65 - Apr 2nd, 2005 at 7:38pm
|
Print Post
|
Flip, Glad to know that it worked out for you as you wanted it to. I was thinking about how it could be done without changing any structure or making any new field. Since now you already made the changes and added an extra-element or modified and made it work, this discussion is just academic value and may be just theoretical. I believe the following should work if we call the above subroutine after picking up equipment on element exit event. Subroutine goes in the Global Code.
var vEquipmentInfo as String vEquimentInfo = @xListValueAll(@FN, Company, "Equipment_List!CompanyName","CompanyName;SerialNo;Model")
vEquipmentInfo = @Repleace (vEquipmentInfo, @newline ( ), ";")
Subroutine Populate_fields() var t as array[20, 3] of String //company could have upto 20 equiments var i as Int
//Populate Array
i = 1
While @len (vEquipmentInfo) > 0 t[i,1] = Split (vEquipmentInfo, ";") t[i,2] = Split (vEquipmentInfo, ";") t[i,3] = Split (vEquipmentInfo, ";") i = i + 1
//Loop to find the value of Equipment and when found assign value of serialNo and Model
For i = 1 to 20
If t[i,1] = Equipment { Serial = t[i,2] Model = t[i,3] i = 20 } Else i = i + 1
Next
End Subroutine
===============
I did not debug the above codes and did not check the names of elements but concept and logic should be understandable.
I would like request the Lantica Development team to include the availability of simple function, in which one could combine two or more external key elements to make it Unique to be used in some of the x-family functions, that will obviate the need to change the structure or add any additional element to make an Unique key.
May be I should request this in a separate link.
|