How to pass the value of retVal variable from this JS function to an application item, so I could store the value in the DB? This function open a prompt to enter the value.
function getEmailValue() {
var retVal = prompt("Enter your Email Address : ", "your Email here");
document.write("An Email will be send to : " + retVal );
}
Note:
This JS function runs from a JS file exists in Static Application Files it calls Ajax callback from APEX side.
P12_PAUSE_EMAIL is an application item.
I can't use page items or Dynamic actions as there is no actual page.
I tried apex.item , $v and $ , but it gives undefined object.
I wouldn't rely on using a prompt for this.
If you want a similar UI, you could simply use an inline dialog or a modal dialog page (have a look at the Universal Theme Sample Application for examples.
In either of these, you could have an item which you could then use directly (granted it's listed in the items to submit to your ajax callback see the pageItems attribute here ).