Oracle Apex5: I get NULL from &MY_ITEM. even MY_ITEM have a value in my current Session - oracle

First of all, excuse my poor English.
I'm new to the oracle application express (Apex) and I'm kind of confused about maintaining.
I have a simple page with one item P2_ITEM1 and one button BUTTON1.
The button action is defined by dynamic action, and I defined two actions:
Execute PL/SQL with the following
APEX_UTIL.SET_SESSION_STATE('P2_ITEM1',:P2_ITEM1);
Alert to show the value of &P2_ITEM1.
What I'm expecting to see is an alert with the value of P2_ITEM1 that I have entered, but I always get null.
Here is a snapshot of the page design and page run.
Here I'm expecting to have the value 123 but it's always NULL UNLESS I submit the page.
Thanks in advance.

The &P2_ITEM1 is a substitution variable which is estimated after the page opened. in your case you just need to use JavaScript as alert $v('P2_ITEM1').

Are you using &P2_ITEM1. , dot in last?

Related

Oracle apex redirect page if page item a certain value

Trying to create my own authentication since the Authentication scheme in apex won't work properly for what I am trying to do.
basically I have a function to assign the value of a PAGE ITEM either 0 or 1 and
I tried to create a branch wherein I put the above condition if the PAGE ITEM != 1
then it would redirect to another page.
the problem is the point, i tried to have it run before the header but it wont work.
Am I doing anything wrong + any solution for this.
Many Thanks!

how to pass the executionContext on the Ribbon workbench for a HomePageGrid

I have been able to pass the formContext to the javascript function that I call from the ribbon when I call it from a Form button, but the same trick when calling from the HomePageGrid pass me a null value.
I use in both cases the Primary Control CRM parameter as stated in multiple places.
You can see on the left side how my PrimaryControl CRM parameter is passing a null value when selecting an item on the Grid. On the right side you can see how my PrimaryControl CRM parameter is passing the formContext correctly.
is it there any way to pass the executionContext/formContext/Context?. As you can see I have tried that is the Primary Control value is null to pick up Xrm.page.context and xrm.ui.getglobalContext.... and still doesn't work.
Any idea of what to do?
This is the configuration in the Ribbon Workbench
Updated for minohimself:
I have set the SelectedControl in the Ribbon and I am receiving on the first parameter the Mscrm.GridControl. And I dont see the formContext as you see it.
I might be doing something wrong, because it is obvious that you are able to see the context? can you point me in the right direction?
What I can see from your javascript code is that you have a theia.button which has a function called ExecuteActionWithErrorMessage that receives at least 4 parameters, including objectid, formContext, entityName, and actionName).
In my case my function is called and should receive the formContext and a yes/no (T/F) statement to decide how to manage the security roles.
So, should I include your four parameters, so I can retrieve as well the objectid, formcontext, entityname and actionname?
Thanks for your quick turn around and help.
UPDATE 2:
Here you can see my Ribbon Workbench Command
and here you can see my Debugger View:
as you can see what you see it is not what I see. I am on a Ms. Dynamics CRM v9.0.15.9 (version 1612) on-premises.
Have you tried SelectedControl parameter ? that one is ment for subgrids. The one youre using is used on Forms. ;)
I just tested what you get when you pass SelectedControl

Oracle Apex using Mailto with Variable page date

I'm trying to use a button which opens an email with pre populated information. But require variables from page elements.
so for example P45_DATE get the update date and P45_DATA gets the data.
I tried different element identifiers like : , & or #. but if used nothing gets return upto the first identifier.
mailto:test#test.com&cc=someoneelse#test.com?Subject=Extension report for &P45_DATE. &body=Please see Extension below. &P45_DATA
Is this even possible
Oracle 11g2
apex 4.2.5.00.08
many thanks
Depends on where you are defining this string and if you want client or session state values.
If as part of JavaScript expression, you might use something like:
'mailto:test#test.com&cc=someoneelse#test.com?Subject=Extension report for '+$v('P45_DATE')+'&body=Please see Extension below. '+$v('P45_DATA')
Bear in mind this isn't escaping the data. Also check to see if any errors are appearing in the JavaScript console.

How to turn off error messages in visualforce?

I have a VisualForce page that has three functionalities,
Hence it has three 'public PageReference' subroutines,
That are called when an action happens in the page [i.e. button]
One of the functionalities requires user input [i.e. inputText],
So the main APEX code has a variable declaration for that input:
public String UserInput { get; set; }
Since each task is not really related,
When I hit the button on the other two functionalities,
I get a VisualForce error,
Because the inputText object has no user input,
How can I prevent that from happening,
Another way to solve this,
How do I turn off VisualForce Error messages?
So I can do error handling from APEX,
Looking at the debug log file,
The error is in VisualForce NOT APEX,
Thanks
If you don't want to fire validation you can use the immediate = true attribute on the CommandButton/CommandLink to bypass any validation. - This isn't optimal in my opinion
If you only want to submit part of a page and still fire validation have a look at the ActionRegion. This should allow you to wrap a particular Region for the action call. This is probably best for your purpose.
Sorry I don't have time to post full examples but that should point you in the right direction :)

jqGrid: how to keep the 'Save' button enabled after adding a row

Im looking for a way to add a new row and keep the form data together with the Save button enabled, to have the chance to resend the same data already sent.
What im trying to achieve is to facilitate the submission of similar-but-not-equal rows. So, for example, if a merchant receives an order all of the same X product, but with slightly differences, he can keep the common fields after saving a product and only change the different properties to submit the next one, and so on.
Then the server will throw an error if exactly the same data is sent more than once.
As per our discussion I would refer to the following as an example of adding a custom button to the Add form:
How to add custom buttons to JqGrid add/edit forms?
as for saving the information you can use the the documentation as an example, I think the beforeSubmit event would work for saving the field data
In jqGrid 4.4.4, file jquery.jqGrid.min.js:
At line 279, after 'beforeSubmit' takes place, you will find the following statement: if(k[0]&&!b[d.p.id].processing), the second part of the test means something like 'if request is not being processed', then after the 'processing' variable is set to true, the request to the server is performed.
What prevents to resend data is that the processing variable is never set back to false 'afterSubmit' for example.
So, my solution was to do exactly that: b[d.p.id].processing=false; at the end of the if block performing the action, this is done on line 287, col 55.
This way i can resend slightly different 'products' and just let the server to manage errors.
I suppose it could be a bug in the library to not 'close' the processing state by setting back the variable to false.

Resources