Converted quotation

Hi,
How I will get the List of Quotations who converted in to sales order. ?
also In that list I want sales order number.
I am not talking about Open , closed or completed quotation list
also I want to ask that is there any report in which in single window I will able to see
Quotation no. - sales order no.- delivery no - Invoice no?
Regards,
Akshay

Hi
Your requirement can be fulfilled by creating a query in SQVI and use the option table join
and also you have to use the following tables
vbak
vbfa
likp
vbrk
OR I THINK U CAN USE THE TABLE VBFA ONLY JUST CHECK
REGARDS

Similar Messages

  • Converting Quotation to Order

    Friends,
    We are using SAP Business One 2004B and have a B2B Portal, and would like to integrate our quotation with our business process.
    Our users would request information online via Internet, (rather fill up a request for quote form)and I would like to use SBO features to insert a new quotation onto the system and give out a proposal.
    Can you let me know on ways of achieving this.
    Regards
    SK
    Merry Christmas & Have a great year ahead!

    Hi Siva
    There is a DI Server for sbo that is based on SOAP technology. It recieves the info in xml in soap messages. This would be the best to use because it has it's own pooling machanism and is great for heavy duty integration. You can the quotes in sbo and by using the sbo mailer you can then e-mail it to the client from within sbo. You can obviously then later convert that sales quote into a order within sbo.
    Hope this helps.

  • Converting quotation point on itunes

    How can I convert my songs wih an explanation point in itunes to mp3 format?

    ] I would rather keep all my music files in the one root directory
    Disable "Keep iTunes Music folder Organized" & "Copy files to iTunes Music folder when adding to Library" in iTunes Preferences, Advanced tab. Future files added to the library will stay right where they came from. The setting for "Music folder location" will only apply to new imports from CD and music purchases through the store. Setting this value to an existing folder of music will not tell iTunes to "discover" the music that already lives there.
    iTunes relies exclusively on ID3 tags. If your files don't include tags, then you need to get a 3rd party tag utility like "Tag & Renamer" or "ID3-TagIt" and get those V2.3 tags loaded into all your files. Those utilities can even generate the tags based on the folder names containing the files.

  • CRM Order - 'Convert to Quote' Button - How to remove?

    Hi team
    Could you please tell me how to disable following in CRM 5.0.
    We create a sales order in CRM, once saved, if I look at details above line items (where there are buttons such as create, delete, atp check etc), I also see a button to 'convert to quote'. If I highlight the line items on the sales order and click this button, then the line item statuses become Quotation (from OPen) and now the button changes to 'convert to order' and if I click this button again, then line item statuses change to 'quotation accepted'
    Line item status profile that we have is standard CRMORDER_I and there are 3 statuses for it. BID Quotation is assisnged to OPen user status.
    Please advise as to how to disable it.
    Regards
    Jai

    Hi Jai,
    If you see the third level customization for the item category. You will find that the subsequent processing is set to reset the quotation.Change that and it will not appear.
    There are two ways to convert quotation items to order items
    1)Creating a follow-up transaction (two separate documents are created)
    2)Changing the item status (particularly in IC) and only one document is created.This is what is happening becuase the subsequent processing is set to reset to quotation in third level customizations
    Hope this would help.
    Regards,
    Rekha Dadwal
    <b>You gain a point for every point that you reward. So reward helpful answers generously <b></b></b>

  • Converting contract to sales order does not auto create schedule lines

    Hi
    When I convert quotation to sales order, then schedule lines get auto created.
    But when I convert contract to sales order, then schedule lines don't be auto created. Instead, a confirmation screen for proposal delivery date pops up for every line item in the sales order.
    Is there any suggestion how can I solve my problem ?
    Thanks..

    Hi,
    In standard SD module, system checks availability for each line item, gives you popup screen of confirmation.
    If you don't want availability or popuscreen of confirmation,then
    Go to VOV6 >>> Select schedule line which you are using in sales order for line item >>> Remove tick mark of availability check.
    Else
    Remove availability check rule from material master >>> Under tab Sales : ganral/plant
    kapil

  • What is business process of ur company

    what is business process of ur company,i face this question.
       plz reply me.....

    hi,
    this is a very relative question, which can be answered by you only coz you are the one involved in the process.
    still to clearly understand it will give you an outline format.
    business process of any company in SD particularly:
    Pre-sales:creating quotation or inquiries
    Sales:convert quotations to sales orders
    Procurement:get the material ready to be shipped as per sales order
    Delivery: arranging the deliv products to customer
    Shipping:the assignement of products economically to be reached at the customers place.
    Billing: bill the customer for the material
    Payment collection: post the payment in the customers account.
    regards,
    Siddharth.

  • Difference between service order and repair order?

    hi all,
    pl help me in understanding the difference between a service order and  repair order.
    pl tell me what is the process to create service order?
    what is the process to create a repair order?
    how we will know by looking into the order whether it is a service order or a repair order.
    thank you,
    hun

    Hun,
    Provides support for the complete Service processing lifecycle from Service Quotation creation to Billing. A service order is created if the customer has to be billed for services like utility usage, no. of pages printed (using counters etc). Service Order processing includes integrated validation of service contract price agreements and warranty entitlements.
    The cycle is :
    Business Scenario – Service quotation and service order management
    A.     Make inquiry – Customer contacts and requests for quotation
    B.     Create and communicate quotation – service rep. creates a quotation and sends it to the customer
    C.     Accept the quotation
    D.     Convert quotation into service order – and release the order
    E.     Create and optimize assignments - The Resource Planner assigns any field service tasks to one or more of his Field Service Representatives
    F.     Execute assignment, perform confirmation - The Field Service Representative performs the service assignment at the customer site and performs confirmation for the work done, materials used and so on
    G.     Approve confirmation, assign costs - The Service Manager checks and approves the confirmation data and decides which costs should be billed to the customer
    H.     Bill customer, perform analyses - The Service Manager triggers billing of the customer and performs analyses of the complete service order processing cycle
    Where as a repair order would be created when a customer finds a defect in say a product and the requests for a repair of replacement.
    The cycle is:
    The business scenario
    1.     Enter repair request
    The customer calls the service organization to request a repair. The agent enters the repair request. The system checks whether a warranty exists.
    2.     Send in defective product
    The customer sends in the product using the given return material authorization number.
    3.     Plan repair steps
    A service representative performs the technical analysis and enters the inspection result (causes, tasks, etc.). He decides what action should be taken based on the inspection result.
    4.     Create service quotation
    The system calculates the price for the planned repair and required spare parts, according to the price agreements in the service contract, and the warranty costs. The agent generates a service quotation.
    5.     Perform confirmation
    The customer accepts the quotation. The service representative repairs the product and confirms his working times and materials used. He also documents the inspection results.
    6.     Return repaired product
    The service representative returns the repaired product to the customer.
    7.     Create invoice
    The service representative triggers customer billing, based on the confirmed time and spare parts used, and in accordance with existing warranties and specific price agreements.
    8.     Analyze defect reasons
    Using predefined queries and reports, the service manager analyzes the most important defect reasons.
    Refer to CR700 - Service for details info.
    Regards,
    Julius

  • Quotation marks converted to foreign fonts after upload to another server.

    I've uploaded my website with Fetch and the quotation marks are converted into foreign fonts.
    How do I correct?

    I've uploaded my website with Fetch and the quotation marks are converted into foreign fonts.
    How do I correct?
    Try this:
    iWeb > Preferences > Autocorrection: Uncheck box for "Use Smart Quotes" and republish and reupload.
    But the real problem is your server. See the server settings section of this note:
    http://homepage.mac.com/thgewecke/iwebchars.html

  • How do you convert a quotation into a purchase requisition?

    How do you convert a quotation into a purcahse requisition?

    Hi Ganesh
    But from ME51N in shows selection varaint it show RFQ for creation of Requisition but when you drop the RFQ to header for creation , it is not working..
    Chek again.
    Kishor
    Hi Christopher
    See Purchase requisition creation can happen without vendor and price details as well.
    so once you have finalised your vendor and price ,you can put the vendor and price details  in PR and then PR can go further for approval...there will be some manual work ,,but I do not think any more option available.
    hope its logical,.
    Kishor

  • Converting the quotation to the different Sales orders- with doc types

    Requirement : My client wants to create the quotation from Lead and Opertunity..
    Company sells the High tech sofware as well Maintanence, customer may buy both together or only hightech products
    But he both the products can go together up to Quotation.
    When the quotation is converting into the sales order,  we want to change the logic and apply new logic- Program has to create High tech products as sales order and Maintanence products as Contact (i.e both of them has to create two different doc types)
    Both the sales order and Contract has to call two different pricing procedures..
    Please explain to help the following
    a. What is the program name / Function module  that we need to modify to split the sales orders based on the products ?
    b, Setting up the two different pricing procedures, so that based on the item category and doc type it should carry the new pricing procedure..
    Can some one help me to provide the steps in sequence..
    Thanks
    Larry
    Edited by: Larry Troy on Nov 8, 2010 4:24 AM

    Hi
    Copying the products from quotation to only sales orders and services to only contracts can be done with the help of copy controls. If we donot maintain the copy controls between quotation and sales order at item level for services (relevant item category), the copying can be controlled. Similarly, copy controls between quotation and contract at item level should control copying the products and should allow only services. System will give information about not copying the items while creating the subsequent documents(contract or sales order).
    Thanks,
    Ravi

  • Mass convert Inquiries to Quotations

    Hi SD Experts,
    Can any one tell me how to mass create Quotations from Inquiries? Does SAP offer any standard program or transaction code to do this?
    Thanks,
    Sudheer

    LSMW or SCATT can be used for mass convert Inquiries to Quotations.
    Regards,
    Rajesh Banka
    Reward points if helpful.

  • List of Quotations yet to be converted into a Sales Order

    Hi All
    I'm looking or a way to list Quotations in the system, something similar to ME57 (for Purchase Requisitions) where you can see a list of all Quotations which have yet to be made into a Sales Order.
    Thanks in advance!
    Vicky

    Dear,
    I didnt try but, Try transaction code S_ALR_87014387 report, if not success try to create a query using tables VBAP and VBFA.
    Regards,
    Syed Hussain.

  • Convert php script to oracle procedure

    To all please help me... I wanna convert php script to oracle procedure..and the script is (exp)..
    <?php
    include("../config/koneksi.php");
    $customer=$_POST['customer'];
    $tanggal1=$_POST['theDate1'];
    $tanggal2=$_POST['theDate2'];
    $no_bulan=substr($tanggal1,0,2);
    $bulan_sajah= (substr($no_bulan,0,1)=='0')? substr($no_bulan,1,1) : $no_bulan;          
    $tahun_sajah=substr($tanggal1,3,4);
    $blnkmrn=(int)$bulan_sajah;
    $thnkmrn=(int)$tahun_sajah;
    if ($blnkmrn==1) {
         $bulan_lalu=12;
         $tahun_lalu=$thnkmrn-1;}
    else {
         $bulan_lalu=$blnkmrn-1;
         $tahun_lalu=$thnkmrn;
    $bulanlalu=strval($bulan_lalu);
    $tahunlalu=strval($tahun_lalu);
    $sql = "select nip_nas from edo_customer_master_dives where standard_name='$customer'";
         $stm = ociparse($conn,$sql);
         ociexecute($stm);
         ocifetch($stm);
         $data=ociresult($stm,1);
         $sql12 = "select PRODUCT_LINE_ID,sum(REVENUE)
    from PA_FACT_REV_BILLED_CC
    where nip_nas='$data' and year_id='$tahun_sajah' and month_id='$bulan_sajah' group by PRODUCT_LINE_ID";
         $stm12 = ociparse($conn,$sql12);
         ociexecute($stm12);
         $total_revenue=0;
         $i="0";
    while (ocifetch($stm12)){
         $rev_items=ociresult($stm12,1);
         $revenue=ociresult($stm12,2);
         $sql2 = "select * from PA_FACT_REV_BILLED_CC
    where nip_nas='$data' and PRODUCT_LINE_ID='$rev_items'";
         $stm2 = ociparse($conn,$sql2);
         ociexecute($stm2);
         ocifetch($stm2);
    $tahun=ociresult($stm2,1);
    $bulan=ociresult($stm2,2);
    $nipnas=ociresult($stm2,3);
    $prod_line=ociresult($stm2,4);
    $rev_item=ociresult($stm2,5);
    //$revenue=ociresult($stm2,6);
    $query1 = "select standard_name from edo_customer_master_dives where nip_nas='$nipnas'";
         $st1 = ociparse($conn,$query1);
         ociexecute($st1);
         ocifetch($st1);
         $nama_cust=ociresult($st1,1);
         $query2 = "select prod_line_lname from parameter.p_prod_line@dwhnas where prod_line_id='$prod_line'";
         $st2 = ociparse($conn,$query2);
         ociexecute($st2);
         ocifetch($st2);
         $nama_prod_line=ociresult($st2,1);
         $query3 = "select REV_TYPE_LNAME from parameter.p_rev_type@dwhnas where REV_TYPE_ID='$rev_item'";
         $st3 = ociparse($conn,$query3);
         ociexecute($st3);
         ocifetch($st3);
         $nama_rev_item=ociresult($st3,1);
         $query4="select sum(total_usage) from PA_FACT_TRAFFIC_CC where PRODUCT_LINE_ID='$prod_line' and nip_nas='$nipnas' and year_id='$tahun_sajah' and month_id='$bulan_sajah' group by PRODUCT_LINE_ID";
         $st4 = ociparse($conn,$query4);
         ociexecute($st4);
         ocifetch($st4);
         $total_usage=ociresult($st4,1);
         $total=$revenue + $total_usage;
         echo $tahun." ".$bulan." ".$nama_cust." ".$nama_prod_line." ".$nama_rev_item." ".$revenue." ".$total_usage." ".$total."<br>";
         $total_revenue=$total_revenue+$total;
    $i++;
    echo $total_revenue;
    //cost of product
    $query5="select * from PA_FACT_TRAFFIC_CC where nip_nas='$nipnas' and year_id='$tahunlalu' and month_id='$bulanlalu'";
    $st5 = ociparse($conn,$query5);
         ociexecute($st5);
         $total1=0;
         $total2=0;
         $total3=0;
         $total4=0;
         $total5=0;
    while (ocifetch($st5)){
         $nipnas=ociresult($st5,3);
         $lineid=ociresult($st5,4);
         $itemid=ociresult($st5,5);
         $call=ociresult($st5,6);
         $unit=ociresult($st5,7);
         $query6 = "select prod_line_lname from parameter.p_prod_line@dwhnas where prod_line_id='$lineid'";
         $st6 = ociparse($conn,$query6);
         ociexecute($st6);
         ocifetch($st6);
         $nama_prod_line=ociresult($st6,1);
         $query7 = "select REV_item_LNAME from parameter.p_rev_item@dwhnas where REV_item_ID='$itemid'";
         $st7 = ociparse($conn,$query7);
         ociexecute($st7);
         ocifetch($st7);
         $nama_rev_item=ociresult($st7,1);
    $query8 = "select * from cost_of_product where prod_line_lname='$nama_prod_line' and REV_item_LNAME='$nama_rev_item' and end_date is null";
         $st8 = ociparse($conn,$query8);
         ociexecute($st8);
         ocifetch($st8);
         $lineid_cost=ociresult($st8,1);
         $itemid_cost=ociresult($st8,2);
         $satuan=ociresult($st8,5);
         $nilai=ociresult($st8,7);
         if (strtoupper($satuan)=='MENIT') $total1=$total1+(($unit/60)*$nilai);
         if (strtoupper($satuan)=='KBPS') $total2=$total2+($unit*$nilai);
         if (strtoupper($satuan)=='SMS') $total3=$total3+($call*$nilai);
         if (strtoupper($satuan)=='SSL') $total4=$total4+($call*$nilai);
         if (strtoupper($satuan)=='SST') $total5=$total5+($call*$nilai);
    $total_cost_pots=$total1+$total2+$total3+$total4+$total5;
    echo $total_cost_pots;
    ?>
    this script just for exp.

    Please convert step by step. for example
    (1) remove inverted quotation mark ( ` )
    (2) modify constraints syntax (PRIMARY KEY,UNIQUE KEY, KEY etc.) to [url http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14200/clauses002.htm#g1053592]Oracle constraints.
    (3) modify some datatype to [url http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14200/sql_elements001.htm#i45441]Oracle datatype
    (4) think how to convert auto_increment ([url http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_6015.htm#i2067093]Sequence, [url http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_7004.htm#i2235611]Beffore Trigger etc. on Oracle)
    http://download-west.oracle.com/docs/cd/B19306_01/appdev.102/b14251/adfns_packages.htm#sthref864
    http://download-west.oracle.com/docs/cd/B19306_01/appdev.102/b14261/toc.htm

  • 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>

  • HTML Editor - converting "special characters" into entities

    Hi everyone,
    I'm currently in the middle of formatting my wife's novel into 'clean' html so I can use Calibre to create a well formatted epub/mobi/etc.
    I've read that TextMate on Mac includes a function to "Convert Selection to Entities excluding Tags".  In other words it will replace all special characters (ellipses, copyright sign, etc) with the html entities.
    I'm currently using Kate and I can't seem to find anything similar.  Is anyone aware of any linux editors with the same function?
    Thanks for the help!

    ctarwater wrote:Encoding is already UTF-8 but I'm trying to make these docs as "universal" as possible and I've read that little things like replacing quotation marks and other symbols with their html entities is a good step in that direction.
    In situations with multiple encodings this might be the case, but the XML spec requires UTF‐8 support at minimum and defaults to it when the encoding is not declared. All XML parsers can deal with UTF‐8.
    In fact, replacing UTF‐8 characters with entities is less portable in XML. This is because the available entities are defined by the doctype, and XML only supports five by default (&lt;, &gt;, &quot;, &amp;, and &apos;). Things like &hellip; are defined in the HTML and XHTML doctypes, but not in other dialects of XML. This used to bite RSS pretty hard (probably still does), because people assumed the entities were available everywhere when they’re really not. EPUB and Mobi are based on XHTML, but other formats might use other XML dialects.

Maybe you are looking for

  • How to filter a form with pagination?

    Hi all, I've converted an app to Apex 3.1 (thanks to helpful folks here), but am stuck on the final form. I'd like to streamline the master-detail form, skipping over the tabular report in the detail. Here's (almost) a shell of what I'm trying to do:

  • Viewing Instance Variable Information for Automatic activities

    Hi, I have a process which is made up of all automatic activities that each do a specific set of activities and populate a few instance variables. I want to create a view so that a user can see the state and value contained in each of the instance va

  • Thought of functional consultant Vs abap

    Dear All, I am techno functional consultant. I thought and very funny sometimes, but its bad habit to laugh on anyone. Thought of Functional consultant: I have requirement of  report X in which when user create PO--->make GR> take print then it shoul

  • ATV fails to show this YouTube video in favorites--why?

    On my MBP and my iPhone this video is shown in my favorites (although the iPhone won't play it as I recall), but ATV does not (and apparently WILL NOT) show this video in my favorites. http://www.youtube.com/watch?v=C0GzFJGxno&playnextfrom=TL&videos=

  • JPA and Session Managment

    Hi , am using JPA/Toplink , with Bean Managed entity manager (EntityManagerFactory) , as far as i know that for each EntityManager there should be one active transaction within one session , is that right !!? and how does EntityManager handles these