I've have multiple procedures in a codeunit and i want to call a certain procedure OnAction button in a page.
trigger OnAction();
var
<Var> : CodeUnit <CodeunitName>
begin
<Var>.<FunctionName>;
<Var>.Run;
end;
what I'm it doing wrong? and what is the correct one
Just call the procedure you want and don’t call Run. Run is just procedure as the rest, only predefined.
Related
I have a Camunda flow with a Call Activity (sequential), the call Activity calls several subflows based on a list of process keys (ids) in a certain order.
For instance I get a list of ["flow-1", "flow-2"], then flow-1.bpmn and flow-2.bpmn are executed.
But, also in the scope is flow specific data, added to the scope in "Read LOT Configuration". For instance [{"name", "flow-1", "identifier" : "some-data"}, {name: "flow-2", "identifier" : "some other data"}].
I would like the call activity to determine that for flow-1, I need to send the flow-1 related object along.
I do not want to send the entire collection, but only the flow specific data.
How can I achieve this?
Some ideas:
a) use the element variable from the call activity settings as key to extract the correct data element in a data mapping
b) surround the call activity with a multi-instance embedded sub process. In this scope you will have the element variable (processId), which can then be used to perform delegate variable mapping (https://docs.camunda.org/manual/7.16/reference/bpmn20/subprocesses/call-activity/#delegation-of-variable-mapping)
c) pass the processID as data and fetch the configuration for the particular process inside its sub process implementation only
I have the following code in my ajax callback (PL/SQL):
:P1_CNT := TO_NUMBER(:P1_CNT) + 1;
apex_util.set_session_state
(p_name => 'P1_CNT'
,p_value => :P1_CNT
);
Which seems to work just fine. But then a process is called that checks that page item and page item comes up as 0 even though in the callback it is set to 1. How can I fix that?
The code that calls the ajax is javascript below, executed from a custom dynamic action:
for ( var i=0; i<records.length; i++) {
apex.server.process
("my_ajax_callback"
,{x01:records[i][1]}
,{type:'GET', dataType: 'text', success: function( text) {}}
);
}
apex.page.submit( 'COMPLETE_PROCESS_RECORDS' );
Where COMPLETE_PROCESS_RECORDS is the process that executes once all the records in the loop have been processed by ajax callback. the ajax callback evaluates each record passed to it and processes some and discards others. P1_CNT is incremented every time a record was processed further.
You haven't shown us the code that calls the Ajax callback, but basically, there's server-side (PL/SQL in this case) and client-side (JavaScript) code. For the server to get values from the client-side, you have to send them in when calling the Ajax callback. That's what the pData parameter is for:
https://docs.oracle.com/en/database/oracle/application-express/19.2/aexjs/apex.server.html#.process
You can access the values you send to the server-side code in different ways depending on how you send them in. For example, if you send in a value with x01, you can refer to it in your PL/SQL code with apex_application.g_x01.
Of course, sometimes you need to get values from the server-side to the client-side. For this, typically you'd send an HTTP response from your PL/SQL code. Here's an example that sends a JSON object:
apex_json.open_object();
apex_json.write('hello', 'world');
apex_json.close_object();
You would then need to update your client-side code to look at and use the HTTP response to map the values to whatever part of the page/DOM you need.
This is so typical that the APEX team made it very simple if you're using the Dynamic Action framework instead of raw JavaScript. There's an action named Execute PL/SQL that has attributes named Items to Submit and Items to Return that can do the heavy lifting for you.
Please find below function which gets called before start installation process.
I want have function to create system restore point before start installation process.
Now whats my functionality works perfect, but the UI gets freeze.
i want to show marquee progress and UI should be resposive but after reading lots of article, i am unable to find any useful.
function PrepareToInstall(var NeedsRestart: Boolean): String;
var
WasVisible: Boolean;
begin
// show the PreparingLabel
WizardForm.PreparingLabel.Visible := True;
WizardForm.ProgressGauge.Style := npbstMarquee;
// set a label caption
WizardForm.PreparingLabel.Text := 'Creating system Restore Point...';
CreateSystemRestorePoint();
WizardForm.ProgressGauge.Style := npbstNormal;
end;
Please help me on this, you answer can help me a lot.
Many Thanks.
I have a web service which is working find with the data proxy.
In this web service I have some functions I like to call and assign the results to a variable.
I found some example on this and below is what I have come up with.
Now all works but my event is being fired to late in the process. What I mean is once I call the getAdData() function and then call the webservice function getBleedAt() I need my event to fire off. what happening is the event is being fire at the end of the hold routine so I get my data to late.
I try using the dispatchEvent but can't get that to work. the web service function is returning a XML structure
public function getAdddata(adnum:String){
var WS:WebService = new WebService();
WS.getBleedAt.addEventListener("result", GetInfo);
WS.getBleedAt.resultFormat = 'e4x';
WS.loadWSDL(URL);
WS.getBleedAt(adnum);
}
private function GetInfo(evt:ResultEvent):void {
var myObj:Object = evt.result as Object;
trace(myObj.BleedAt.toString());
}
The call to the web service returns asynchronously so your result handler (the GetInfo method) is the earliest point at which the result data is available to you. Therefore, any code which needs to access the result data needs to be triggered from the GetInfo method.
I woul like to access Apex_application.g_fXX values from within the database stored procedure, either by passing the whole array as an input parameter or by reading session state from within the database. Is this possible? My reason for trying to do this is that I want to move all heavy processing to the database.
TIA, Tamas
Sure, why wouldn't it work?
CREATE OR REPLACE PACKAGE "APXPA_TEST" IS
PROCEDURE process_something;
PROCEDURE process_something2(i_values IN apex_application_global.vc_arr2);
END "APXPA_TEST";
/
CREATE OR REPLACE PACKAGE BODY "APXPA_TEST" IS
PROCEDURE process_something
IS
BEGIN
FOR i in 1..apex_application.g_F02.COUNT
LOOP
apex_debug_message.log_message('processing '||apex_application.g_f02(i)||'...');
END LOOP;
END;
PROCEDURE process_something2(i_values IN apex_application_global.vc_arr2)
IS
BEGIN
FOR i IN 1..i_values.COUNT
LOOP
apex_debug_message.log_message('processing '||i_values(i)||'...');
END LOOP;
END;
end "APXPA_TEST";
/
I made a page with a tabular form based on EMP. I created a page process with process point On Submit - After Computations and Validations, before the MRU.
apxpa_test.process_something;
apxpa_test.process_something2(apex_application.g_f02);
G_F02 holds ENAME
Now run the page and enable debug. Then just submit the form (you don't need to edit anything), and go to view debug. Pick the last entry. Scroll to the point where it goes over the page processes: you'll see the output there. (i only used deptartment 10)
Processes - point: AFTER_SUBMIT
...Process "some process" - Type: PLSQL
...Execute Statement: begin apxpa_test.process_something; apxpa_test.process_something2(apex_application.g_f02); end;
processing KING...
processing CLARK...
processing MILLER...
processing KING...
processing CLARK...
processing MILLER...
...Process "ApplyMRU" - Type: MULTI_ROW_UPDATE
...Process "ApplyMRD" - Type: MULTI_ROW_DELETE