Why is my GET Function not returning TRUE value?

Hello all,

Please I’m working on an HR Project. I have a Table called “Job Opening” and is used to setup job openings. In the Job Opening Table, the “Code” of a Job should be fetched in a Form called “Job Definitions”.

After the the selection and OnValidation of “Code” field, the corresponding Description and Department should be populated. Unfortunately, it’s not working according to plan even though there are Data in the “Job Definitions” Form. Someone Should Kindly tell me my fault. Thank you.

4744.Capture3.PNG

Below is the Message that shows OnValidation of “Code”.

3021.Capture4.PNG

Below is the code for Onvalidate of “Code” in the above table.

6433.Capture5.PNG

Below is the Form where the Code is fetched

7167.Capture2.PNG

Declearation of JobDefinition Variable

3021.Capture8.PNG

Hi Enock,

when using the GET function, you can only use without parameters in certain scenarios, usually setup tables, where you only have one record.

In your case you need to modify the code to something like this:

BEGIN
JobDefinition.GET(Code);
..

END;

Thank you so much SNielson… I really appreciate your help.

Hear from you again.

Just some additional info. Have a look here: http://msdn.microsoft.com/en-us/library/dd301056.aspx which describes the GET function (also to be found in the C/SIDE Reference Guide).

As you can see from the synthax:

[Ok :=] Record.GET([Value] ,…)


the Value parameter(s) is (are) optional. Meaning that by defaullt (as the topics says):

… the value 0 (zero) or an empty string is assigned to unspecified fields

So your GET statement JobDefinition.GET is trying to get a JobDefinition record with PK(which seems to be the Code field) equal to ‘’ (i.e. an empty string).

In the case of setup tables Søren is pointing at: these normally only have one record with PK field (generally called Primary Key and of data type Code) = ‘’.

Thanks so much… I always like the way you explain things to me… God will continue to bless you…[:)]

Enock