Showing posts with label Component. Show all posts
Showing posts with label Component. Show all posts

Tuesday, 4 February 2014

DoSaveNow() saves and SetReEdit(True) nets the rebound

Recently I had a problem with DoSaveNow() not doing what it said on the tin and actually saving a component. Initially this was worked around by using CommitWork() instead, but ultimately this stopped working as well.

The solution was to use SetReEdit prior to doing the save. e.g.

SetReEdit(True);
DoSaveNow();

Set ReEdit switches re-edit mode on and off. When it is on, definitional edits (such as translate table and prompt table edits), as well as FieldEdit PeopleCode, are run on each editable field in the component when the component is saved.Whey the DoSaveNow failed to save without it and why it succeeded with it, I haven't got a Scooby's. But as it sorted out my save issue and stopped me swearing at the screen, I'm no complaining!

It only works.

Tuesday, 7 September 2010

Finding a component in the Portal

The following SQL allows you to avoid the usual dog and pony chase when trying to find where a component is located in the PeopleSoft Portal.

SELECT --P.PORTAL_NAME,
--P.PORTAL_REFTYPE,
--P.PORTAL_OBJNAME,
A.*,
P.PORTAL_LABEL,
R.PATH,
P.PORTAL_URLTEXT
FROM
(
SELECT DISTINCT
U.ROLEUSER ,
C.MENUNAME ,
C.PNLGRPNAME,
C.MARKET
FROM PSROLEUSER U
JOIN PSROLECLASS A
ON A.ROLENAME = U.ROLENAME
JOIN PSAUTHITEM B
ON B.CLASSID = A.CLASSID
JOIN PSMENUITEM C
ON C.MENUNAME = B.MENUNAME
AND C.BARNAME = B.BARNAME
AND C.ITEMNAME = B.BARITEMNAME
) A
JOIN PSPRSMDEFN P
ON P.PORTAL_URI_SEG1 = A.MENUNAME
AND P.PORTAL_URI_SEG2 = A.PNLGRPNAME
AND P.PORTAL_URI_SEG3 = A.MARKET
JOIN
(
SELECT CONNECT_BY_ROOT(PORTAL_NAME) ROOT_NAME,
CONNECT_BY_ROOT(PORTAL_REFTYPE) ROOT_REFTYPE,
CONNECT_BY_ROOT(PORTAL_OBJNAME) ROOT_OBJNAME,
PORTAL_OBJNAME,
RTRIM(REVERSE(SYS_CONNECT_BY_PATH(REVERSE(PORTAL_LABEL),' > ')),' > ') PATH
FROM PSPRSMDEFN
CONNECT
BY NOCYCLE PRIOR PORTAL_NAME = PORTAL_NAME
AND PRIOR PORTAL_PRNTOBJNAME = PORTAL_OBJNAME
) R
ON R.ROOT_NAME = P.PORTAL_NAME
AND R.ROOT_REFTYPE = P.PORTAL_REFTYPE
AND R.ROOT_OBJNAME = P.PORTAL_OBJNAME
WHERE A.ROLEUSER = 'username'
AND P.PORTAL_NAME = 'EMPLOYEE'
AND P.PORTAL_REFTYPE = 'C'
AND R.PORTAL_OBJNAME = 'PORTAL_ROOT_OBJECT'
AND A.PNLGRPNAME = 'component'

Thanks to Rob for this one.