The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.

Monday, 1 December 2014

Controlling Component Save Processing

I was recently working upon an issue where the PeopleCode changes bring upon the Save Warning message and which goes into loop even if the component is saved. I was researching on various options to turn off the Save Warning. I found a couple of methods and properties which controls or depends on the component save flag. Thought of documenting everything together so that people having similar issue could read the related methods and properties in a single place.

Before I go ahead, I may have to explain how the Save Warning is issued for a component. Whenever a component is loaded, the Component Processer holds a flag value which will store whether the component is changed or not. This flag is set whenever the user changes the value of a field on the online page or when the value of a field is changed via PeopleCode logic. Having this flag value, whenever user attempts to navigate away from the component, the Component Processor will check this flag and if its value is set then a Save Warning is issued otherwise it logs out of the component. The value of this particular flag is reset after every insert into the database (after Save Pre Change) which will prevent the warning when the user has already saved the component. However a code in your Save Post Change could set the flag again.
Now let us discuss about some of the functions and properties which could be potentially helpful in tackling the Save Warning issues in PeopleSoft.

ComponentChanged() – This function will return a Boolean value based on if the component was changed after last save. You could use this function to determine the component level flag value which we discussed earlier and based on that you could write your logic.

Eg: 
If ComponentChanged() Then
Rem Write your logic here;
WinMessage(“Your Message Text”,0);
Else
Transfer(….);
End-If;

SetComponentChanged() – You can use this function to set the component level flag programmatically. Sometimes it may be required that even if the user has not changed any value on the page, when he/she clicks a button on the page the system needs to do the save processing. This is the function which could help you do this. This will initiate the Save Warning or Save Processing even if nothing has changed in the component.

Eg: 
Rem Initiate Save Processing;
SetComponentChanged();
DoSaveNow();

SetSaveWarningFilter() – Use this function to supress the Save Warning irrespective of whether the component level flag is set or not. If you use this function the component processor will ignore the component level flag value and let the user to navigate away from the component without issuing any Save Warning. This function takes a Boolean value as argument. Passing True will direct the component processor to ignore the flag whereas passing an argument of False will make the component behave in its normal way.

Eg: 
REM changing the field value of DESCR;
&myRec.DESCR.Value = “My Description”;
SetSaveWarningFilter(True);
REM Now the system will not issue Save Warning to the User;
REM To bring back the warning call the same function with parameter False;

Set Component Changed (Page Field Property) – Sometimes, for certain fields, even if the user changes some value on the online page we may not require to initiate the Save Processing or issue the Save Warning. This page field level property comes handy in those scenarios.

Set Component Changed property of page field


This property can be found in the Use tab of the page field property. This will determine if the component flag needs to be set when the user changes the value of the field. This property determines the behavior only for user intervention and does not govern the PeopleCode changes.

Disable Saving Page (Component property) – If the entire purpose of the component you have designed is to just display information or to act as an intermediate component, then you can use this property to avoid the Save warning. This property can be found on the Use tab of the component.


Disable Saving Page component property


Checking this field will hide the save button from the component and will suppress the save warning. If you want to permanently suppress the Save Warning for the entire component this is the best option to choose as it provides the mechanism to achieve the objective with minimal impact.

IsChanged Property – This property is available for the objects Field, Record and Row. This property will return a Boolean value indicating whether the object has changed or not. This property will be helpful in doing some special processing for which you need to dynamically know which object has changed.

Eg:
Local Number &I;
&I = 1;
Rem Loop through the record to find out the changed field;
For &I = 1 To &myRecord.FieldCount
If &myRecord.GetField(&i).IsChanged Then
Rem Custom Logic;
End-If;
End-For;

SetComponentChanged (Property) – This property is read-write and is available in both Field and Rowset Level. Setting this value to True indicates the component processor that any change to the Field/Rowset using a PeopleCode will set the component save flag and the Save Warning needs to be issued. A value of False will not set the component changed flag when the Field/Rowset value is changed using a PeopleCode. The example provided below will illustrate the use of the property where a value of a field is changed programmatically without requiring/ initiating a Save Warning.

Eg:
REM Change the field DESCR without requiring a user Save;
&myRec.DESCR.SetComponentChanged = False;
&myRec.DESCR.Value = “New Description”;
REM Re-set the property so that a change to the field made by the user prompts a save;
&myRec.DESCR.SetComponentChanged = True;




Tuesday, 15 July 2014

People Tools 8.54 is available with lot more capabilities


People Tools 8.54 is now generally available for the customers. Oracle has released its landmark release of People Tools (version 8.54) on 11th July 2014.

With the release 8.54, PeopleSoft is bringing in fluid UI capabilities which could render on any devices and specifically targeted for mobile devices. There are many improvements and capabilities in reporting features available with the newest release.

For new implementation the tools 8.54 is ready to use and for upgrade customers, they may have to wait until patch 02 is available.

Apart from the major fluid UI capability, PeopleSoft has brought up improvements in the below mentioned functional areas.
Branding Framework
Activity Guides
Related Content/Actions
Search
Introduced Global Temporary Tables
Materialized Views
Meta SQLs
PS Query
Pivot Grids
BI Publisher
nVision
Application Designer Capabilities

To see what has improved over your current version of People Tools, visit Oracles Cumulative Feature Overview site.

Watch interview with Willie Suh, Vice President of PeopleTools Development, for more information on fluid UI.

Tuesday, 17 June 2014

Currency Control Fields in PeopleSoft

People working in Financials or Money related modules in PeopleSoft might come across situations where they need to format the amounts to the format which is more common to the transaction currency used. This might seem to be a simple task if you are always working in same currency say USD. The amounts can be formatted using PeopleCode or other methods to display in the format which is required for your client (eg. 98.53 USD). But the situation become little complicated if you are working for a firm where the PeopleSoft is implemented globally and you have many multi currency transactions. In that case, formatting the field using PeopleCode for each and every currency using an IF or Evaluate logic will become pretty cumbersome.

PeopleSoft has provided a much simpler mechanism to do the same without writing any PeopleCode. This is called as currency control field.
 
Currency Control Field in PeopleSoft
Fig 1. Record Field Properties - Currency Control Field

This property can be found on the record field property. To make this work, you should be having a field which stores the currency code (usually CURRENCY_CD field) in the same record and the multicurrency option set in the application level. Once you have the field and options set, just mention the field name which contains the currency code in the Currency Control Field option in the record field property. Setting this option will automatically take care of the currency symbol, decimal digits and the scale of the number field. This helps you avoid a lot many PeopleCode. I know this is an obvious fact for those working in financials, but may be of a lot more help to the newbie’s.

As I mentioned earlier, you might need a field in the record which contains the currency code for the corresponding amount. What if you don’t have that field and you are arriving at the amount dynamically. PeopleSoft has again extended a little bit of help in this regard with a built in function called RoundCurrencyRoundCurrency function will return the amount with decimal precision formatted to the currency code passed. The syntax of the function is as shown below.
RoundCurrency(amount,currency code,effective date);

/* The below example will return the currency in AUD format effective today. */
/* Instead of hard coding the currency, you can pass dynamic values in real scenarios. */

LEDGER.AMOUNT.Value = RoundCurrency(AP_AMOUNTS_WRK.AMOUNT.Value,”AUD”,%Date);



Followers