• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2317
  • Last Modified:

ORACLE FORMS

There is a form and in that form some patient_id's do not have a assigned_id. But if I go to that table (from where this field comes from) and do a filter on assigned_id is null, then it does not return any records.. So the person who has developed the form has done it is some way that i do not understand.. Can you please help me figure out how to get the  patients that do not have a assigned_id.. Also pl. email ur email so that I can send the fmb file..

SOME BLOOCKS IN THE FORM:
PROCEDURE QUERY_Pat_ASSIGNED_IDS IS
  orig_where varchar2(1000);
BEGIN

  if :assigned_ids.assignee_id is not null
  and :patients.id is null then
     orig_where := get_block_property('patients', DEFAULT_WHERE);
     set_block_property('patients', DEFAULT_WHERE,'where id = '||:assigned_ids.assignee_id);
     go_block('PATIENTS');
     clear_block;
     execute_query;

     set_block_property('patients', DEFAULT_WHERE, orig_where);
  end if;
END;



-- *************************************************************************
-- WARNING: OPENING THIS PROCEDURE IN ANY CALLING FORM'S PL-SQL EDITOR
-- BREAKS THE SUB-CLASSED LINK.
-- *************************************************************************

PROCEDURE ZOOM_ASSIGNED_IDS(assignee_type IN VARCHAR2,
                            assignee_id   IN NUMBER,
                            assigner_type IN VARCHAR2,
                            assigner_id   IN NUMBER,
                            assigned_id   IN VARCHAR2) IS


   version  VARCHAR2(30) := 'zoom_pricing: chg101026';
   p_id     ParamList;

BEGIN
   p_id := Create_Parameter_List('pLIST');

   add_parameter(p_id, 'zoom_assignee_type', TEXT_PARAMETER, assignee_type);
   add_parameter(p_id, 'zoom_assignee_id',   TEXT_PARAMETER, assignee_id);
   add_parameter(p_id, 'zoom_assigner_type', TEXT_PARAMETER, assigner_type);
   add_parameter(p_id, 'zoom_assigner_id',   TEXT_PARAMETER, assigner_id);
   add_parameter(p_id, 'zoom_assigned_id',   TEXT_PARAMETER, assigned_id);

   CALL_FORM('assids', hide, do_replace, no_query_only, p_id);

   Destroy_Parameter_List(p_id);
END;



--set_window_property(FORMS_MDI_WINDOW, window_state, maximize);
set_window_property('pt_window', window_state, maximize);

default_value('N','global.addr_requery');

if :header.zoom_id is not NULL then
   set_block_property('patients', DEFAULT_WHERE, 'where id = '
      || TO_CHAR(:header.zoom_id));
   execute_query;
 
   :header.zoom_id := NULL;
   set_block_property('patients', DEFAULT_WHERE, '');
else
  go_block('ASSIGNED_IDS');
  go_block('ADDRESSES');
  go_block('PHONES');
  go_block('PATIENTS');
end if;

:global.pat_saved := 'N';
check_sec_profiles('pt');




--
-- Begin default relation declare section
--
DECLARE
  Dummy_Define CHAR(1);
  --
  -- Begin ADDRESSES detail declare section
  --
  CURSOR ADDRESSES_cur IS      
    SELECT 1 FROM addresses    
    WHERE NAME_ID = :PATIENTS.ID;
  --
  -- End ADDRESSES detail declare section
  --
  --
  -- Begin ASSIGNED_IDS detail declare section
  --
  CURSOR ASSIGNED_IDS_cur IS      
    SELECT 1 FROM ASSIGNED_IDS    
    WHERE ASSIGNEE_ID = :PATIENTS.ID;
  --
  -- End ASSIGNED_IDS detail declare section
  --
