Automatic Email with F110

Hi Guru;s,
My client has an requirement for automatic mail shooting to vendor with invoice number when payment is made through F110.Can somebody explain me how it can be achieved.Its a bit urgent.
I know that it would be done through some event SAMPLE_PROCESS_00002040
But can somebody please explain me step by step so that i can understand it well.Moreover how much my job is involved being a functional guy .
Regards
Archit Shukla

Hi,
look and search for:
-payment advise
-Open FI (FIBF) - process 2040
http://help.sap.com/saphelp_47x200/helpdata/en/e7/653749d2d211d29e430000e839cd96/frameset.htm
A.

Similar Messages

  • Automatic email with logon details when user creation

    Hi,
    Does any one can through some light on sending automatic emails with logon details when the users created with SU01? I know we have lot of tools like GRC, Approva we can do but I would like to know any thing within SAP not with any external tools.
    Thanks,
    Venkat

    Quick and easy way without any development:
    a)  Create a variant for report RSUSR100N to search for created user IDs where the creator was not equal to the expected "false positive" ones.
    b) Save a dynamic date and time calculation for the variant.
    c) Define a mail distribution list for the spool request if there is one ...
    d) Schedule the variant periodically as per the dynamic date and time period.
    e) Check that SCOT is configured to send the mail or SMS.
    f) Wait for the mail to be sent (this step might take some time...)
    Cheers,
    Julius

  • Gmail sending automatic emails with calendar updates

    Several coworkers and I have recently switched to iPhone 6's from galaxy S5's.  We use a program called Sync2 to sync our outlook calendars with our phones via a gmail account.  It worked perfectly on the S5, and works fine on the iPhone except that it periodically sens automatic updates from the gmail accounts used to sync the calendars to everyone on the meeting invite list.  Very annoying.  Anyone have any ideas how to stop this?

    Why are you using an intermediary? Where are the calendars hosted? What kind of mail system do you have? If you have Exchange, you should all just be syncing directly with the Exchange server.

  • Automatic Email with timer

    Hello,
    I want to develop coding in java to send email by setting timer of one hour which sends email every one hour to the recepient without clients intervention so can somebody help me in this task.
    thanking you ,
    Bijal Rathod

    Which part are you stuck on?
    A loop using Thread.sleep and JavaMail would be a start.

  • How do i send an email with attachment in PHP?

    Hello,
    I have a form that gets people name, emial, etc. Right now its working correctly, what it does is it sends a email to a seperate email account of the info entered. But what i want to do now is have the person submitting their info to receive an automatic email with an attachment sent to the email they provided. I could really use your help.
    Thank you.
    Here is the PHP script:
      <?php
    if(isset($_POST['email'])) {
    $email_to = "[email protected]";
    $email_subject = "Registration Form";
    function died($error) {
      echo "We are very sorry, but there were error(s) found with the form your submitted. ";
      echo "These errors appear below.<br /><br />";
      echo $error."<br /><br />";
      echo "Please go back and fix these errors.<br /><br />";
      die();
    if(!isset($_POST['first_name']) ||
      !isset($_POST['last_name']) ||
      !isset($_POST['email']) ||
      !isset($_POST['address']) ||
      !isset($_POST['city']) ||
      !isset($_POST['state']) ||
      !isset($_POST['zipcode']) ||
      !isset($_POST['comments'])) {
      died('We are sorry, but there appears to be a problem with the form your submitted.'); 
    $first_name = $_POST['first_name']; // required
    $last_name = $_POST['last_name']; // required
    $email_from = $_POST['email']; // required
    $address = $_POST['address']; // required
    $city = $_POST['city']; // required
    $state = $_POST['state']; // required
    $zipcode = $_POST['zipcode']; // required
    $comments = $_POST['comments']; // required
    $error_message = "";
    $email_exp = "^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$";
      if(!eregi($email_exp,$email_from)) {
       $error_message .= 'The Email Address you entered does not appear to be valid.<br />';
    $string_exp = "^[a-z .'-]+$";
      if(!eregi($string_exp,$first_name)) {
       $error_message .= 'The First Name you entered does not appear to be valid.<br />';
      if(!eregi($string_exp,$last_name)) {
       $error_message .= 'The Last Name you entered does not appear to be valid.<br />';
      if(strlen($error_message) > 0) {
       died($error_message);
    $email_message = "Form details below.\n\n";
    function clean_string($string) {
       $bad = array("content-type","bcc:","to:","cc:","href");
       return str_replace($bad,"",$string);
    $email_message .= "First Name: ".clean_string($first_name)."\n";
    $email_message .= "Last Name: ".clean_string($last_name)."\n";
    $email_message .= "Email: ".clean_string($email_from)."\n";
    $email_message .= "Address: ".clean_string($address)."\n";
    $email_message .= "City: ".clean_string($city)."\n";
    $email_message .= "State: ".clean_string($state)."\n";
    $email_message .= "Zip Code: ".clean_string($zipcode)."\n";
    $email_message .= "Comments: ".clean_string($comments)."\n";
    // create email headers
    $headers = 'From: '.$first_name."\r\n".
    'Reply-To: '.$email_from."\r\n" .
    'X-Mailer: PHP/' . phpversion();
    @mail($email_to, $email_subject, $email_message, $headers); 
    ?>

    Just search for 'php email attachement' and you'll find examples. Here's a few:
    http://www.codewalkers.com/c/a/Email-Code/PHP-Email-Attachment-v1/
    http://www.webcheatsheet.com/php/send_email_text_html_attachment.php
    http://www.devshed.com/c/a/PHP/Handling-Attachments-in-MIME-Email-with-PHP/2/

  • When I click on a link in an email, it does not automatically open the site page? When I receive an email with a link in it, if I click on the link to open the page, nothing happens. It does not open the internet to that page.

    When I click on a link in an email, it does not automatically open the site page?
    When I receive an email with a link in it, if I click on the link to open the page, nothing happens. It does not open the internet to that page.

    I don't appear to have a toolbar either.

  • F110 - Automatic email to vendor when payment run is carried out

    Hi,
    I am trying to configure automatic emails to be sent to vendor when automatic payment run is carried out.
    Please note that i have already carried out the following settings:
    Step 1- Define Std communication method as SMTP (Internet mail) in vendor master               
    Step 2 – Maintain email address via FK02.               
    Step 3 - T-Code BERP – Code to find Find event 00002040 – This is a Function called SAMPLE_PROCESS_00002040, copy with another name i.e. ZSAMPLE_PROCESS_00002040               
    Step 4 – T-Code FIBF -> Option -> Product ->a Customer, Write product name at your choice (for example ZMAIL) and make it active.               
    Step 5 – T-Code FIBIF -> Option ->Process Function (or Module) ->. A Customer.               
    Process = 00002040               
    Module Function = ZSAMPLE_PROCESS_00002040               
    Product = ZMAIL (name of product define by you in step 4)
    it will automatically send mail to vendor provided SCOT is configured.
    However, when i carry out the payment run, email is not generated..
    Can someone please help me out with the above?
    Thanks in advance

    Andi,
    this might help....
    Emailing SAP Remittance advice:
    1.
    For the following process to work SAP Connect needs to be configured for outgoing mail. This is carried out by the Basis team. The t-code is SCOT.
    2.
    <b>Vendor Master Data</b>
    Define ‘Std communication method’ as SMTP (Internet mail) and maintain an email address in the vendor master data.
    3.
    <b>T-Code BERP</b> – Code to find the relevant BTE. Use the Selection Attribute to browse for your business area. In my case, it is AP-Payment Transactions hence FI-AP-AP-PT.
    00002040 is the relevant process. This is a Function called SAMPLE_PROCESS_00002040. In this case, the FM only checks for an email address in the Vendor Master. If more logic is required a Z-version would need to be created.
    4.
    Use t-code FIBF to create the enhancement.
    a)
    Create a product.
    A product groups together customer enhancements to BTE’s developed in the customer's namespace. All customer enhancements assigned to a certain customer product can be released with the Activate Customer Product indicator. The OPEN_FI function module for a certain customer enhancement cannot find the corresponding customer function modules, until this has been done.
    Create the product name (for example ZMAIL) and make it active.
    FIBF->Settings->Products->…of a Customer
    b)
    Assign the BTE to the FM:
    Settings->Process Modules->…of a customer
    Assign the 00002040 process to the FM and Product.
    5.
    At the end of this process when the payment advice program is run, the event will be called and it will automatically send an email to the vendor.
    6.
    Assign an email address to the sap user who will be the outgoing accounting clerk. Define the Accounting Clerk for the outgoing email address:
    SPRO->FI->AR/AP->Vendor Accounts->Master Data->Preparations for Creating Vendor Master Data->Define Accounting Clerks
    hope it helps.

  • Problem in with automatic payment TRANSACTION    f110  transaction

    Hi
    We are facing problem with automatic payment TRANSACTION    f110  transaction  version SAP ECC6.0
    When there are multiple invoices for the same customer with cash  discount amount  given by the user manually( not  cash discount percent)
    For eg if there  5 invoices with cash discount amount
    When there is  payment method defined on document level for some of the  invoices(3) and  2 invoices payment method is not defined on document level(Payment method is defined on customer master  also for those customers )
    The following dumb occurs
    Settlement  will be created, but the F110 cancelled with a shortdump on customer master balance update
    Database error text........: "[IBM][CLI Driver][DB2] UNSUCCESSFUL EXECUTION
      CAUSED BY DEADLOCK OR TIMEOUT. REASON CODE 00C90088, TYPE OF RESOURCE , AND
      RESOURCE NAME"  
    Internal call code.........: "[RSQL/UPDT/KNC1 ]"
    "DBIF_RSQL_SQL_ERROR" "CX_SY_OPEN_SQL_DB"
    "SAPLF005" or "LF005F01"
    "ZAHLVERHALTEN_FORTSCHREIBEN"
    Any help in this is highly appreciated
    Thanks
    Sarath

    1615356     F110 Code improvements
    1255455     F110 Exception BCD_FIELD_OVERFLOW during item output
    1237330     F110 Error if more than one down payment
    1105073     F110: Program termination DBIF_RSQL_SQL_ERROR

  • When I get an email with a pic in and I go to reply a box drops Dow and asks "save photo" when I click on that it "seems" like nothing happens, bot are they being automatically saved someplace, where?

    When I get an email with a pic in and I go to reply a box drops Dow and asks "save photo" when I click on that it "seems" like nothing happens, bot are they being automatically saved someplace, where?

    If photos are saved they go to the Camera Roll in the Photos App.

  • Bug with automatic email retrieval (don't want to ...

    Please tell me where to report bug?
    When I set automatic email retrieval on my N71 after retrieving email phone stay connected and don’t want to disconnect automatically so i need go to inbox and set disconnect.  Its a stupid way of automatic retrieval it suppose to connect, check mail and disconnect. I try it on my N95, same problem. It's spending battery too much. And it’s a big bug.
    Best Regards.

    Hi Rumcajs,
    Any ideas why the connection is not lasting for the day instead of 10-30mn?
    Or let me re-phrase: How can I have the e-mail client on my E75 to pick up e-mails on the e-mail server all day long and instantly as it works for web-browser or using thunderbird client? As a user I want to turn on my phone in the morning and then select the "connect all" option either on my Wi-Fi network or 3G network and then get my e-mails all day long without having to re-connect every 1/2 hour (in my case 5mn).
    I'm using multiple e-mail accounts: my work account (IMAP idle), gmail and windows live.
    If I select the "connect all" option it usually connect to only one of the mailbox and never to the three of them.
    I usually have to repeat the "connect all" operation 3 times. Why and what (if there is one) is the fix so that the connect all does connect to all your e-mail accounts in one go?
    The connect all is an option from the main e-mail screen, where you can see the icons of all your different e-mails accounts and the settings, new and help icons.
    Last, it would be good to be able to use Nokia's "destination" for e-mail account. The "destination" feature work with other application and it is very appreciated to prioritise the connection (Wi-fi 1, Wi-fi 2, ... Wi-fi x,  3G) to use.
    Any ideas if this will be supported soon?
    Regards,
    Benoit 

  • Bursting & Automatic eMailing from EBS with subtemplates

    Howdy,
    We have our purchase orders set up so that with a flag checked our purchasing agents can automatically have the pdf file split by PO number and have each (separate PO) emailed directly to them upon completion of the report (assuming they have an eMail address in EBS). This works fine.
    We also have our purchase orders set up to use several subtemplates for company specific info such as company logos, phone & address info as well as two pages of terms and conditions that optionally can be printed (controlled by an imput parm/flag).
    Okay, bursting works great. The automatic emailing works great. And I can create my POs and view them on line with full terms and conditions great.
    BUT, if I try to including the terms and conditions and burst/email the po shows up in my email normally but without the terms and conditions.
    I suspect it is a problem with the subtemplate, but I am at a loss as the other information that is fed from OTHER subtemplates (phone, address, logo, etc) is all appearing fine in the burst/emailed purchase orders.
    Any ideas why EBS refuses to burst/email my terms and conditions (only)?
    Scott

    issue has been resolved after adding VIP ip information to EBS host, and this is due to missing RAC VIP entries in EBS middle tier.

  • When i get an email with an attachment file it always get saved. Is there a way to not automatically save the attachment?

    When I get an email with a file attachment it is automatically saved to the hard drive. Is there a way to stop that from happening?

    To change that setting go to Mail>Preferences>Accounts>"Advanced" box over in the upper right side of the window>in the line below that that says "Keep Copies of Messages for Offline Viewing:",click on the drop down arrows at the right end of that box just below it and select the phrase "All Messages, but Not Attachments".  It looks like this:

  • When typing an email I need each new sentence to automaticaaly start with a capital letter. At present after a full stop the new sentence automatically starts with a lower case letternot an upper case one

    When typing an email new sentences do not automatically start with a capital letter after a full stop.
    Surely this should happen automatically without the need for me to touch the capital letter icon.
    peter

    peterlesliebabani wrote:
    i called apple and the guy i spoke to said it is probably a VIRUS and it will be corrected on the next update!
    Either you didn't actually call Apple, and got some tech support scammer instead (calling the first number that pops up on a Google search for "Apple support" can give you some bad numbers), or the Apple tech you spoke to didn't know what he's talking about. It's not a virus.
    As for the problem, if you have enabled auto-capitalization and the problem continues, first try resetting your device. Press and hold both the home button and the sleep/wake button for about 10 seconds, until the screen turns off. Ignore the slider that will appear. Release the buttons, then press and hold the sleep/wake button until the Apple logo appears. This is the equivalent of a reboot, and should not affect your data or apps.
    If that doesn't help, try restoring your device from backups, and if that doesn't help, restore it to factory settings (ie, do not restore a backup). See:
    http://support.apple.com/kb/ht1414
    If none of that helps, the issue is caused by some kind of hardware problem, and the device will need to be repaired or (more likely) replaced.

  • C3 - automatic email receiving does not run with G...

    Basically my C3 runs well, but the automatic email receiving, with the internal nokia-mailclient, runs well with WLAN, but not with GPRS!? If I start the client manually, then it works well, but not with the automatic function. When I am on the way, I do not get an information, that I received an email.
    Solved!
    Go to Solution.

    I'm having the same problem, mi phone is not automatically getting the e-mails, I have checked the "when roaming" setting and it is set to "Follow my account setting" so I checked my account setting and the setting for "Update my Inbox" is set to "Very Fast" and the "Alert me only during:" is set from 5.00am to 12.00pm
    Even with all this I can't get the phone to automatically receive the e-mails. If some one could help my all appreciate it.

  • CRM ONLINE 2013: On Approval Of Quotation, Run Report, Generate PDF and Send an Email With PDF as attachment

    Hi,
    I am using CRM ONLINE 2013.
    How to automate below process?
    1. On Approval Of Quotation, Run Report.
    2. Generate PDF.
    3. Send an Email With PDF as attachment.
    As i have gone through many forums for this topic, but creating a plugin code for generating Report PDF is not possible in CRM ONLINE.
    So, What is the alternate way to do this..?
    Thanks.

    This is my entire code mentioned below:-
    <!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" 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('ABM_Infotech_SalesQuote');
            //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 = "Report1.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 = "ABM_Infotech_SalesQuote"; //set this to the report you are trying to download
                var reportID = "751089AA-74B8-E211-B52F-D8D3855B253B"; //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:ABMFilteredQuote=" + 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>

Maybe you are looking for

  • Can I prevent iPhoto 11 from downloading my Flickr photos?

    I'm very pleased to see that uploading photos to Flicker via iPhoto 11 works an awful lot better than it did with iPhoto 9. I still don't like the fact that it's synced - I would prefer it to just upload - but I think I can live with it. What I can't

  • Issues in SharePoint 2013 after Upgrade from SharePoint 2010

    I have recently migrated sharepoint 2010 web applicaiton to 2013 using database attach and detach methods.  I have few issues and just wondering they are issues or not.  I am running in compatible mode in 2013. 1.I am not able to make a copy of any e

  • Weblogic 10.3 Patches

    Yeah got a task to install patches on Weblogic 10.3 Does any one have any idea how to install the patches? Regards -Nar-

  • Could you explain how the read-write-backing-map-scheme is configured in...

    Could you explain how the read-write-backing-map-scheme is configured in the following example? <backing-map-scheme>     <read-write-backing-map-scheme>      <internal-cache-scheme>       <class-scheme>        <class-name>com.tangosol.util.Observable

  • Can you restore from the hidden drive if Windows was written over?

    Hello all, Looking for some help here... I friend brought  me his Lenovo 300 (N100) notebook that he said had a virus on it.  Instead of bringing it to me to fix the virus, he first tried reloading windows (xp) from a standard windows XP disk he had