Tuesday, 19 January 2021

Dynamic View : “An error has occurred which requires that this page be cancelled. (15,4) A previous error message has been displayed showing an error from which the component processor cannot recover.

 


On selection of a value from dynamic view as a prompt table , we usually face the following error .


An error has occurred which requires that this page be cancelled. (15,4) A previous error message has been displayed showing an error from which the component processor cannot recover.


one of the reason which causes this error is to have two or more table join in SqlText as system is dynamically added the condition of order by clause  without alias the column properly and basically column ambiguity cause this error .


Solution : 

1.    create a view in SqlText

2.  Use   ExpandSqlBinds(FetchSQL(), );


&acad_career= XMD_PROG_PLAN_V.ACAD_CAREER.Value;

&START_DT = XMD_PROG_PLAN_V.FROMDATE.Value;

&END_DT= XMD_PROG_PLAN_V.END_DATE.Value;

&acad_group= XMD_PROG_PLAN_V.ACAD_GROUP.Value;

&lvl= XMD_PROG_PLAN_V.ACADEMIC_LEVEL.Value;

 L_ADD_MAJOR_2.ACAD_PLAN.SqlText = ExpandSqlBinds(FetchSQL(SQL.L_PLAN_SQL), &START_DT, &END_DT, &acad_group, &acad_career, &lvl);





Tuesday, 12 January 2021

Unable to change label properties of push button/hyperlink in Application Designer

 

 Go to the Configuration Manager, then go to Client Setup tab, then check the “Install Workstation” checkbox, click OK or Apply.




Wednesday, 23 December 2020

Populate Dynamic Drop down using peoplecode

 

&FLD = GetRecord(Record.X_VERIFY_WRK).GetField(Field.STRM);

&FLD.ClearDropDownList();



&SQL = CreateSQL("select distinct  a.strm , b.descr  from  PS_STDNT_enrl a, ps_term_tbl b where a.strm=b.strm  and a.emplid =:1", %EmployeeId);

While &SQL.Fetch(&strm, &descr)

   &FLD.AddDropDownItem(&strm, &descr);

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

End-While;

Build your where clause based on the Level 0 Work record fields

 &id = X_TSCRPT_WRK.EMPLID.Value;

&rqst_id = X_TSCRPT_WRK.REPORT_REQUEST_NBR.Value;

rem &sbdt = X_TSCRPT_WRK.SUBMITTED_DT.Value;

&nid = X_TSCRPT_WRK.NATIONAL_ID.Value;

&status = X_TSCRPT_WRK.X_DELIVERY_STATUS.Value;


&WHERE_CLAUSE = " ";

ScrollFlush(Record.X_TRANS_REQ_VW);

If All(&id) Then

   

   &WHERE_CLAUSE = &WHERE_CLAUSE | " EMPLID = '" | &id | "'";

End-If;

If All(&rqst_id) Then

   If All(&WHERE_CLAUSE) Then

      &WHERE_CLAUSE = &WHERE_CLAUSE | " AND " | "REPORT_REQUEST_NBR = '" | &rqst_id | "'";

   Else

      &WHERE_CLAUSE = &WHERE_CLAUSE | " REPORT_REQUEST_NBR = '" | &rqst_id | "'";

   End-If;

End-If;



If All(&nid) Then

   If All(&WHERE_CLAUSE) Then

      &WHERE_CLAUSE = &WHERE_CLAUSE | " AND " | "NATIONAL_ID = '" | &nid | "'";

   Else

      &WHERE_CLAUSE = &WHERE_CLAUSE | " NATIONAL_ID = '" | &nid | "'";

   End-If;

End-If;


If All(&status) Then

   If All(&WHERE_CLAUSE) Then

      &WHERE_CLAUSE = &WHERE_CLAUSE | " AND " | "X_DELIVERY_STATUS = '" | &status | "'";

   Else

      &WHERE_CLAUSE = &WHERE_CLAUSE | " X_DELIVERY_STATUS = '" | &status | "'";

   End-If;

End-If;




