Nov 22, 2008

back to basics

We wanted to extend the Dutch localization so that the mandatory assignment extra info fields where defaulted automatically when entering a new employee.

First step was to cook up some plsql, based on api's, that creates the assignment extra infos. Easy.

Now we only need to fire that code when they create a new employee.

So a user hook would be nice, but since the assignment screen is still not using an api, that was not an option.

Ok, so let's go dynamic triggers, which in this case corresponds to a real database trigger.

Oops, mutating table errors. Oops, cannot perform rollback/commit in a trigger (hidden in the api calls).

Ok, so let's transform the original piece of plsql into an autonomous transaction.

Oops, no data found. Sure, since it operates as a separate transaction, it does not yet sees the assignment that fired the trigger.

Finally we changed the dynamic trigger into an Update trigger, and pieces felt together.

Nov 12, 2008

Apps doesn't like the Apex datepicker

The default DatePicker of Apex was throwing a security error when we were testing our Apex application. We had to pass a user/password for a call on the wwv_flow_utilities package.

Just registering that package as secure plsql as System Administrator in Apps solved the issue (table: fnd_enabled_plsql).

But when we changed the month in the DatePicker, the same error popped up again.

Seems Apex adds the schema name to the package call, and as such the secured plsql scan can not handle the call.

So we were forced to go for a custom DatePicker.

A pity we can not wait for Apex 4.0 were jQuery will be included by default. Demostuff.

Nov 8, 2008

Use the Organization on the User's Assignment(s) as the Top Oganization

We ran in a small HR security issue, where it seems that future hires are not visible for a manager, when using a security profile that lists all employees in and under the manager's organization.

When digging into the Oracle code, we understood why.

Please enjoy the comments and the trunc( sysdate) piece of magic, found in the hr_security_internal package.

FUNCTION get_effective_date RETURN DATE
IS
BEGIN
--
-- Default the effective date to sysdate. This could potentially
-- be used in the future to set the effective date to the
-- date-track effective date, but as it stands now, security
-- is also determined as of sysdate.
--


RETURN trunc(sysdate);

END get_effective_date;