As you can see from the picture below, I have prevented the Xlat value of "BUSN" to appear in the dropdown list although it is an active value on the Email Type Field. See the PeoleCode below to accomplish such a task.
/*Ensure that user is not able to add a business email address from self service */ /*Get Xlat field name */ /*We will not allow "BUSN"*/ For &i = 1 To &data.ActiveRowCount; For &K = 1 To &xlat.ActiveRowCount
Local Rowset &RSL0 = GetLevel0();
Local Rowset &data = &RSL0(1).GetRowset(Scroll.EMAIL_ADDRESSES);Local Rowset &xlat = CreateRowset(Record.PSXLATITEM);
Local string &xlat_field = "E_ADDR_TYPE";
Local string &invalid_addr_type = "BUSN";
If %IsMultiLanguageEnabled And
%Language <> %Language_Base Then
&xlat.Fill("WHERE FIELDNAME = :1 AND FIELDVALUE <> :2 AND EFFDT = (SELECT MAX(EFFDT) FROM PSXLATITEMLANG B WHERE B.FIELDNAME =:3 AND EFFDT <= %CURRENTDATEIN) AND LANGUAGE_CD =:4", &xlat_field, &invalid_addr_type, &xlat_field, %Language);
Else
&xlat.Fill("WHERE FIELDNAME = :1 AND FIELDVALUE <> :2 AND EFFDT = (SELECT MAX(EFFDT) FROM PSXLATITEM B WHERE B.FIELDNAME =:3 AND EFFDT <= %CURRENTDATEIN)", &xlat_field, &invalid_addr_type, &xlat_field);
End-If;
If &data(&i).EMAIL_ADDRESSES.E_ADDR_TYPE.Value <> "BUSN" Or
None(&data(&i).EMAIL_ADDRESSES.E_ADDR_TYPE.Value) Then
&data(&i).EMAIL_ADDRESSES.E_ADDR_TYPE.ClearDropDownList();
&data(&i).EMAIL_ADDRESSES.E_ADDR_TYPE.AddDropDownItem(&xlat(&K).PSXLATITEM.FIELDVALUE.Value, &xlat(&K).PSXLATITEM.XLATLONGNAME.Value);
End-For;
End-If;
End-For;
Title | Under | Posted on |
---|---|---|
Component interface Error: no rows exist for the specified keys | PeopleSoft Technical | 03/15/2019 - 3:54am |
ADD 24 months starting from current month.(peoplesoft) | PeopleSoft Functional | 07/29/2018 - 8:44pm |
TRC values dropdown | PeopleSoft Technical | 04/04/2018 - 12:54am |
how to find missing sequence in GRID and print the mising sequence number while saving through peoplecode | PeopleSoft Technical | 09/11/2017 - 4:49am |
Comments
Very usefull code, the only thing I'd add is:
In "&xlat.Fill ..." you should add FIELDVALUE as criteria, as you might have different effective dates for your xlat values.
Below the code illustrating my comment. This code is put in the searchinit so some users don't see all values:
Local Rowset &xlat = CreateRowset(Record.PSXLATITEM);
&Permission_list = %PermissionLists;
&PL = &Permission_list.Find("PERM_1");
If None(&PL) Then
&PL = &Permission_list.Find("PERM_2");
End-If;
If None(&PL) Then
&FLD = GetField(Field.FIELD_A);
&FLD.ClearDropDownList();
&fld_name = "FIELD_A";
&fld_v1 = "A";
&fld_v2 = "B";
&fld_v3 = "C";
&xlat.Fill("WHERE FILL.FIELDNAME = :1 AND FILL.FIELDVALUE not in (:2,:3,:4) AND FILL.EFFDT = (SELECT MAX(B.EFFDT) FROM PSXLATITEM B WHERE B.FIELDNAME =:1 AND B.FIELDVALUE = FILL.FIELDVALUE and B.EFFDT <= %CURRENTDATEIN)", &fld_name, &fld_v1, &fld_v2, &fld_v3);
For &i = 1 To &xlat.ActiveRowCount
&FLD.AddDropDownItem(&xlat(&i).PSXLATITEM.FIELDVALUE.Value, &xlat(&i).PSXLATITEM.XLATLONGNAME.Value);
End-For;
End-If;
Since a few pieces of machinery for our new control system weren’t available locally, we were forced to get them ordered from outside. We were in a bit of a rush too, so we decided to go with mforwarding.com. From then on, we haven’t looked back and use them extensively for any and all of our parcel needs. – Raymond
Howdy I am called Ana, greetings from Geneve, I made such a different topic to get your attention.............
Such extraordinary writting like yours has to be valued so no need for thanks....
I write pages in several pages and that is what I´m making at this time, lol!:) and it was part of the reason I visited on this page...to seek for ideas to my website
II am very found of reading as well as fishing, and I also enjoy a lot Radiohead, my greatest hobbie at the time is poker, like many of you...I imagine....as well as board games.
I forgot to tell, I was born In Panama there it comes my critical behaviour...lol
I always like to finish my topics with something like this, as the the poet once said "We shouldn’t let a sour hour lower our power"
Just a little waring you should put anothers social network pluggins on your website, like facebook, this has been a perfect tool to get away from google panda 1.6, thas has been driving webmasters crazy, they are every time telling to write quality conten , by the way what is quality to Google staff ???
Good afternoon to everybody, Bye