If All(X_TSCRPT_WRK.DATE_TO.Value, X_TSCRPT_WRK.DATE_FROM.Value) Then

   If All(&WHERE_CLAUSE) Then

      &WHERE_CLAUSE = &WHERE_CLAUSE | " AND " | "SUBMITTED_DT  between " | Quote(X_TSCRPT_WRK.DATE_FROM.Value) | " AND " | Quote(X_TSCRPT_WRK.DATE_TO.Value);

   Else

      &WHERE_CLAUSE = &WHERE_CLAUSE | "SUBMITTED_DT  between " | Quote(X_TSCRPT_WRK.DATE_FROM.Value) | " AND " | Quote(X_TSCRPT_WRK.DATE_TO.Value);

      

      

   End-If;

End-If;



If All(&WHERE_CLAUSE) Then

   &WHERE_CLAUSE = "WHERE " | &WHERE_CLAUSE;

End-If;

ScrollSelect(1, Record.X_TRANS_REQ_VW, Record.X_TRANS_REQ_VW, &WHERE_CLAUSE);


Generate BI Report from a page using People code

 import PSXP_RPTDEFNMANAGER:*;


&LanguageCd = "ENG";

&AsOfDate = %Date;

&OutFormat = "PDF";

&MyReportName = "ENRL_VERIFY";

&MyTemplate = "ENRL_VERIFY";


Local PSXP_RPTDEFNMANAGER:ReportDefn &oReportDefn = create PSXP_RPTDEFNMANAGER:ReportDefn(&MyReportName);


&oReportDefn.Get();

Local Record &rcdQryPrompts, &RC1;


&rcdQryPrompts = &oReportDefn.GetPSQueryPromptRecord();

If Not &rcdQryPrompts = Null Then

   

   &oReportDefn.SetPSQueryPromptRecord(&rcdQryPrompts);

   &rcdQryPrompts.EMPLID.Value = X_VERIFY_WRK.EMPLID.Value;

   &rcdQryPrompts.INSTITUTION.Value = X_VERIFY_WRK.INSTITUTION.Value;

   

   

   &rcdQryPrompts.ACAD_CAREER.Value = X_VERIFY_WRK.ACAD_CAREER.Value;

   

   &rcdQryPrompts.STRM.Value = X_VERIFY_WRK.STRM.Value;

   

   

   

   

End-If;



SQLExec("select TMPLDEFN_ID from PSXPRPTTMPL_VW where REPORT_DEFN_ID =:1 and LANGUAGE_CD =:2", &oReportDefn, &LanguageCd, &TemplateID);




&oReportDefn.ProcessReport(&TemplateID, &LanguageCd, &AsOfDate, &OutFormat);

CommitWork();

If All(X_VERIFY_WRK.STRM.Value) Then

   

   &oReportDefn.DisplayOutput();

Else

   Error MessageBox(0, "", 0, 0, "Please select a term from the list ");

End-If;


Sunday, 10 March 2019

Peoplecode to check if field contains spaces or punctuation


If All(PTSF_SRCH_ENGN.PTSF_SRCH_ENG_INS.Value) Then
   &Name = PTSF_SRCH_ENGN.PTSF_SRCH_ENG_INS.Value;
   &I = 1;
   If IsAlphaNumeric(&Name) = False Then
      While &I <= Len(&Name)
         /* Test to see if failure is because of _ or - or not*/
         &testchar = Substring(&Name, &I, 1);
         If (IsAlphaNumeric(&testchar) = True) Or
               (&testchar = "_") Or
               (&testchar = "-") Then;
            &I = &I + 1;
         Else
            Error (MsgGetText(78, 33, "no spaces or punctuation are allowed"));
            &I = Len(&Name);
            Break;
         End-If;
      End-While;
   Else
      /* test for number in first position*/
      &testnumberpos1 = Substring(&Name, 1, 1);
      If IsDigits(&testnumberpos1) = True Then
         Error (MsgGetText(78, 33, "no spaces or punctuation are allowed"));
         &I = Len(&Name);
      End-If;
   End-If;
End-If;

Tuesday, 12 February 2019

Flush data from Component Buffer in a Grid




In my case , I am flushing the grid data on field change of Qualification field

Local Rowset &Xlat;

/* --- Flush Elective Grid on Qualification Field Change --- */

&Xlat = GetRowset(Scroll.X_ELECTIVE_INFO);


&Xlat.Flush();