How to use substring in PeopleCode
How to use substring in PeopleCode of each requirement. I have requirement select data from a parameter in a page that contains EMPLID, RC code and year. After user input parameter then retrieves data in grid or scroll area. I using this below PeopleCode.
If %page =’PAGE_NAME’ then
if all(recordname.emplid) then
&wheretxt = &wheretxt | “and emplid = ” | Quote(recordname.emplid);
end-if;
if all(recordname.RC_CODE) then
&wheretxt = &wheretxt | “and RC_CODE= ” | Quote(recordname.RC_CODE);
end-if;
if all(recordname.YEAR) then
&wheretxt = &wheretxt | “and YEAR= ” | Quote(recordname.YEAR);
end-if;
if all(&wheretxt ) then
&wheretxt = Substring(&wheretxt, 4, Len(&wheretxt));
&wheretxt = ” where ” | &wheretxt;
rem WinMessage(&wheretxt, 1);
end-if;
ScrollFlush(Record.recordname);
ScrollSelect(1, Scroll.recordname, Record.recordname, &wheretxt);
SortScroll(1, Record.recordname, recordname.EMPLID, “A”);
end-if;