Bit Confusing 4r me now...

Team,
It would be of great help if someone can pull me out from my problem. Here is my problem;

FUNCTION fnWriteErrorLog RETURNS LOGICAL (INPUT iplStartErrorLogging AS LOGICAL,
INPUT ipcErrorLogString AS CHARACTER):
IF NOT iplStartErrorLogging THEN
RETURN FALSE.
PUT STREAM stErrorLog UNFORMATTED STRING(NOW) ' ' ipcErrorLogString SKIP.

RETURN TRUE.

END FUNCTION. /* fnWriteErrorLog */

lStartErrorLogging = YES.

FIND FIRST userprofile NO-LOCK WHERE userprofile.userid = cUserId NO-ERROR.
IF AVAILABLE userprofile THEN
DO:
fnWriteErrorLog(INPUT lStartErrorLogging,
INPUT 'The UserProfile.userProfileID is ' + ' |' + STRING(UserProfile.userProfileID)).
fnWriteErrorLog(INPUT lStartErrorLogging,
INPUT 'The UserProfile.UserID is ' + ' |' + STRING(UserProfile.UserID)).
END.
Is there a possibility to get proper "userProfileID" and "UserID" as 0. I am not sure how come after choosing the userprofileid for the matching userid the userid becomes 0?

Here is the log file result;

05/08/2009 15:10:08.503+00:00 The UserProfile.userProfileID is |867163
05/08/2009 15:10:08.503+00:00 The UserProfile.UserID is |0

When i query the same through Procedure Editor, am getting the below proper value;

User Profile ID : 867,163
User ID : 915,616

Please let me know if more information is required. Please let em know if am missing out something. Thanks in advance..!
 

Cecil

19+ years progress programming and still learning.
What happens when you change the the find stantment from "find first userprofile no-locK" to "find userprofile no-lock" .

I am guess that there is more than one record with the same userID.
 

RKR

Member
If there are more userprofiles that match the criteria it will not help to change the find first in a find. Actually it will find nothing at all in that case. I am actually wondering where cUserId is filled and if it contains the correct value.
 

Cringer

ProgressTalk.com Moderator
Staff member
Actually, trying what Cecil suggested is a good idea. Because you won't get anything in the log. Therefore proving there are multiple records.
 
ya am working on it now. Its bit a complicated program to analyze. but still i wonder even in your case if you have 2 records, when u select a record using userid, the same value should persist when we try logging it here... am i right?

Currently i have improvised the logs and have pushed it to production environment. Once i get the logs from them i would be able to get a clear picture... Even in your case if it doesn't find any record out of that 2, then we should not have got the userprofileid... but it is getting properly logged...

If any other suggestions please let me know. I will wait for your suggestions and the logs that i get from production environment to move further in this regard. Thanks in advance..!
 
Top