Archive for January, 2016


Using “If Loop” in XML Publisher reporting

Usually conditional loops are used in any programming language.

Below is an example to control a message on RTF template based XML Publisher report using IF Loop.

Author is trying to display a message if there are no rows to be displayed on report.

Example:

<?xdoxslt:ifelse(number(@rownumber)!=0,’’,’There are no data’)?>

Enjoy for the day!

Advertisements

People Code to Update or Insert values to a record

People Code to Update or Insert values to a record

&Rec = CreateRecord(Record.ABC_JOB);

&Rec.EMPLID.Value = “1”; /*Assign values to all Key fields*/
&result = &Rec.SelectByKey();
&Rec.STATUS.Value = “Active”;
If &result Then
&Rec.update();
Else
&Rec.Insert();
End-if;

PeopleCode With Yes No Message Box On Page

There might be a requirement where we need to perform some action based on return value of Message Box.

For example: Save the component after user confirms by clicking Yes.

We can use below PeopleCode in Field Change Event.
&Answer = MessageBox(4, “”, 0, 0, “Please confirm if you want to Save”);
If &Answer = 6 Then
DoSave();
Else
End-If;

&Answer = 6 for response of “Yes”

&Answer = 7 for response of “No”