Executing a procudre.

Hi All,
Could you plz help me out how to execute the following procedure with arguments.Also want to know what is JCAPS_OWNER and store_document_refernce in below example ?
CREATE OR REPLACE PROCEDURE JCAPS_OWNER.store_document_reference(
i_source_system_name IN rd_system_master_tab.system_id%TYPE,                    --'WORLDPORT'                         --'WORLDPORT'
i_universal_id IN rd_document_reference_tab.universal_id%TYPE,               --Generated Value example ('100900361714')
i_file_number IN rd_document_reference_tab.file_number%TYPE,               --'70189816WORLDPORT'                    --'70145460WORLDPORT'
i_document_number IN rd_document_reference_tab.document_number%TYPE,               --'70189816'                         --'70145460'
i_document_type IN rd_document_reference_tab.document_type%TYPE,               --'HOUSE_BILL'                         --'HOUSE_BILL'
i_origin_system IN rd_document_reference_tab.origin_system%TYPE,               --'RDU'                              --'IAH'
i_destination_system IN rd_document_reference_tab.destination_system%TYPE,          --'MEM'                              --'CVG'
i_owner_flag IN rd_document_reference_tab.owner_flag%TYPE,               --'Y'                              --'Y'
i_source_create_date IN rd_document_reference_tab.source_creation_date%TYPE,          --'2010-06-08T21:45:00Z'               --'2010-06-08T23:00:00Z'
i_carrier_code IN rd_vendor_reference_tab.system_vendor_code%TYPE,               --''                              --''
i_sid_in_message     IN     rd_document_reference_tab.is_sid_in_message%TYPE DEFAULT 1     --'1'                              --'1'
IS
l_ship_id_count NUMBER(5);
l_id_type VARCHAR2(20) := rd_constants_pkg.shipment_id;
BEGIN
l_ship_id_count := 0;
/*Verify if shipment id already exists for House and Source system */
BEGIN
     SELECT 1
     INTO l_ship_id_count
     FROM rd_document_reference_tab a, rd_universal_id_tab b
     WHERE a.universal_id = b.universal_id
     AND a.file_number = i_file_number
     AND a.system_id = i_source_system_name
     AND a.document_type = i_document_type
     AND b.id_type = l_id_type
     AND ROWNUM < 2;
/*Shipment id already exists */
rd_raise_exception(i_error_number => rd_exception_constants_pkg.shipment_id_already_exists);
EXCEPTION
          WHEN NO_DATA_FOUND
          THEN
               /*insert into document_reference */
          INSERT INTO rd_document_reference_tab
          (system_id ,universal_id ,file_number, id_type, document_number
               , document_type
               , created_by
               , create_date
               , last_updated_by, last_update_date,
          ORIGIN_SYSTEM, DESTINATION_SYSTEM,SOURCE_CREATION_DATE,OWNER_FLAG
               ,is_sid_in_message)
          VALUES (i_source_system_name ,i_universal_id ,i_file_number , l_id_type, i_document_number ,i_document_type ,USER ,SYSDATE ,USER ,SYSDATE,
     i_origin_system, i_destination_system, i_source_create_date, i_owner_flag,i_sid_in_message);
          IF ( SQL%ROWCOUNT <> 1 ) THEN
               /*insert failed */
          rd_raise_exception(i_error_number => rd_exception_constants_pkg.store_document_ref_failed);
          END IF;
END;
IF ( i_document_type = rd_constants_pkg.master_bill) THEN
INSERT INTO rd_mwb_vendor_tab (mwb_vendor_id,system_id,universal_id,file_number,vendor_id,created_by,create_date,last_updated_by,last_update_date)
VALUES ( rd_mwb_vendor_seq.nextval,i_source_system_name,i_universal_id,i_file_number,i_carrier_code,USER,SYSDATE,USER,SYSDATE);
IF ( SQL%ROWCOUNT <> 1 ) THEN
/*insert failed */
rd_raise_exception(i_error_number => rd_exception_constants_pkg.store_document_ref_failed);
END IF;
END IF;
EXCEPTION
WHEN OTHERS THEN
rd_raise_exception(i_error_number => rd_exception_constants_pkg.store_document_ref_failed);
END;

tvenkatesh07 wrote:
Hi All,
Could you plz help me out how to execute the following procedure with arguments.Also want to know what is JCAPS_OWNER and store_document_refernce in below example ?
CREATE OR REPLACE PROCEDURE JCAPS_OWNER.store_document_reference(
<snip>Take a look at the syntax of CREATE PROCEDURE, found in the fine SQL Reference manual. That should provide the answer to your second question.

Similar Messages

  • Error while executing a DTP

    Hi All ,
    I got  an error while executing a DTP. Short Dump analysis points this error. :   DBIF_REPO_SQL_ERROR.
    Please provide in your valuable inputs to resolve this error.
    Thank & Regards,
    Rohit Garg

    This error comes majorly when you have a deadlock in  your code. Check ST22 if you have any short dump corresponding to it and see the source code where it is getting stuck.
    If you find this dump explaining table space issue, then contact Basis, they will be able to help you with table space problem.
    Edited by: Deepmala Agarwal on Aug 18, 2009 7:40 AM

  • Built-in: Execute procedure - delete statement

    Hi,
    I am trying to delete rejected invoices from AP_INVOICES_INTERFACE and AP_INVOICE_LINES_INTERFACE tables each time form is opened. I am not developer so I have not access to form design, but I am allowed to use forms personalization, however I am really suprised by behaviour of this.
    Below code is triggered when form is opened:
    delete from ap_invoice_lines_interface where invoice_id in (select invoice_id from ap_invoices_interface where (source = 'INTERCOMPANY2' or source = 'AGENCY COMMISSIONS') and description like '%Agency%Commissions%' and org_id = 63 and status = 'REJECTED')
    and second proc:
    delete from ap_invoices_interface where (source = 'INTERCOMPANY2' or source = 'AGENCY COMMISSIONS') and description like '%Agency%Commissions%' and org_id = 63 and status = 'REJECTED'
    I had to put them in separate actions as I was receiving error when I had them in one statement together, however this is completly different story. My problem is that althought these invoices are not visible when I open Quick Invoices form (this is were personalization is applied), when I go to other form showing interface invoices, but without this personalization I still can see them. I had similar problem when I was actually executing update statement, however when I have chosen to create invoices with Payables Open Interface (when did not and closed the form values were going back to previous state) it was updating the values to the ones changed.
    Anyone has any idea what is wrong here?

    I just want to delete (or remove) it from the VO. Data for this VO is not on the database.
    The function is doing what I want it to do (delete from the VO), its just always deleting the first row, versus the selected row. I select the command button next on a column next to an item further down in the list and it deletes the first row. The problem is setting the selected row to be removed - I thought setting the current row would be taken care of by the SelectListener?
    selectionState="#{bindings.MyIspListView1.collectionModel.selectedRow}"
    selectionListener="#{bindings.MyIspListView1.collectionModel.makeCurrent}"

  • Dynamic CRM 2013 Online how to execute Report, generate PDF and email

    Dear All,
    I am using Dynamic CRM 2013 online. For quote, I have workflow and Dialogue processes for review process. On approval, I want the system to generate a PDF of quote report, attach the PDF and email it to the Customer.
    Better I would like, When approver, clicks on the approve button, the system should auto generate a PDF of quote report, attach the PDF and email it to the Customer, without any further input from the user. If its not possible, I may have to put button on
    quote form.
    I am using the attached code, but facing various issues.
    1. Under prepare the SOAP Message coding part, I am not sure what should be the below URL for CRM 2013 Online?
    xHReq.Open("POST", "/mscrmservices/2007/CrmService.asmx", false);
    2. What should be the emailid here? Is it Recepient Contact id(Guid) ?
    var emailid = resultXml.selectSingleNode("//CreateResult").nodeTypedValue;
    alert("emailid" + emailid.toString());
    3. Using this code, not able to create Entity for "ActivityMimeAttachment", I am getting newEntity as undefined.
    Below is the code I am using. Please check and help me out, where I am going wrong. Let me know if any better way to implement it. At present, I have put one button on quote form, on click event, below code will get executed.
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title></title>
    <script type="text/javascript">
    var Xrm;
    if (window.opener) { Xrm = window.opener.Xrm; }
    else if (window.parent) { Xrm = window.parent.Xrm; }
    function getReportingSession() {
    var reportName = "Quotation_Report"; //set this to the report you are trying to download
    var reportId = "7C39D18F-1DC6-E311-8986-D89D6765B238"; //set this to the guid of the report you are trying to download
    var recordid = Xrm.Page.data.entity.getId();
    // recordid = recordid.substring(1, 37); //getting rid of curly brackets
    alert(recordid);
    var pth = Xrm.Page.context.getServerUrl() + "/CRMReports/rsviewer/reportviewer.aspx";
    var retrieveEntityReq = new XMLHttpRequest();
    retrieveEntityReq.open("POST", pth, false);
    retrieveEntityReq.setRequestHeader("Accept", "*/*");
    retrieveEntityReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    retrieveEntityReq.send("id=%7B" + reportId + "%7D&uniquename=" + Xrm.Page.context.getOrgUniqueName() + "&iscustomreport=true&reportnameonsrs=&reportName=" + reportName + "&isScheduledReport=false");
    var x = retrieveEntityReq.responseText.indexOf("ReportSession=");
    var ret = new Array();
    ret[0] = retrieveEntityReq.responseText.substr(x + 14, retrieveEntityReq.responseText.indexOf("&", x) - x - 14); //the session id
    x = retrieveEntityReq.responseText.indexOf("ControlID=");
    ret[1] = retrieveEntityReq.responseText.substr(x + 10, retrieveEntityReq.responseText.indexOf("&", x) - x - 10); //the control id
    return ret;
    function createEntity(ent, entName, upd) {
    var jsonEntity = JSON.stringify(ent);
    var createEntityReq = new XMLHttpRequest();
    var ODataPath = Xrm.Page.context.getServerUrl() + "XRMServices/2011/OrganizationData.svc";
    createEntityReq.open("POST", ODataPath + "/" + entName + "Set" + upd, false);
    createEntityReq.setRequestHeader("Accept", "application/json");
    createEntityReq.setRequestHeader("Content-Type", "application/json; charset=utf-8");
    createEntityReq.send(jsonEntity);
    var newEntity = JSON.parse(createEntityReq.responseText).d;
    alert("new entity" + newEntity);
    return newEntity;
    function createAttachment() {
    var params = getReportingSession();
    var recordid = Xrm.Page.data.entity.getId();
    alert("recordid " + recordid);
    var orgName = Xrm.Page.context.getOrgUniqueName();
    var userID = Xrm.Page.context.getUserId();
    //create email record
    // Prepare the SOAP message.
    var xml = "<?xml version='1.0' encoding='utf-8'?>" +"<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'" +
    " xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'" +
    " xmlns:xsd='http://www.w3.org/2001/XMLSchema'>" +
    "<soap:Header>" +
    "</soap:Header>" +
    "<soap:Body>" +
    "<Create xmlns='http://schemas.microsoft.com/crm/2007/WebServices'>" +
    "<entity xsi:type='email'>" +
    "<regardingobjectid type='quote'>" + recordid + "</regardingobjectid>" +
    "<subject>" + "Email with Attachment4" + "</subject>" +
    "</entity>" +
    "</Create>" +
    "</soap:Body>" +
    "</soap:Envelope>";
    // Prepare the xmlHttpObject and send the request.
    var xHReq = new ActiveXObject("Msxml2.XMLHTTP");
    xHReq.Open("POST", "/mscrmservices/2007/CrmService.asmx", false);
    xHReq.setRequestHeader("SOAPAction", "http://schemas.microsoft.com/crm/2007/WebServices/Create");
    xHReq.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
    xHReq.setRequestHeader("Content-Length", xml.length);
    xHReq.send(xml);
    // Capture the result
    var resultXml = xHReq.responseXML;
    // alert("resultXml " + resultXml);
    // Check for errors.
    var errorCount = resultXml.selectNodes('//error').length;
    if (errorCount != 0) {
    alert("ERROR");
    var msg = resultXml.selectSingleNode('//description').nodeTypedValue;
    alert(msg);
    var emailid = resultXml.selectSingleNode("//CreateResult").nodeTypedValue;
    alert("emailid" + emailid.toString());
    //var emailid = userID;
    var post = Object();
    post.Body = encodePdf(params);
    var email = new Array();
    email[0] =new Object();
    email[0].id = emailid;
    email[0].entityType ='email';
    post.Subject ="File Attachment";
    post.AttachmentNumber = 1;
    post.FileName ="Report.pdf";
    post.MimeType ="application/pdf";
    post.ObjectId = Object();
    post.ObjectId.LogicalName ="email";
    post.ObjectId.Id = email[0].id;
    post.ObjectTypeCode ="email";
    alert(post.ObjectId.Id);
    createEntity(post,"ActivityMimeAttachment", "");
    alert("created successfully");
    email.Subject = "Your Order";
    //Set The current order as the Regarding object
    email.RegardingObjectId = {
    Id: Xrm.Page.data.entity.getId(), //Get the current entity Id , here OrderId
    LogicalName: Xrm.Page.data.entity.getEntityName()//Get the current entity name, here it will be “salesOrder”
    //Create Email Activity
    SDK.JScriptRESTDataOperations.Create(email, "Email", EmailCallBack, function (error) { alert(error.message); });
    // Email Call Back function
    function EmailCallBack(result) {
    email = result; // Set the email to result to use it later in email attachment for retrieving activity Id
    var activityPartyFrom = new Object();
    // Set the From party of the ActivityParty to relate an entity with Email From field
    activityPartyFrom.PartyId = {
    Id: customerId, // id of entity you want to associate this activity with.
    LogicalName: "contact"
    // Set the "activity" of the ActivityParty
    activityPartyFrom.ActivityId = {
    Id: result.ActivityId,
    LogicalName: "email"
    // Now set the participation type that describes the role of the party on the activity).
    activityPartyFrom.ParticipationTypeMask = { Value: 2 }; // 2 means ToRecipients
    // Create the from ActivityParty for the email
    SDK.JScriptRESTDataOperations.Create(activityPartyFrom, "ActivityParty", ActivityPartyFromCallBack, function (error) { alert(error.message); });
    var activityPartyTo = new Object();
    // Set the From party of the ActivityParty to relate an entity with Email From field
    activityPartyTo.PartyId = {
    Id: ownerId, // id of entity you want to associate this activity with.
    LogicalName: "systemuser"
    // Set the "activity" of the ActivityParty
    activityPartyTo.ActivityId = {
    Id: result.ActivityId,
    LogicalName: "email"
    // Now set the participation type that describes the role of the party on the activity). activityPartyTo.ParticipationTypeMask = { Value: 1 }; // 1 means Sender
    // Create the from ActivityParty
    SDK.JScriptRESTDataOperations.Create(activityPartyTo, "ActivityParty", ActivityPartyToCallBack, function (error) { alert(error.message); });
    //ActivityParty From Callback
    function ActivityPartyFromCallBack(result) {
    //ActivityParty To Callback
    function ActivityPartyToCallBack(result) {
    var StringMaker = function () {
    this.parts = [];
    this.length = 0;
    this.append = function (s) {
    this.parts.push(s);
    this.length += s.length;
    this.prepend = function (s) {
    this.parts.unshift(s);
    this.length += s.length;
    this.toString = function () {
    return this.parts.join('');
    var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
    function encode64(input) {
    var output = new StringMaker();
    var chr1, chr2, chr3;
    var enc1, enc2, enc3, enc4;
    var i = 0;
    while (i < input.length) {
    chr1 = input[i++];
    chr2 = input[i++];
    chr3 = input[i++];
    enc1 = chr1 >> 2;
    enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
    enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
    enc4 = chr3 & 63;
    if (isNaN(chr2)) {
    enc3 = enc4 = 64;
    else if (isNaN(chr3)) {
    enc4 = 64;
    output.append(keyStr.charAt(enc1) + keyStr.charAt(enc2) + keyStr.charAt(enc3) + keyStr.charAt(enc4));
    return output.toString();
    var bdy = new Array();
    var bdyLen = 0;
    function concat2Bdy(x) {
    bdy[bdyLen] = x;
    bdyLen++;
    function encodePdf(params) {
    bdy = new Array();
    bdyLen = 0;
    var retrieveEntityReq = new XMLHttpRequest();
    var pth = Xrm.Page.context.getServerUrl() + "/Reserved.ReportViewerWebControl.axd?ReportSession=" + params[0] + "&Culture=1033&CultureOverrides=True&UICulture=1033&UICultureOverrides=True&ReportStack=1&ControlID=" + params[1] + "&OpType=Export&FileName=Public&ContentDisposition=OnlyHtmlInline&Format=PDF";
    retrieveEntityReq.open("GET", pth, false);
    retrieveEntityReq.setRequestHeader("Accept", "*/*");
    retrieveEntityReq.send();
    BinaryToArray(retrieveEntityReq.responseBody);
    return encode64(bdy);
    </SCRIPT>
    <SCRIPT type=text/vbscript>
    Function BinaryToArray(Binary)
    Dim i
    ReDim byteArray(LenB(Binary))
    For i = 1 To LenB(Binary)
    byteArray(i-1) = AscB(MidB(Binary, i, 1))
    concat2Bdy(AscB(MidB(Binary, i, 1)))
    Next
    BinaryToArray = byteArray
    End Function
    </SCRIPT>
    </head>
    <body>
    <input type="button" onclick="createAttachment();" value="Attach Report" />
    </body>
    </html>
    Thanks. and waiting for your valuable comments.
    - Mittal

    Hello,
    Yes, I was able to make my code working as below. Tested on CRM online 2013.
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title></title>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
    <script type="text/javascript">
    if (typeof (SDK) == "undefined")
    { SDK = { __namespace: true }; }
    SDK.JScriptRESTDataOperations = {
    _context: function () {
    if (typeof GetGlobalContext != "undefined")
    { return GetGlobalContext(); }
    else {
    if (typeof Xrm != "undefined") {
    return Xrm.Page.context;
    else { return new Error("Context is not available."); }
    _getServerUrl: function () {
    var serverUrl = this._context().getServerUrl()
    if (serverUrl.match(/\/$/)) {
    serverUrl = serverUrl.substring(0, serverUrl.length - 1);
    return serverUrl;
    _ODataPath: function () {
    return this._getServerUrl() + "/XRMServices/2011/OrganizationData.svc/";
    _errorHandler: function (req) {
    return new Error("Error : " +
    req.status + ": " +
    req.statusText + ": " +
    JSON.parse(req.responseText).error.message.value);
    _dateReviver: function (key, value) {
    var a;
    if (typeof value === 'string') {
    a = /Date\(([-+]?\d+)\)/.exec(value);
    if (a) {
    return new Date(parseInt(value.replace("/Date(", "").replace(")/", ""), 10));
    return value;
    Create: function (object, type, successCallback, errorCallback) {
    var req = new XMLHttpRequest();
    req.open("POST", this._ODataPath() + type + "Set", true);
    req.setRequestHeader("Accept", "application/json");
    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
    req.onreadystatechange = function () {
    if (this.readyState == 4 /* complete */) {
    if (this.status == 201) {
    successCallback(JSON.parse(this.responseText, SDK.JScriptRESTDataOperations._dateReviver).d);
    else {
    errorCallback(SDK.JScriptRESTDataOperations._errorHandler(this));
    req.send(JSON.stringify(object));
    Retrieve: function (id, type, successCallback, errorCallback) {
    var req = new XMLHttpRequest();
    req.open("GET", this._ODataPath() + type + "Set(guid'" + id + "')", true);
    req.setRequestHeader("Accept", "application/json");
    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
    req.onreadystatechange = function () {
    if (this.readyState == 4 /* complete */) {
    if (this.status == 200) {
    successCallback(JSON.parse(this.responseText, SDK.JScriptRESTDataOperations._dateReviver).d);
    else {
    errorCallback(SDK.JScriptRESTDataOperations._errorHandler(this));
    req.send();
    Update: function (id, object, type, successCallback, errorCallback) {
    var req = new XMLHttpRequest();
    req.open("POST", this._ODataPath() + type + "Set(guid'" + id + "')", true);
    req.setRequestHeader("Accept", "application/json");
    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
    req.setRequestHeader("X-HTTP-Method", "MERGE");
    req.onreadystatechange = function () {
    if (this.readyState == 4 /* complete */) {
    if (this.status == 204 || this.status == 1223) {
    successCallback();
    else {
    errorCallback(SDK.JScriptRESTDataOperations._errorHandler(this));
    req.send(JSON.stringify(object));
    Delete: function (id, type, successCallback, errorCallback) {
    var req = new XMLHttpRequest();
    req.open("POST", this._ODataPath() + type + "Set(guid'" + id + "')", true);
    req.setRequestHeader("Accept", "application/json");
    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
    req.setRequestHeader("X-HTTP-Method", "DELETE");
    req.onreadystatechange = function () {
    if (this.readyState == 4 /* complete */) {
    if (this.status == 204 || this.status == 1223) {
    successCallback();
    else {
    errorCallback(SDK.JScriptRESTDataOperations._errorHandler(this));
    req.send();
    RetrieveMultiple: function (type, filter, successCallback, errorCallback) {
    if (filter != null) {
    filter = "?" + filter;
    else { filter = ""; }
    var req = new XMLHttpRequest();
    req.open("GET", this._ODataPath() + type + "Set" + filter, true);
    req.setRequestHeader("Accept", "application/json");
    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
    req.onreadystatechange = function () {
    if (this.readyState == 4 /* complete */) {
    if (this.status == 200) {
    successCallback(JSON.parse(this.responseText, SDK.JScriptRESTDataOperations._dateReviver).d.results);
    else {
    errorCallback(SDK.JScriptRESTDataOperations._errorHandler(this));
    req.send();
    __namespace: true
    </script>
    <script type="text/javascript">
    //Create Email and link it with Order as Regarding field
    var Xrm;
    var email = new Object();
    var ownerID = "";
    var CustomerId = "";
    if (window.opener) { Xrm = window.opener.Xrm; }
    else if (window.parent) { Xrm = window.parent.Xrm; }
    //Get ownerid who send email of quotation to customer
    function GetOwnerID() {
    var owner = Xrm.Page.getAttribute("ownerid").getValue();
    ownerID = owner[0].id;
    var ownerName = owner[0].name;
    var entityType = owner[0].entityType;
    GetToEmailGUID();
    //Get customerid who receive email of quotation from owner
    function GetToEmailGUID() {
    var Customer = Xrm.Page.getAttribute('customerid').getValue();
    CustomerId = Customer[0].id;
    var CustomerName = Customer[0].name;
    var entityType = Customer[0].entityType;
    //if CustomerId is type of "Account" then get Primary Contact id of that account
    if (entityType == "account") {
    var contact = Xrm.Page.getAttribute("customerid").getValue();
    if (contact === null) return;
    var serverUrl = Xrm.Page.context.getClientUrl();
    var oDataSelect = serverUrl + "/XRMServices/2011/OrganizationData.svc/AccountSet(guid'" + contact[0].id + "')?$select=PrimaryContactId";
    var req = new XMLHttpRequest();
    req.open("GET", oDataSelect, false);
    req.setRequestHeader("Accept", "application/json");
    req.setRequestHeader("Content-Type", "application/json;charset=utf-8");
    req.onreadystatechange = function () {
    if (req.readyState === 4) {
    if (req.status === 200) {
    var retrieved = JSON.parse(req.responseText).d;
    CustomerId = retrieved.PrimaryContactId.Id;
    else {
    alert(this.statusText);
    req.send();
    function CreateEmail() {
    GetOwnerID();
    email.Subject = "Email with Report Attachment";
    //Set The current order as the Regarding object
    email.RegardingObjectId = {
    Id: Xrm.Page.data.entity.getId(), //Get the current entity Id , here OrderId
    LogicalName: Xrm.Page.data.entity.getEntityName()//Get the current entity name, here it will be “salesOrder”
    //Create Email Activity
    SDK.JScriptRESTDataOperations.Create(email, "Email", EmailCallBack, function (error) { alert(error.message); });
    // Email Call Back function
    function EmailCallBack(result) {
    email = result; // Set the email to result to use it later in email attachment for retrieving activity Id
    var activityPartyFrom = new Object();
    // Set the From party of the ActivityParty to relate an entity with Email From field
    activityPartyFrom.PartyId = {
    Id: CustomerId, //"79EBDD26-FDBE-E311-8986-D89D6765B238", // id of entity you want to associate this activity with.
    LogicalName: "contact"
    // Set the "activity" of the ActivityParty
    activityPartyFrom.ActivityId = {
    Id: result.ActivityId,
    LogicalName: "email"
    // Now set the participation type that describes the role of the party on the activity).
    activityPartyFrom.ParticipationTypeMask = { Value: 2 }; // 2 means ToRecipients
    // Create the from ActivityParty for the email
    SDK.JScriptRESTDataOperations.Create(activityPartyFrom, "ActivityParty", ActivityPartyFromCallBack, function (error) { alert(error.message); });
    var activityPartyTo = new Object();
    // Set the From party of the ActivityParty to relate an entity with Email From field
    activityPartyTo.PartyId = {
    Id: ownerID, //"79EBDD26-FDBE-E311-8986-D89D6765B238", // id of entity you want to associate this activity with.
    LogicalName: "systemuser"
    // Set the "activity" of the ActivityParty
    activityPartyTo.ActivityId = {
    Id: result.ActivityId,
    LogicalName: "email"
    // Now set the participation type that describes the role of the party on the activity).
    activityPartyTo.ParticipationTypeMask = { Value: 1 }; // 1 means Sender
    // Create the from ActivityParty
    SDK.JScriptRESTDataOperations.Create(activityPartyTo, "ActivityParty", ActivityPartyToCallBack, function (error) { alert(error.message); });
    //ActivityParty From Callback
    function ActivityPartyFromCallBack(result) {
    //ActivityParty To Callback
    function ActivityPartyToCallBack(result) {
    GetReportId('Quotation');
    //Create attachment for the created email
    function CreateEmailAttachment() {
    //get reporting session and use the params to convert a report in PDF
    var params = getReportingSession();
    //Email attachment parameters
    var activitymimeattachment = Object();
    activitymimeattachment.ObjectId = Object();
    activitymimeattachment.ObjectId.LogicalName = "email";
    activitymimeattachment.ObjectId.Id = email.ActivityId;
    activitymimeattachment.ObjectTypeCode = "email",
    activitymimeattachment.Subject = "File Attachment";
    activitymimeattachment.Body = encodePdf(params);
    activitymimeattachment.FileName = "Report.pdf";
    activitymimeattachment.MimeType = "application/pdf";
    //Attachment call
    SDK.JScriptRESTDataOperations.Create(activitymimeattachment, "ActivityMimeAttachment", ActivityMimeAttachmentCallBack, function (error) { alert(error.message); });
    //ActivityMimeAttachment CallBack function
    function ActivityMimeAttachmentCallBack(result) {
    var features = "location=no,menubar=no,status=no,toolbar=no,resizable=yes";
    var width = "800px";
    var height = "600px";
    window.open(Xrm.Page.context.getServerUrl() + "main.aspx?etc=" + 4202 + "&pagetype=entityrecord&id=" + email.ActivityId, "_blank", features);
    // To open window which works in outlook and IE both
    //openStdWin(Xrm.Page.context.getServerUrl() + "main.aspx?etc=" + 4202 + "&pagetype=entityrecord&id=" + email.ActivityId, "_blank", width, height, features);
    //This method will get the reportId based on a report name that will be used in getReportingSession() function
    function GetReportId(reportName) {
    var oDataSetName = "ReportSet";
    var columns = "ReportId";
    var filter = "Name eq '" + reportName + "'";
    retrieveMultiple(oDataSetName, columns, filter, onSuccess);
    function retrieveMultiple(odataSetName, select, filter, successCallback) {
    var serverUrl = Xrm.Page.context.getServerUrl();
    var ODATA_ENDPOINT = "/XRMServices/2011/OrganizationData.svc";
    var odataUri = serverUrl + ODATA_ENDPOINT + "/" + odataSetName + "?";
    if (select) {
    odataUri += "$select=" + select + "&";
    if (filter) {
    odataUri += "$filter=" + filter;
    $.ajax({
    type: "GET",
    contentType: "application/json; charset=utf-8",
    datatype: "json",
    url: odataUri,
    beforeSend: function (XMLHttpRequest) {
    XMLHttpRequest.setRequestHeader("Accept", "application/json");
    success: function (data) {
    if (successCallback) {
    if (data && data.d && data.d.results) {
    successCallback(data.d.results);
    else if (data && data.d) {
    successCallback(data.d);
    else {
    successCallback(data);
    error: function (XmlHttpRequest, errorThrown) {
    if (XmlHttpRequest && XmlHttpRequest.responseText) {
    alert("Error while retrieval ; Error – " + XmlHttpRequest.responseText);
    function onSuccess(data) {
    reportId = data[0].ReportId.replace('{', ").replace('}', ");
    CreateEmailAttachment(); // Create Email Attachment
    //Gets the report contents
    function getReportingSession() {
    var pth = Xrm.Page.context.getServerUrl() + "/CRMReports/rsviewer/reportviewer.aspx";
    var retrieveEntityReq = new XMLHttpRequest();
    var Id = Xrm.Page.data.entity.getId();
    var quotationGUID = Id.replace('{', ""); //set this to selected quotation GUID
    quotationGUID = quotationGUID.replace('}', "");
    var reportName = "Quotation"; //set this to the report you are trying to download
    var reportID = "7C39D18F-1DC6-E311-8986-D89D6765B238"; //set this to the guid of the report you are trying to download
    var rptPathString = ""; //set this to the CRMF_Filtered parameter
    var strParameterXML = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'><entity name='quote'><all-attributes /><filter type='and'><condition attribute='quoteid' operator='eq' uitype='quote' value='" + quotationGUID + "' /> </filter></entity></fetch>";
    retrieveEntityReq.open("POST", pth, false);
    retrieveEntityReq.setRequestHeader("Accept", "*/*");
    retrieveEntityReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    rptPathString = "id=%7B" + reportID + "%7D&uniquename=" + Xrm.Page.context.getOrgUniqueName() + "&iscustomreport=true&reportnameonsrs=&reportName=" +
    reportName + "&isScheduledReport=false&p:CRMAF_Filteredquote=" + strParameterXML;
    //remove the part starting from &p:salesorderid if your report has no parameters
    retrieveEntityReq.send(rptPathString);
    var x = retrieveEntityReq.responseText.indexOf("ReportSession=");
    var ret = new Array();
    ret[0] = retrieveEntityReq.responseText.substr(x + 14, retrieveEntityReq.responseText.indexOf("&", x) - x - 14); //the session id
    x = retrieveEntityReq.responseText.indexOf("ControlID=");
    ret[1] = retrieveEntityReq.responseText.substr(x + 10, retrieveEntityReq.responseText.indexOf("&", x) - x - 10); //the control id
    return ret;
    var bdy = new Array();
    var bdyLen = 0;
    function concat2Bdy(x) {
    bdy[bdyLen] = x;
    bdyLen++;
    function encodePdf(params) {
    bdy = new Array();
    bdyLen = 0;
    var retrieveEntityReq = new XMLHttpRequest();
    var pth = Xrm.Page.context.getServerUrl() + "/Reserved.ReportViewerWebControl.axd?ReportSession=" + params[0] +
    "&Culture=1033&CultureOverrides=True&UICulture=1033&UICultureOverrides=True&ReportStack=1&ControlID=" + params[1] +
    "&OpType=Export&FileName=Public&ContentDisposition=OnlyHtmlInline&Format=PDF";
    retrieveEntityReq.open("GET", pth, false);
    retrieveEntityReq.setRequestHeader("Accept", "*/*");
    retrieveEntityReq.send();
    BinaryToArray(retrieveEntityReq.responseBody);
    return encode64(bdy);
    var StringMaker = function () {
    this.parts = [];
    this.length = 0;
    this.append = function (s) {
    this.parts.push(s);
    this.length += s.length;
    this.prepend = function (s) {
    this.parts.unshift(s);
    this.length += s.length;
    this.toString = function () {
    return this.parts.join('');
    var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
    function encode64(input) {
    var output = new StringMaker();
    var chr1, chr2, chr3;
    var enc1, enc2, enc3, enc4;
    var i = 0;
    while (i < input.length) {
    chr1 = input[i++];
    chr2 = input[i++];
    chr3 = input[i++];
    enc1 = chr1 >> 2;
    enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
    enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
    enc4 = chr3 & 63;
    if (isNaN(chr2)) {
    enc3 = enc4 = 64;
    } else if (isNaN(chr3)) {
    enc4 = 64;
    output.append(keyStr.charAt(enc1) + keyStr.charAt(enc2) + keyStr.charAt(enc3) + keyStr.charAt(enc4));
    return output.toString();
    </script>
    <script type="text/vbscript">
    Function BinaryToArray(Binary)
    Dim i
    ReDim byteArray(LenB(Binary))
    For i = 1 To LenB(Binary)
    byteArray(i-1) = AscB(MidB(Binary, i, 1))
    concat2Bdy(AscB(MidB(Binary, i, 1)))
    Next
    BinaryToArray = byteArray
    End Function
    </script>
    </head>
    <body>
    <input type="button" onclick="CreateEmail();" value="Attach Report" />
    </body>
    </html>
    Thank you,
    Mittal.

  • Report Generation Toolkit Excel Vi's do not run after creating an executable​. What am I missing?

    I have labview 8.5 and Report Generation Toolkit version 1.1.2.   My vi works fine during development. When I make an executable or an installer the excel vi's do not work. I have seen this question posted before but it has always been for earlier revisions and the answers do not seem to apply with 8.5 and 1.1.2. 

    Hello ajh,
    You will have to include Dynamic VIs in the executable you build. The following link has more information:
    http://digital.ni.com/public.nsf/allkb/C38CE3F3054​2D65B86256F0E00740DD8
    Prashant.

  • Open VI Reference Error in the executable version only

    Hello folks! I am having a strange issue since I updated to Labview 2014: I have a vi that uses "Open VI Reference" in order to programmatically open the desired vi. It worked flawless also in the compiled version (.exe) of the program until yesterday, when i compiled it again for the first time since my update to Labview 2014. It compiles with no problem, but when i start the exe and load the first vi it already gives me an error "Built Application or Shared Library (DLL): Missing".
    The point is that all the VIs that i want to open are inside an LLB that is supposed to be compiled inside the .exe: infact the path that i use to open is:
    D:\LabVIEW Data\builds\Sequenzer\Sequenzer2.0.exe\com_lv_sequenzer\trunk\Sequenzer_Functions.llb\Seq_Connect_to_Database.vi
    And i get error number 7:
    Open VI Reference in Seq_Function_Interface.vi->Sequenzer_Main_2.0.vi<APPEND>
    VI Path: <b>D:\LabVIEW Data\builds\Sequenzer\Sequenzer2.0.exe\com_lv_sequenzer\trunk\Sequenzer_Functions.llb\Seq_Connect_to_Database.vi</b>
    Built Application or Shared Library (DLL): Make sure all dynamically loaded VIs were properly included in the build specification for the application or shared library.
    LabVIEW Real-Time: VIs built into executables cannot be accessed through VI Server calls. Use Source Distributions to dynamically call VIs on Real-Time targets.
    The vi Seq_Connect_to_Database.vi is included in my built (as you can see in the attached screenshot and as it has always been).
    Do you have an idea of why it is not working anymore?
    Thanks a lot in advance!
    Dario Cassaniti
    Solved!
    Go to Solution.
    Attachments:
    sequenzer.png ‏86 KB

    OK, here is where I am confused. You talk about including the llb in the build, but in the screen shot you show a bunch of individual VIs being included. Next, in source file settings where are you telling the app builder to store all those individual VIs? Because they are VIs LabVIEW will, by default, want to put them in the executable somewhere.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Memory usage of excel stays high after Macro is executed and excel crashes after trying to close it

    Hi,
    I'm trying to resolve an issue with an excel based tool. The macros retrieve data from an Oracle database and do calculations with the data. They also open and write into files in the same directory. The macros all run and finish the calculations. I can
    continue to use and modify the sheet. I can also close the workbook, however excel memory usage I see in the windows Task manager stays elevated.If I  close Excel it says: Excel stopped working and then it tries to recover information...
    I assume something in the macro did not finish properly and memory was not released. I would like to check what is still open (connection, stream or any other object) when I close the workbook I would like to have a list of all still used memory. Is there
    a possibility to do so.
    Here the code I'm using, its reduced to functions which open something. Functions   
    get_v_tools() and get_change_tools() are same as get_client_positions().
    Public conODBC As New ADODB.Connection
    Public myPath As String
    Sub get_positions()
    Dim Src As range, dst As range
    Dim lastRow As Integer
    Dim myPath As String
    lastRow = Sheets("SQL_DATA").Cells(Sheets("SQL_DATA").rows.Count, "A").End(xlUp).Row
    Sheets("SQL_DATA").range("A2:AD" & lastRow + 1).ClearContents
    Sheets("SQL_DATA").range("AG2:BE" & lastRow + 2).ClearContents
    Sheets("SQL_DATA").range("AE3:AF" & lastRow + 2).ClearContents
    k = Sheets("ToolsList").Cells(Sheets("ToolsList").rows.Count, "A").End(xlUp).Row + 1
    Sheets("ToolsList").range("A2:M" & k).ClearContents
    'open connection
    Call open_connection
    lastRow = Sheets("SQL_DATA").Cells(Sheets("SQL_DATA").rows.Count, "A").End(xlUp).Row
    If lastRow < 2 Then GoTo ErrorHandling
    'copy bs price check multiplications
    Set Src = Sheets("SQL_DATA").range("AE2:AF2")
    Set dst = Worksheets("SQL_DATA").range("AE2").Resize(lastRow - 1, Src.columns.Count)
    dst.Formula = Src.Formula
    On Error GoTo ErrorHandling
    'new prices are calculated
    newPrice_calculate (lastRow)
    Calculate
    myPath = ThisWorkbook.Path
    'Refresh pivot table in Position Manager
    Sheets("Position Manager").PivotTables("PivotTable3").ChangePivotCache ActiveWorkbook. _
    PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
    myPath & "\[Position_Manager_v1.0.xlsm]SQL_DATA!R1C2:R" & lastRow & "C31" _
    , Version:=xlPivotTableVersion14)
    ErrorHandling:
    Set Src = Nothing
    Set dst = Nothing
    If conODBC.State <> 0 Then
    conODBC.Close
    End If
    End Sub
    Sub open_connection()
    Dim sql_data, sql_data_change, sql_data_v As Variant
    Dim wdth, TotalColumns, startRow As Integer
    Dim rst As New ADODB.Recordset
    Errorcode = 0
    On Error GoTo ErrorHandling
    Errorcode = 1
    With conODBC
    .Provider = "OraOLEDB.Oracle.1"
    .ConnectionString = "Password=" & pswrd & "; Persist Security Info=True;User ID= " & UserName & "; Data Source=" & DataSource
    .CursorLocation = adUseClient
    .Open
    .CommandTimeout = 300
    End With
    startRow = Sheets("SQL_DATA").Cells(Sheets("SQL_DATA").rows.Count, "A").End(xlUp).Row + 1
    sql_data = get_client_positions(conODBC, rst)
    wdth = UBound(sql_data, 1)
    Sheets("SQL_DATA").range("A" & startRow & ":AA" & wdth + startRow - 1).Value = sql_data
    'Run change tools instruments
    startRow = Sheets("ToolsList").Cells(Sheets("ToolsList").rows.Count, "A").End(xlUp).Row + 1
    sql_data_change = get_change_tools(conODBC, rst)
    wdth = UBound(sql_data_change, 1)
    Sheets("ToolsList").range("A" & startRow & ":M" & wdth + startRow - 1).Value _
    = sql_data_change
    'open SQL for V tools instruments
    startRow = Sheets("ToolsList").Cells(Sheets("ToolsList").rows.Count, "A").End(xlUp).Row + 1
    sql_data_v = get_v_tools(conODBC, rst)
    wdth = UBound(sql_data_v, 1)
    Sheets("ToolsList").range("A" & startRow & ":L" & startRow + wdth - 1).Value = sql_data_v
    conODBC.Close
    ErrorHandling:
    If rst.State <> 0 Then
    rst.Close
    End If
    Set rst = Nothing
    End Sub
    Private Function get_client_positions(conODBC As ADODB.Connection, rst_posi As ADODB.Recordset) As Variant
    Dim sql_data As Variant
    Dim objCommand As ADODB.Command
    Dim sql As String
    Dim records, TotalColumns As Integer
    On Error GoTo ErrorHandling
    Set objCommand = New ADODB.Command
    sql = read_sql()
    With objCommand
    .ActiveConnection = conODBC 'connection for the commands
    .CommandType = adCmdText
    .CommandText = sql 'Sql statement from the function
    .Prepared = True
    .CommandTimeout = 600
    End With
    Set rst_posi = objCommand.Execute
    TotalColumns = rst_posi.Fields.Count
    records = rst_posi.RecordCount
    ReDim sql_data(1 To records, 1 To TotalColumns)
    If TotalColumns = 0 Or records = 0 Then GoTo ErrorHandling
    If TotalColumns <> 27 Then GoTo ErrorHandling
    If rst_posi.EOF Then GoTo ErrorHandling
    l = 1
    Do While Not rst_posi.EOF
    For i = 0 To TotalColumns - 1
    sql_data(l, i + 1) = rst_posi.Fields(i)
    Next i
    l = l + 1
    rst_posi.MoveNext
    Loop
    ErrorHandling:
    rst_posi.Close
    Set rst_posi = Nothing
    Set objCommand = Nothing
    get_client_positions = sql_data
    End Function
    Private Function read_sql() As String
    Dim sqlFile As String, sqlQuery, Line As String
    Dim query_dt As String, client As String, account As String
    Dim GRP_ID, GRP_SPLIT_ID As String
    Dim fso, stream As Object
    Set fso = CreateObject("Scripting.FileSystemObject")
    client = Worksheets("Cover").range("C9").Value
    query_dt = Sheets("Cover").range("C7").Value
    GRP_ID = Sheets("Cover").range("C3").Value
    GRP_SPLIT_ID = Sheets("Cover").range("C5").Value
    account = Sheets("Cover").range("C11").Value
    sqlFile = Sheets("Cover").range("C15").Value
    Open sqlFile For Input As #1
    Do Until EOF(1)
    Line Input #1, Line
    sqlQuery = sqlQuery & vbCrLf & Line
    Loop
    Close
    ' Replace placeholders in the SQL
    sqlQuery = Replace(sqlQuery, "myClent", client)
    sqlQuery = Replace(sqlQuery, "01/01/9999", query_dt)
    sqlQuery = Replace(sqlQuery, "54747743", GRP_ID)
    If GRP_SPLIT_ID <> "" Then
    sqlQuery = Replace(sqlQuery, "7754843", GRP_SPLIT_ID)
    Else
    sqlQuery = Replace(sqlQuery, "AND POS.GRP_SPLIT_ID = 7754843", "")
    End If
    If account = "ZZ" Then
    sqlQuery = Replace(sqlQuery, "AND AC.ACCNT_NAME = 'ZZ'", "")
    Else
    sqlQuery = Replace(sqlQuery, "ZZ", account)
    End If
    ' Create a TextStream to check SQL Query
    sql = sqlQuery
    myPath = ThisWorkbook.Path
    Set stream = fso.CreateTextFile(myPath & "\SQL\LastQuery.txt", True)
    stream.Write sql
    stream.Close
    Set fso = Nothing
    Set stream = Nothing
    read_sql = sqlQuery
    End Function

    Thanks Starain,
    that's what I did the last days and found that the problem is in the
    newPrice_calculate (lastRow)
    function. This function retrieves data (sets it as arrays) which was correctly pasted into the sheet, loops through all rows and does math/calendar calculations with cell values using an Add-In("Quantlib")
    Public errorMessage as String
    Sub newPrice_calculate(lastRow)
    Dim Type() As Variant
    Dim Id() As Variant
    Dim Price() As Variant
    Dim daysTo() As Variant
    Dim fx() As Variant
    Dim interest() As Variant
    Dim ObjCalend as Variant
    Dim newPrice as Variant
    On Error GoTo Catch
    interest = Sheets("SQL_DATA").range("V2:V" & lastRow).Value
    Type = Sheets("SQL_DATA").range("L2:L" & lastRow).Value Id = Sheets("SQL_DATA").range("M2:M" & lastRow).Value Price = Sheets("SQL_DATA").range("T2:T" & lastRow).Value
    daysTo = Sheets("SQL_DATA").range("K2:K" & lastRow).Value
    fx = Sheets("SQL_DATA").range("U2:U" & lastRow).Value
    qlError = 1
    For i = 2 To lastRow
    If (i, 1) = "LG" Then
    'set something - nothing spectacular like
    interest(i, 1) = 0
    daysTo(i , 1) = 0
    Else
    adjTime = Sqr(daysTo(i, 1) / 365)
    ObjCalend(i,1) =Application.Run("qlCalendarHolidaysList", _
    "CalObj", ... , .... other input parameters)
    If IsError(ObjCalend(i,1)) Then GoTo Catch
    'other calendar calcs
    newPrice(i,1) = Application.Run( 'quantLib calcs)
    End If
    Catch:
    Select Case qlError
    Case 1
    errorMessage = errorMessage & " QuantLibXL Cal Error at: " & i & " " & vbNewLine & Err.Description
    ObjCalend(i,1) (i, 1) = "N/A"
    End Select
    Next i
    Sheets("SQL_DATA").range("AB2:AB" & lastRow).Value = newPrice
    'Sheets("SQL_DATA").range("AA2:AA" & lastRow).Value = daysTo
    ' erase and set to nothing all arrays and objects
    Erase Type
    Erase id
    Erase Price
    Set newPrice = Nothing
    Is there a possibility to clean everything in:
    Private Sub Workbook_BeforeClose(Cancel As Boolean)
    End Sub
    Thanks in advance
    Mark

  • Background job - not sure if its executed in BG

    Hi,
    I wanted to submit my program in background and have used
    Job_open, Job_sumbit, Job_close FM's.
    I have passed following parameters.
    Job_open - jobgroup, jobname,sy-datum, sy-timlo
    job_submit- sy-uname, jobcount,jobname,sy-langu, sy-repid
    Joc_close-jobcount,jobname,sy-datum,sy-timlo.
    My program doesn't show any error.
    But I am not sure if it's really executing in background....how to find out?
    I have checked in SM37 and my
    duration time is 0 
    delay time is 25 secs
    status - released
    startdate & time is empty.
    Does this mean it never ran in background?
    Plz help

    Hei ....
    After passing immediate start in job_close.....
    In SM37 i have
    Status as : canceled.
    have start time
    have start date.
    duration as 567
    delay as 60 secs.
    which is better that what i have done previously....Now i get the duration time, start date, start time.
    How can i escape from "canceled"?
    thanks

  • How can I execute an external program from within a button's event handler?

    I am using Tomcat ApacheTomcat 6.0.16 with Netbeans 6.1 (with the latest JDK/J2EE)
    I need to execute external programs from an event handler for a button on a JSF page (the program is compiled, and extremely fast compared both to plain java and especially stored procedures written in SQL).
    I tried what I'd do in a standalone program (as shown in the appended code), but it didn't work. Instead I received text saying the program couldn't be found. This error message comes even if I try the Windows command "dir". I thought with 'dir' I'd at least get the contents of the current working directory. :-(
    I can probably get by with cgi on Apache's httpd server (or, I understand tomcat supports cgi, but I have yet to get that to work either), but whatever I do I need to be able to do it from within the button's event handler. And if I resort to cgi, I must be able to maintain session jumping from one server to the other and back.
    So, then, how can I do this?
    Thanks
    Ted
    NB: The programs that I need to run do NOT take input from the user. Rather, my code in the web application processes user selections from selection controls, and a couple field controls, sanitizes the inoputs and places clean, safe data in a MySQL database, and then the external program I need to run gets safe data from the database, does some heavy duty number crunching, and puts the output data into the database. They are well insulated from mischeif.
    NB: In the following array_function_test.pl was placed in the same folder as the web application's jsp pages, (and I'd tried WEB-INF - with the same result), and I DID see the file in the application's war file.
            try {
                java.lang.ProcessBuilder pn = new java.lang.ProcessBuilder("array_function_test.pl");
                //pn.directory(new java.io.File("K:\\work"));
                java.lang.Process pr = pn.start();
                java.io.BufferedInputStream bis = (java.io.BufferedInputStream)pr.getInputStream();
                String tmp = new String("");
                byte b[] = new byte[1000];
                int i = 0;
                while (i != -1) {
                    bis.read(b);
                    tmp += new String(b);
                getSelectionsDisplayTextArea().setText(getSelectionsDisplayTextArea().getText() + "\n\n" + tmp);
            } catch (java.io.IOException ex) {
                getSelectionsDisplayTextArea().setText(getSelectionsDisplayTextArea().getText() + "\n\n" + ex.getMessage());
            }

    Hi Fonsi!
    One way to execute an external program is to use the System Exec.vi. You find it in the functions pallet under Communication.
    /Thomas

  • How can i execute ejb method in a servlet?

    hi
    I am using a IBM HTTP Server and Weblogic Server.
    I could execute below source in a main method of application but i could not that in a init method of servlet because of ClassCastException.
    (a classpath of weblogic contains client's classpath)
    // source code
    Hashtable props = new Hashtable();
    props.pu(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    props.put(Context.PROVIDER_URL,
    "t3://192.168.1.5:7001");
    Context ctx = new InitialContext(props);
    Object obj = ctx.lookup("session.LigerSessionHome");
    LigerSessionHome home = (LigerSessionHome) PortableRemoteObject.narrow (obj, LigerSessionHome.class);
    // error code
    Exception : session.LigerSessionBeanHomeImpl_ServiceStub
    java.lang.ClassCastException: session.LigerSessionBeanHomeImpl_ServiceStub
    at com.ibm.rmi.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:253)
    at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:136)
    at credit.getCreditResearch(credit.java:41)
    at creditResearchClient.doGet(creditResearchClient.java:122)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
    thanks

    Have your stubs somehow got out of sync? So that your Servlet engine is pointing to a different jar than that of your jvm on which you were running your client application
    hi
    I am using a IBM HTTP Server and Weblogic Server.
    I could execute below source in a main method of
    application but i could not that in a init method of
    servlet because of ClassCastException.
    (a classpath of weblogic contains client's classpath)
    // source code
    Hashtable props = new Hashtable();
    props.pu(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    props.put(Context.PROVIDER_URL,
    "t3://192.168.1.5:7001");
    Context ctx = new InitialContext(props);
    Object obj = ctx.lookup("session.LigerSessionHome");
    LigerSessionHome home = (LigerSessionHome)
    PortableRemoteObject.narrow (obj,
    LigerSessionHome.class);
    // error code
    Exception :
    session.LigerSessionBeanHomeImpl_ServiceStub
    java.lang.ClassCastException:
    session.LigerSessionBeanHomeImpl_ServiceStub
    at
    com.ibm.rmi.javax.rmi.PortableRemoteObject.narrow(Porta
    leRemoteObject.java:253)
    at
    javax.rmi.PortableRemoteObject.narrow(PortableRemoteObj
    ct.java:136)
    at credit.getCreditResearch(credit.java:41)
    at
    creditResearchClient.doGet(creditResearchClient.java:12
    at
    javax.servlet.http.HttpServlet.service(HttpServlet.java
    740)
    at
    javax.servlet.http.HttpServlet.service(HttpServlet.java
    865)
    thanks

  • Error in executing a process for compilation for jsp

    We have an iView which has jsp pages in it. We deployed the par & try toaccess the iview & we get an exception. The issue is that the iview has a jsp page. At the run time, this jsp is converted into a .java file
    without problem. But EP engine is having issues compiling this java fileinto .class file.
    On the other hand this same iview works just fine on our windows installation. Only Solaris EP install is having problems. The version onwindows as well as on Solaris is EP6 SP9.
    Here is the exact version on the solaris EP:
    sap.com/SAP-JEECOR 6.40 SP9 (1000.6.40.9.0.20041119045253) 20041122132733
    sap.com/SAP-JEE 6.40 SP9 (1000.6.40.9.0.20041119045409) 20041122132741
    When I copy the .class file from windows to unix machine, the iView works fine. Here is the exception I am getting:
    >>> JSPCompiler >>> error
    [email protected]a188b
    [EXCEPTION]
    com.sapportals.portal.prt.servlets_jsp.server.compiler.CompilingException:
    Error in executing a process for compilation
    at
    com.sapportals.portal.prt.servlets_jsp.server.compiler.impl.J2eeCompiler_6_30.launchCompilerProcess(J2eeCompiler_6_30.java:574)
    at
    com.sapportals.portal.prt.servlets_jsp.server.compiler.impl.J2eeCompiler_6_30.compileExternal(J2eeCompiler_6_30.java:370)
    at
    com.sapportals.portal.prt.servlets_jsp.server.compiler.impl.J2eeCompiler_6_30.compile(J2eeCompiler_6_30.java:672)
    at
    com.sapportals.portal.prt.servlets_jsp.server.jsp.JSPParser.parse(JSPParser.java:2143)
    at
    com.sapportals.portal.prt.servlets_jsp.server.jsp.JSPCompiler.compile(JSPCompiler.java:76)
    at
    com.sapportals.portal.prt.servlets_jsp.server.jsp.JSPCompiler.run(JSPCompiler.java:122)
    at
    com.sapportals.portal.prt.core.broker.JSPComponentItem.compileJSP(JSPComponentItem.java:279)
    at
    com.sapportals.portal.prt.core.broker.JSPComponentItem.getComponentInstance(JSPComponentItem.java:129)
    at
    com.sapportals.portal.prt.core.broker.PortalComponentItemFacade.service(PortalComponentItemFacade.java:355)
    at
    com.sapportals.portal.prt.core.broker.PortalComponentItem.service(PortalComponentItem.java:934)
    at
    com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:435)
    at
    com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:527)
    at
    com.sapportals.portal.prt.component.AbstractComponentResponse.include(AbstractComponentResponse.java:89)
    at
    com.sapportals.portal.prt.component.PortalComponentResponse.include(PortalComponentResponse.java:232)
    at com.sapportals.portal.htmlb.page.JSPDynPage.doOutput(JSPDynPage.java:76)
    at
    com.sapportals.htmlb.page.PageProcessor.handleRequest(PageProcessor.java:129)
    at
    com.sapportals.portal.htmlb.page.PageProcessorComponent.doContent(PageProcessorComponent.java:134)
    at
    com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:209)
    at
    com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:114)
    at
    com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
    at
    com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)
    at
    com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)
    at
    com.sapportals.portal.prt.component.PortalComponentResponse.include(PortalComponentResponse.java:215)
    at com.sapportals.portal.prt.pom.PortalNode.service(PortalNode.java:646)
    at
    com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
    at
    com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)
    at
    com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)
    at
    com.sapportals.portal.prt.core.PortalRequestManager.runRequestCycle(PortalRequestManager.java:753)
    at
    com.sapportals.portal.prt.connection.ServletConnection.handleRequest(ServletConnection.java:232)
    at
    com.sapportals.portal.prt.dispatcher.Dispatcher$doService.run(Dispatcher.java:522)
    at java.security.AccessController.doPrivileged(Native Method)
    at
    com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.java:405)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at
    com.sap.engine.services.servlets_jsp.server.servlet.InvokerServlet.service(InvokerServlet.java:153)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at
    com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:385)
    at
    com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:263)
    at
    com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:340)
    at
    com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:318)
    at
    com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:821)
    at
    com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:239)
    at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
    at
    com.sap.engine.services.httpserver.server.Processor.request(Processor.java:147)
    at
    com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:37)
    at
    com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:71)
    at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
    at java.security.AccessController.doPrivileged(Native Method)
    at
    com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:94)
    at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:162)
    I am having the same issue with another iview which has jsp page in it.
    The web dynpro iview works fine.

    Hi, seems like there's some typo in your jsp. Check the .java file listed with a java editor (like eclipse or devstudio.). Maybe you'll find the typo this way faster.
    Most often, a multiline page import hampers jsp compilation,
    e.g.
    <%@page import="java.util.List,
                    java.util.Map"%>
    needs to be
    <%@page import="java.util.List,java.util.Map"%>
    Regards,
    Armin

  • Error in executing a process for compilation

    Hi:
    Our portal version is 6.0.2.28.0 (SAPJ2EE PL29)
    we have the following problem:
    1.- the developer upload a component in portal, but when he tries to run it, the following error appears:
    Mar 28, 2005 4:22:06 PM # Client_Thread_8      Fatal           >>> JSPCompiler >>> ERROR in Compiling :JSPFileInfo :4782283
    JSP File : /usr/sap/J2EE_DP3/j2ee/j2ee_00/cluster/server/services/servlet_jsp/work/jspTemp/irj/root/WEB-INF/portal/portalapps/PRUEBA
    _PCCLibragestMostrarPlantillas/pagelet/MostrarPlantillas.jsp
    Class Name: sapportalsjspMostrarPlantillas
    Java File : /usr/sap/J2EE_DP3/j2ee/j2ee_00/cluster/server/services/servlet_jsp/work/jspTemp/irj/root/WEB-INF/portal/portalapps/PRUEB
    A_PCCLibragestMostrarPlantillas/work/pagelet/_sapportalsjsp_MostrarPlantillas.java
    Package Name : pagelet
    Class File : /usr/sap/J2EE_DP3/j2ee/j2ee_00/cluster/server/services/servlet_jsp/work/jspTemp/irj/root/WEB-INF/portal/portalapps/PRUE
    BA_PCCLibragestMostrarPlantillas/work/pagelet/_sapportalsjsp_MostrarPlantillas.class
    Is out dated : false
    com.sapportals.portal.prt.servlets_jsp.server.compiler.CompilingException: Error in executing a process for compilation
    2.- If I stop/start SAPJ2EE the component, which was uploaded before,can be run without problem, but if you upload it again,when you try to run it again, the compilation error appears
    Any suggestion???
    Thanks

    Hi:
    the problem was not resolved deleting/uploading the components, the problem was resolved increasing the memory in the host and tuning the JVM memory parameters.
    In our host the memory was reduced and this was the origin of the problem
    Thanks

  • Error in executing a process for Flex compilation ....exceeds 32K...

    Hi,
    deployin my model i get the following error-message.
    "Error in executing a process for Flex compilation, Error: Branch between 64935 and 97770 around line 0 exceeds 32K span. If possible, please refactor this component.
    Error: Branch between 64935 and 97770 around line 0 exceeds 32K span."
    Do i delete a sort-element from my model it is deployed very well. So what does this message exactly mean and how can I locate where the error occurs and how can i fix that problem because i need this sort-element to be in my model.
    Thanks for your help!
    Tobias

    Hi Tobias,
    You are receiving this error due to a current limitation in the Flex server. How you can fix this is to split the iView you are currently working on into two iViews, and embed one within the other. This will decrease the size of the current iView you are receiving the error for and eliminate this problem.
    Hope this helps
    Cheers,
    Scott

  • Error while executing script for sharepoint online (office 365) - the remote server returned an error: (503) server unavailable

    error while executing script for sharepoint online (office 365) - the remote server returned an error: (503) server unavailable.
    I am creating many site collections reading records from sharepoint list using powershell in sharepoint online tenant (office 365).
    Few site collections are created and then getting above error so this error record will be skipped then few succeeding record processed then again getting error.
    pattern is like:
    success
    success
    success
    success
    Error
    success
    success
    success
    success
    success
    success
    error
    success

    Hi,
    As it is an online environment, to troubleshoot this issue in an easier way, I suggest you contact Office 365 Support to see if there is any useful information in
    the log files in the server side:
    https://support.office.com/en-us/article/Contact-Office-365-for-business-support-32a17ca7-6fa0-4870-8a8d-e25ba4ccfd4b?ui=en-US&rs=en-US&ad=US
    Best regards
    Patrick Liang
    TechNet Community Support

  • Error while executing a query

    Hi,
    While executing a query in portal it is giving internal server error.
    In the input screen help, we are searchign using wild card characters.I.e "  141",its giving internal server error,
    If we are giving the one value/no value the report is executing correctly.
    The input variable is a heirarchy variable. We tried to give it in the heirarchy format also. Still its not working.
    Could anybody help on this.
    Thanks

    u might be using "select * from <table name>", instead try this
    "select slno as slnod,title as titled.."
    http://www.javagalaxy.com

Maybe you are looking for

  • Data reconciliation

    BI Experts - I am using BI as my data repository to move data from R/3 to BPC. Any suggestions on what I need to look out for? Thanks.

  • Muliple iPods on 1 computer

    I recently bought a 2nd iPod for my girlfriend, and she wanted access to my music library. Our computer is on Windows XP, and we each have our own log in accounts. As per instructions, I created a new Apple account for her under her log in. Then I lo

  • Will the new 3GHz iMac (24") with GeForce 8800 be good for Aperture v2?

    hi all. I've just seen the specs on the new iMac and I'm interested. I was resigned to buying a Mac Pro but found it difficult to justify the cost because I'm not a professional photographer. the new iMac might be good enough at a much more justifiab

  • Express xy graph second plot

    Hi , Im trying to get a second plot on the express XY graph. I've tried some of the suggestions like building the x array twice ( concatanating ?) but this does not seem to work for me. Is there a tutorial on multiple plotting with this beast anywher

  • Copy and Paste from Excel into Xcelsius

    Is it possible to copy data from an excel worksheet and paste it into the Xcelsius worksheet? Thanks! Tracy