Pages

Custom Search

Refresh a Page using peoplecode

 

Refresh a Page Example:

Trigger after a SavePostChange event.

GetLevel0().Refresh() /* This will refresh the page */

No Prompt Field Name Specified For Drop Down List In Page Definition

This is because in the page field properties of the field “Field” the field value is left blank in the prompt properties. This can be fixed by setting FIELDNAME as List Box in record field properties.


Note: Don't forget to rebuild/alter the record.

Peoplecode for dropdown

 Local SQL &SQL;

/* Clearing all existing values that were with AddDropDownItem() */

RECORD.FIELDNAME.ClearDropDownList();

/* Creating SQL for fetching values to be added to the drop down */

&SQL = CreateSQL("SELECT A.FIELD2 FROM PS_RECORD2 A WHERE A.FIELD3= :1", &para1, &out2);


While &SQL.Fetch(&out2)

   /* Adding each row from the SQL's output to the drop down  */

   N_RUNCNTL_SCI.INFOSILEM_DBNAME.AddDropDownItem(&out2, &out2);

End-While;

SameSite Cookie trouble for PeopleSoft Users

 Update ISS as follows:


Open C:\Program Files\Common Files\Hexagon\Services\Instances\Yourportalsite\web.config in Notepad.

Locate section <system.webServer>

And paste following code:


<outboundRules>

      <clear />

      <rule name="Add SameSite" preCondition="No SameSite">

        <match serverVariable="RESPONSE_Set_Cookie" pattern=".*" negate="false" />

        <action type="Rewrite" value="{R:0}; SameSite=None; Secure" />

      </rule>

      <preConditions>

        <preCondition name="No SameSite">

          <add input="{RESPONSE_Set_Cookie}" pattern="." />

          <add input="{RESPONSE_Set_Cookie}" pattern="; SameSite=None; Secure" negate="true" />

        </preCondition>

      </preConditions>

    </outboundRules>

Note: you can also add an iRule in load balancer, it is very similar to the web config change above, basically modifying the cookie to have samesite=none; secure

Application Engine error - Warning: Application Engine Request is not active -- processing suspended

If you see this error when running an Application Engine:

Warning: Application Engine Request is not active -- processing suspended


You need to run this in the database to clear it up:

--- Here xxxxx is the OPRID


SELECT * FROM PS_AEREQUESTTBL WHERE OPRID = 'xxxxx';


From the result above, determine which one to remove, and the run the following to remove the entry. (Be sure to add more criteria if needed)


DELETE FROM PS_AEREQUESTTBL WHERE OPRID = 'xxxxx';

How to delete a service operation if this error is encountered: "Unable to delete. References found in runtime tables." ?

Run these three SQLs to see if you've any data for the service operation which you want to delete. 

SELECT * FROM PSAPMSGSUBCON WHERE IB_OPERATIONNAME = 'service operation'
SELECT * FROM PSIBLOGHDR WHERE IB_OPERATIONNAME = 'service operation'
SELECT * FROM PSAPMSGPUBHDR WHERE IB_OPERATIONNAME = 'service operation'

If you do, then delete the data and you will be able to successfully delete the service operation..

SoapDoc for peoplecode

Sample XML:

<?xml version="1.0"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:inf="http://www.ABC.com/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
  <SOAP-ENV:Header/>
  <SOAP-ENV:Body>
    <inf:Method>
       <inf:Request>
           <Element1>123456</Element1>
           <Element2>test2</Element2>
       </inf:Request>
    </inf:Method/>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

PeopleCode using application package:

import PS_PT:Integration:IRequestHandler;

class TEST_IB implements PS_PT:Integration:IRequestHandler
   method TEST_IB ();
   method OnRequest(&_MSG As Message) Returns Message;
   method OnError(&_MSG As Message) Returns string;
end-class;

/* constructor */
method TEST_IB
   %Super = create PS_PT:Integration:IRequestHandler();
end-method;

method OnRequest
   /+ &_MSG as Message +/
   /+ Returns Message +/
   /+ Extends/implements PS_PT:Integration:IRequestHandler.OnRequest +/
 
   Local SOAPDoc &SOAPDoc;
   Local XmlDoc &lxmlDoc, &responseXMLDoc;
   Local XmlNode &EnvNode, &xmln, &Element1, &Element2;
   Local Message &lmsgGoRequest, &lmsgGoResponse, &Response;
   Local string &string;
 
   Local string &DefNameSpace = "http://www.ABC.com/";
 
   /*Create Soap Document*/
   &SOAPDoc = CreateSOAPDoc(); /* required */
 
   &SOAPDoc.AddEnvelope(%SOAP_Schema); /* Pick Scheme from the WSDL*/

   /*Add attributes to Schema*/
   &EnvNode = &SOAPDoc.EnvelopeNode;
   &EnvNode.AddAttribute("xmlns:soapenv", "http://schemas.xmlsoap.org/soap/envelope/");
   &EnvNode.AddAttribute("xmlns:inf", "http://www.ABC.com/");
 
   /*Add Soap Header*/
   &SOAPDoc.AddHeader();

   /*Add Soap Body*/
   &SOAPDoc.AddBody(); /* optional */

   /*Add first method inf:Method*/
   /*1 is for Request, 0 is for Response.*/
   &SOAPDoc.AddMethod("inf:Method", 1); /* required */

   /*Add Child Nodes*/
   &xmln = &SOAPDoc.MethodNode.AddElement("inf:Request");
   /*Add Elements - Element1, Element2*/
   &Element1= &xmln.AddElement("Element1");
   &Element1.NodeValue = "123456"; /*Hardcoded will use setup page to retreive data*/

   &Element2= &xmln.AddElement("Element2");
   &Element2.NodeValue = "test2"; /*Hardcoded will use setup page to retreive data*/

   rem &SOAPDoc.AddMethod("inf:Request", 1); /* required */
   rem &SOAPDoc.AddParm("Element1", "123456");
   rem &SOAPDoc.AddParm("Element2", "test2");
 
   &lxmlDoc = CreateXmlDoc(&SOAPDoc.GenXmlString());
 
   /* Validate the message */
   rem &OK = &SOAPDoc.ValidateSOAPDoc();
 
   /*Create message and Generate XML*/
   &lmsgGoRequest = CreateMessage(Operation.TEST_IB);
   &lmsgGoRequest.SetXmlDoc(&lxmlDoc);
 
   /* Send the Request */
   &Response = %IntBroker.SyncRequest(&lmsgGoRequest);
 
   &responseXMLDoc = &Response.GetXmlDoc();
 
   Return &Response;
 
end-method;

method OnError
   /+ &_MSG as Message +/
   /+ Returns String +/
   /+ Extends/implements PS_PT:Integration:IRequestHandler.OnError +/
 
   Return &_MSG.IBException.DefaultText;
end-method;