--
-- End default relation declare section
--
--
-- Begin default relation program section
--
BEGIN
  --
  -- Begin ADDRESSES detail program section
  --
  OPEN ADDRESSES_cur;    
  FETCH ADDRESSES_cur INTO Dummy_Define;    
  IF ( ADDRESSES_cur%found ) THEN    
    Message('Cannot delete master record when matching detail records exist.');    
    CLOSE ADDRESSES_cur;    
    RAISE Form_Trigger_Failure;    
  END IF;
  CLOSE ADDRESSES_cur;
  --
  -- End ADDRESSES detail program section
  --
  --
  -- Begin ASSIGNED_IDS detail program section
  --
  OPEN ASSIGNED_IDS_cur;    
  FETCH ASSIGNED_IDS_cur INTO Dummy_Define;    
  IF ( ASSIGNED_IDS_cur%found ) THEN    
    Message('Cannot delete master record when matching detail records exist.');    
    CLOSE ASSIGNED_IDS_cur;    
    RAISE Form_Trigger_Failure;    
  END IF;
  CLOSE ASSIGNED_IDS_cur;
  --
  -- End ASSIGNED_IDS detail program section
  --
END;
--
-- End default relation program section
--



--
-- Begin default relation declare section
--
DECLARE
  recstat     VARCHAR2(20) := :System.record_status;  
  startitm    VARCHAR2(61) := :System.cursor_item;  
  rel_id      Relation;
--
-- End default relation declare section
--
--
-- Begin default relation program section
--
BEGIN
  IF ( recstat = 'NEW' or recstat = 'INSERT' ) THEN  
    RETURN;
  END IF;
  --
  -- Begin ADDRESSES detail program section
  --
  IF ( (:PATIENTS.ID is not null) ) THEN  
    rel_id := Find_Relation('PATIENTS.RELATION_ADDRESSES');  
    Query_Master_Details(rel_id, 'ADDRESSES');  
  END IF;
  --
  -- End ADDRESSES detail program section
  --
  --
  -- Begin ASSIGNED_IDS detail program section
  --
  IF ( (:PATIENTS.ID is not null) ) THEN  
    rel_id := Find_Relation('PATIENTS.RELATION_ASSIGNED_IDS');  
    Query_Master_Details(rel_id, 'ASSIGNED_IDS');  
  END IF;
  --
  -- End ASSIGNED_IDS detail program section
  --

  IF ( :System.cursor_item <> startitm ) THEN    
     Go_Item(startitm);    
     Check_Package_Failure;    
  END IF;
END;
--
-- End default relation program section


zoom_assigned_ids(:assignee_type, :assignee_id, NULL, NULL, NULL);


:global.x_coor := 1 + Get_Item_Property(:SYSTEM.CURRENT_BLOCK ||'.'||:SYSTEM.CURRENT_ITEM,X_POS);
:global.y_coor := 5 + Get_Item_Property(:SYSTEM.CURRENT_BLOCK ||'.'||:SYSTEM.CURRENT_ITEM,Y_POS);

refsource_lu(:assigned_ids.assigner_type, :assigned_ids.assigner_id, :GLOBAL.X_COOR, :GLOBAL.Y_COOR);

0
Sara_j_11
Asked:
Sara_j_11
  • 2
2 Solutions
 
pratikroyCommented:
send me the fmb on my email (mentioned in my profile - click on my name)
0
 
sapnamCommented:
So the table has patient_id and assigned id and none of the records have a null assigned id.
Now you say the form does not display assigned id for some patient ids.

In the form, check the block where you are displaying this information.  Is it a block with a base table same as tne table.
Then how do you see a patient record.  Is it by doing Execute Query.

You can send me the fmb on udaym@vsnl.com and also the relevant table structures
0
 
sapnamCommented:
Continuing further, let us check this step by step

1. The form should have a block with Base Table Property as your patients table
2. The block should have 2 fields, one to show the patient id and one the assigned id.  Both fields base table property must be True
3. In execute query, you should be able to see the assigned id for the patient id
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now