How to retrieve user who is locking a record

Use this board for starting discussions, asking questions, and giving advice on RPG programming for the IBM i platform (and predecessors.)
lfarotto
New User
Posts: 2
Joined: Thu Jun 09, 2016 4:15 am
First Name: laura
Last Name: farotto
Company Name: skemalog
City: milano
Country: Italy
Contact:

How to retrieve user who is locking a record

Post by lfarotto »

hello,

as we usually do on green screen, we would like to inform the user about who is eventually locking a record. In green screen we show position 91-170 of sds, but in Profound Environment we don't get the name of the user locking the record (the user is logged with his own profile).

How do we get this information?

Thanks in advance,
I've tried to search for a past reply on this topic but couldn't find it!
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: How to retrieve user who is locking a record

Post by Scott Klement »

What do you mean by "Profound Environment"? Profound makes many different products, which one are you using? How are you running this program?
lfarotto
New User
Posts: 2
Joined: Thu Jun 09, 2016 4:15 am
First Name: laura
Last Name: farotto
Company Name: skemalog
City: milano
Country: Italy
Contact:

Re: How to retrieve user who is locking a record

Post by lfarotto »

I'm using a Rich Display File (DDS made with Profound UI Visual Designer) and RPG program. The program is run from a browser.
In the RPG program I read SDS position 91-170 when the CHAIN(E) operation gives back an error.
I hope I gave you the information you have asked,

thanks,
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: How to retrieve user who is locking a record

Post by Scott Klement »

I'd like to clarify that the Program Status Data Structure (PSDS) is not under Profound UI's control. This is created by RPG inside IBM's code. If we do find a problem here, Profound Logic will not be able to help, we'll need to contact IBM for assistance.

However, I could not find a problem.

You said that it isn't working in a profound environment -- you didn't mention what you meant by that, except that it was in a web browser (which is the only possible way to run a Rich Display). Since there are only three possible environments where Rich Displays can run, I just went ahead and tried all of them.

1. In a Genie (5250) session.
2. In the Rich Display Controller (/profoundui/start or Atrium's launcher for a Rich Display)
3. In an anonymous session.

In all of these environments, it worked as expected.

The way I tested this was by creating a simple Rich Display that reads a record and puts the error message from position 91 of the PSDS on the screen. Or, if the record is read successfully, it simply says that it was successful. The RPG code follows:

Code: Select all

**free
ctl-opt dftactgrp(*no);

dcl-f LOCKTESTD workstn handler('PROFOUNDUI(HANDLER)');
dcl-f PRODP disk usage(*input:*update);

dcl-ds test psds;
   errmsg char(80) pos(91);
end-ds;

dou exit = *on;

   chain(e) 9 prodp;
   if %error;
      msg = errmsg;
   else;
      msg = 'Record locked successfully';
   endif;

   exfmt result;

enddo;

*inlr = *on;
 
The display I tested with is also very simple, it just shows a small panel with the message and buttons to try again or exit:

Code: Select all

     A          R RESULT
     A                                  1  2HTML('QPUIREC0    ')
     A                                  1  2HTML('{"screen":{"record format nam-
     A                                      e":"result"},"items":[{"id":"Layout-
     A                                      1","field type":"layout","css class-
     A                                      ":"blueprint-defaults","left":"5px"-
     A                                      ,"top":"75px","body theme":"bluepri-
     A                                      nt-white-body","css class 2":"bluep-
     A                                      rint-panel","header text":"Record L-
     A                                      ock Test","header theme":"blueprint-
     A                                      -light-blue-header","height":"205px-
     A                                      ","template":"css panel","width":"3-
     A                                      15px"},{"id":"HtmlContainer1","fiel-
     A                                      d type":"html container","css class-
     A                                      ":"blueprint-defaults","left":"20px-
     A                                      ","top":"15px","css class 2":"bluep-
     A                                      rint-wrapping-text","height":"75px"-
     A                                      ,"html":{"fieldName":"msg","dataLen-
     A                                      gth":"80","trimLeading":"false","tr-
     A                                      imTrailing":"true","blankFill":"fal-
     A                                      se","rjZeroFill":"false","dataType"-
     A                                      :"char","formatting":"Text","textTr-
     A                                      ansform":"none","designValue":"[msg-
     A                                      ]"},"white space":"normal","width":-
     A                                      "270px","border bottom style":"soli-
     A                                      d","border left style":"solid","bor-
     A                                      der right style":"solid","border to-
     A                                      p style":"solid","layout":"Layout1"-
     A                                      ,"container":"1"},{"id":"Button1","-
     A                                      field type":"button","css class":"b-
     A                                      lueprint-button","value":"Repeat","-
     A                                      left":"25px","top":"110px","css cla-
     A                                      ss 2":"blueprint-alt-defaults","hei-
     A                                      ght":"30px","width":"100px","respon-
     A                                      se":{"fieldName":"repeat","customTr-
     A                                      ue":"","customFalse":"","dataType":-
     A                                      "indicator","formatting":"Indicator-
     A                                      ","indFormat":"1 / 0"},"layout":"La-
     A                                      yout1","container":"1"},{"id":"Grap-
     A                                      hicButton1","field type":"graphic b-
     A                                      utton","css class":"pui-solid-butto-
     A                                      n-no","value":"Exit","left":"180px"-
     A                                      ,"top":"110px","css class 2":"bluep-
     A                                      rint-defaults","height":"30px","ico-
     A                                      n":"material:clear","icon position"-
     A                                      :"left","width":"100px","response":-
     A                                      {"fieldName":"exit","customTrue":""-
     A                                      ,"customFalse":"","dataType":"indic-
     A                                      ator","formatting":"Indicator","ind-
     A                                      Format":"1 / 0"},"shortcut key":"En-
     A                                      ter","layout":"Layout1","container"-
     A                                      :"1"}]}')
     A            EXIT           1A  H
     A            MSG           80A  H
     A            REPEAT         1A  H 
When I run it, it shows the message from the PSDS, as expected:
lockmsg.png
lockmsg.png (11.65 KiB) Viewed 19627 times
I don't know what else to try. Can you tell me what must be done to reproduce the problem?
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests