Solved

Module data diagrammer

Posted on 1997-12-09
3
1,096 Views
Last Modified: 2008-02-01
Hi,
I am using Designer 1.2. with my Oracle 7.2 database.
In a multiple form application, I have a transaction form
which allows the user to only query a base table and update
a particular field.

When that form is run, it goes directly to normal mode, and not to
'Query' Mode, as required by the business.
So I added a ENTER_QUERY statement in the When_new_form_instance.

When that form is invoked after any other transaction,(presumably
after initializing global variable cg$do_auto_query) it works properly.
But when it is called straight from the main form, straight after
starting the application, and queried, it gives a message
'variable global.cg$do_auto_query does not exist'.

How can I tell my Module Data diagrammer to generate my form to start in
Query mode?
Can somebody help me?.Any help would be greatly appreciated.
Lakshmanan.
0
Comment
Question by:lakshmanan_k
  • 2
3 Comments
 

Accepted Solution

by:
tejay earned 20 total points
ID: 1081111
Hi Lakshmanan!

I had th same problem. The problem is that the Forms Generator will add code AFTER your code. But the generated code is needed to initialize the Form. Your only chance is to add
your code after the generation or - like me - set only a flag
in the WNFI-Trigger and write your code in the WWA-Trigger
(When-Window-Activated) dependent on the flag like this:

BEGIN
  if var.my_flag then
    do_key('enter_query');
    var.my_flag := FALSE;
  end if;
END;

HTH, TeJay  
0
 

Author Comment

by:lakshmanan_k
ID: 1081112
Hi TeJay,
Your solution is to start the form in Enter_qury mode or in Normal mode.
The poblem is that the form searches for a Global variable mentioned in the question which originats the error message.


0
 

Expert Comment

by:tejay
ID: 1081113
Maybe, I need to be more accurate with my postings!

If you add this code as the WNFI-Trigger (When-New-Form-Instance)
of your template:

a)
Do_Key('Enter_Query');

or
b) (not recommended)
Enter_Query;

the genereted code will be added after your code

[Start of WNFI-Trigger in generated Form]
Do_Key('Enter_Query'); -- Version a)
-- Enter_Query;        -- Version b)
/* CGGN$CALL_GENERATOR_CODE */
/* Execute the WHEN-NEW-FORM-INSTANCE code that was created by Forms */
/*   Generator                                                       */
BEGIN
  CGBS2$.SET_COORD_STYLE( 'P' );
  CGBS2$.SET_QRY_ON_ENTRY( 'Y' );
  BEGIN
    CG$WHEN_NEW_FORM_INSTANCE;
  EXCEPTION
    WHEN OTHERS THEN
      CGTE$OTHER_EXCEPTIONS;
  END;
END;
[End of WNFI-Trigger in generated Form]

This trigger calls CG$WHEN_NEW_FROM_INSTANCE

[Start of CG$WHEN_NEW_FROM_INSTANCE]
/* CG$WHEN_NEW_FORM_INSTANCE */
PROCEDURE CG$WHEN_NEW_FORM_INSTANCE IS
BEGIN
/* CGLY$INIT_CANVASES */
/* Call procedure to ensure correct canvases are visible */
BEGIN
  CGLY$CANVAS_MANAGEMENT;
END;

/* CGBS$STARTUP */
/* Perform start-up processing for Block Synchronisation */
BEGIN
  /* Set the defaults for the globals */
  default_value('A', 'GLOBAL.CG$QUERY_MODE');
  /* Set the relations to the default query mode */
  CGBS$.SET_RELATIONS( :GLOBAL.CG$QUERY_MODE );
  /* Set the query mode items */
  CGBS$SET_QUERY_MODE( :GLOBAL.CG$QUERY_MODE );
END;
END;
[End of CG$WHEN_NEW_FROM_INSTANCE]

As you see, the default_value of :global.cg$query_mode is set here

Depending on your Form this global variable will be needed in of the Triggercodes

KEY-ENTQRY        (Do_Key('Enter_Query'))
ON-POPULATE-QUERY (Enter_Query und Master-Detail-Form)

So, my solution was to add the following code

in the WNFI-Trigger:
:global.my_val := 'TRUE'

in the WWA-Trigger:
if :global.my_val = 'TRUE' then
  Do_Key('Enter_Query');
  :global.my_val := 'FALSE';
end if;

or

in the WNFI-Trigger:
default_value('A', 'GLOBAL.CG$QUERY_MODE');
Do_Key('Enter_Query');

Maybe, you can also use the WNBI-Trigger.
I didn't check that.
HTH, TeJay




0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question