You are on page 1of 8

===================================================

INCREMENTAR UN ID

Se ingresa en el pre-insert de cada bloque


Proceso: incrementar_id;

PROCEDURE incrementar_id IS
BEGIN
select max(employees.employee_id)+1
into :employees.employee_id
from employees;
END;

====================================================
CARGAR COMBO-BOX Y SE ASIGNE UN VALOR A CADA ITEM

1. Al text item le cambio por list item


2. Required no
3. En propiedades, Functional, Elements in List.
4. Asignar los valores.

====================================================

CREAR UN CAMPO QUE CALCULE UNA SUMA O FUNCION


1. En el bloque, propiedades, asignar yes en Precompute
Summeries

====================================================

ASIGNAR MSCARAS A LOS NMEROS


1. Data type: Numbre
2. Maximum length: 30
3. Format mask: 9999.9990
4. Lowest Allowed Value: 0
5. Highest Allowed Value: 3000

====================================================
ASIGNAR UN VALOR POR DEFECTO
1. :EMPLOYEES.EMAIL:='dddd@ddd.com';
2. Esto va en when-create-record

====================================================
CREAR COMBO BOX

1. Crear record group(ejemplo de query):

select emp.first_name,to_char(emp.employee_id)
from employees emp

2. Proceso

PROCEDURE LLENAR_MANAGER
IS
v_grupo varchar2(50);
BEGIN
v_grupo:=populate_group('MANAGER_LISTA');

if v_grupo<>'0' then
message('No se realizo la consulta de la lista departamentos');
else

populate_list('EMPLOYEES.MANAGER_ID','MANAGER_LISTA');
end if;
END;

3. Llamar en el when-new-form-instance

====================================================
LLAMAR UNA LISTA

1. Filter Before Display: NO


2. Los otros tenemos que poner SI
3. A nivel de item when-double-click

Llamar al proceso click_lista;

PROCEDURE click_lista IS

v_lista boolean;
begin
v_lista:=show_lov('nombre_lista');
END;

====================================================
MULTIEMPRESA

1. Esto va en el when-new-form-instance
DEFAULT_VALUE(null,'GLOBAL.CODIGO_EMP');
If :GLOBAL.CODIGO_EMP is not null then
:global.sumar:=0;
llenar_tpago;
llenar_sucursal;
execute_query;
ELSE
alerta('Debe logearse antes de realizar
cambios');
End If;

LIBRERA CON PROCEDIMIENTO PARA HABILITAR O


DESHABILITAR UN CAMPO
1. Procedimiento de la librera
PROCEDURE es_visible (p_item varchar2,p_status number)
IS
BEGIN
if p_status=1 then
set_item_property(p_item,visible,property_true);
set_item_property(p_item,enabled,property_true);
set_item_property(p_item,update_allowed,property_true);
set_item_property(p_item,insert_allowed,property_true);
else
set_item_property(p_item,visible,property_false);
end if;
END;
2. Esto es para llamar al proceso (PRE-RECORD)

if :TU_PASANTIA.EST_ID=3 then
es_visible('TU_PASANTIA.DOC_ID',1); --se habilita
else
es_visible('TU_PASANTIA.DOC_ID',0); --se deshabilita
end if;

MOSTRAR UN ITEM QUE ESTA FUERA DE LA BASE


1. Por ejemplo dado el id consulta el nombre
PROCEDURE consultar_cargo
IS
cursor primary_cur is select job_title from HR.JOBS
where JOB_ID = :EMPLOYEES.JOB_ID;
primary_dummy char(1);
v_lista boolean;
begin
if ( ( :EMPLOYEES.JOB_ID is not null ) ) then
open primary_cur;
fetch primary_cur into :employees.job_name;
if ( not primary_cur%found ) then
message('Cargo no existe. Ver lista de valores');
v_lista:=show_lov('lista_cargos');
close primary_cur;
raise form_trigger_failure;
end if;
close primary_cur;
end if;
end;

BOTON ACEPTAR

commit;
exit_form;
====================================================
BOTON APLICAR
commit;
====================================================
BOTON CANCELAR
exit_form;
====================================================
ALERTAS
begin
if :employees.job_id like 'SA%' then
if :employees.salary > 20000 then
--v_boton:=show_alert('ganar_20000');
alerta('si el empleado es vendedor no puede ganar
mas de 20000');
raise form_trigger_failure;
end if;
if nvl(:employees.commission_pct,0)=0 then
--v_boton2:=show_alert('comision');
alerta('si el empleado es vendedor debe
tener una comision');
raise form_trigger_failure;
end if;
end if;
end;

====================================================
REPORTES
1. Agrupar arriba(Group above): Departamentos y empleados

Select d.department_name,e.last_name,e.salary
from departments d,employees e
where d.department_id=e.department_id

- Group fields(Agrupamos por departamento):


d.department_name
- Display fields: mandar todo los campos.
- Totals(resumen): salary

2. Matriz with group

select
e.emp_nombre_comercial,pe.per_nombre,pd.per_nombre,p.pas_du
racion
from tu_pasantia p,tu_estudiante es,tu_docente d,tu_empresa
e,tu_persona pe,tu_persona pd
where pe.per_id=es.est_id
and pd.per_id=d.doc_id

3. Reporte con parmetros

select *
from employees e
where e.department_id=:dno_parameter;

You might also like