Tuesday, September 30, 2008

Annoying Visual Studio Behavior (Auto format stops working)

Of late I have had this annoying thing happen to my Visual Studio 2005 environment where it stops formatting my code for me. So would call me lazy… J I am… I had tried resetting the environment to be a Visual Basic Env etc… etc… nothing worked.

 

To fix it I found a link to an MSDN forum:

 

http://social.msdn.microsoft.com/Forums/en-US/csharpide/thread/870c32f4-464b-4701-986a-290fc996a570/

 

 

Short Version:

Reset the environment completely…

 

AdamPe States:

“You need the /resetuserdata Switch

1.       Shut down all instances of Visual Studio 2005.

2.       Click Start, the choose Run....

3.       Type "devenv.exe /resetuserdata".

Easy when you know how!!”

More details here:
http://msdn2.microsoft.com/en-us/library/bb245788(vs.80).aspx

 

Tuesday, September 23, 2008

Frustrating CI Issue PSBusComp error

I've been having an issue when connecting to a CI (peopleTools 8.49.11) in that as I start working with a component and iterating through data to dump in, there seems to be a point where the OS kills the process that I am using.

Here is what I am doing:

Pulling the rows to insert directly from the DB
Connecting to a CI via JSL to the App server
Start the Loop to pump the data in
The first rows go in well
The the App server kills the run after 1 or two rows
Session is reset

I have interactive mode off, get and edit history are also off.
It seems to be specific to this component, or component type (the size?). Our Admins tell me it is a segmentation falt and the process is killed by the OS. Thanks Mr. OS! :)

There doesn't seem to be any Cobol or really intensive people code. Technically this shouldn't matter as interactive mode is turned off and I don't get to the point of saving, so it should be triggered.

I don't know if it matters, but I am going to check to see if 'Expert Entry' is enabled on the user that is connecting to the app server.

More to come....

Thursday, September 18, 2008

Using PL/SQL to Grant Permissions to Role(s) or Person(s)

When you have a large DB and it goes through an upgrade and _ALL_ the views have to be rebuild, that means that any/all permissions / Grants to those views are gone! (*sigh*) To quickly replace the permissions here is a little PL/SQL annonymous block to pull the view names, and grant permissions. Obviously this could be a lot intellegent and flexable, but here is the idea.

DECLARE
CURSOR myviews
IS
SELECT view_name
FROM SYS.user_views
WHERE view_name LIKE '%A_Z%';
BEGIN
FOR x IN myviews
LOOP
BEGIN
EXECUTE IMMEDIATE 'GRANT SELECT ON ' x.view_name ' TO COOL_PROGRAMMER';
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line ( 'GRANT SELECT ON SYSADM.'
x.view_name
' TO COOL_PROGRAMMER; '
SQLERRM
);
END;
END LOOP;
END;

PeopleSoft: Stop Save of a page from PeopleCode

For some reason I had an issue figuring out how to stop the saving of a page… Then I was doing something completely unrelated and said, “DUH!!!”

 

To stop a save during validation in PeopleCode throw an error… Use only in the SaveEdit event. Don’t use it in FieldDefault, FieldFormula, RowInit, FieldChange, Prepopup, RowInsert, SavePreChange, or SavePostChange

 

Error  “Some String”;

 

You can use the MsgGet, MsgGetText functions too, if you add your own entries to the catalog.

 

PeopleCode: Change Options in a Drop down List

In PeopleSoft it is “easy” to change the drop down list options on Row-init …

This is from a co-worker. Used to change the options that students see for attendance (for specific class type)

If …… Then

/* Clear the current dropdown
values */
CLASS_ATTENDNCE.ATTEND_REASON.ClearDropDownList();
CLASS_ATTENDNCE.ATTEND_REASON.AddDropDownItem("ALCT", "Allowed
Cut"); CLASS_ATTENDNCE.ATTEND_REASON.AddDropDownItem("CANC",
"Cancelled"); CLASS_ATTENDNCE.ATTEND_REASON.AddDropDownItem("OTHR",
"Absent Other");
CLASS_ATTENDNCE.ATTEND_REASON.AddDropDownItem("PRES", "Present");
CLASS_ATTENDNCE.ATTEND_REASON.AddDropDownItem("SECT", "Second Cut");
CLASS_ATTENDNCE.ATTEND_REASON.AddDropDownItem("SICK", "Sick");

End-If;

Add to Google