CRM Techincal
Hello all
can anyone plz send me the CRM Techincal Book.I am in project and need this help urgetn. Plz help on this by sending the book at my email id::
[email protected]
Regards
parul
Hi Parul,
check the link http://help.sap.com/bp_crmv150/CRM_DE/index.htm
then follow the link Technical information ->Building Block Library. Here you will find all the document for SAP Best Practices for CRM - V1.50
<b>Allot points if my posh helps!!</b>
Best regards,
Vikash
Similar Messages
-
Hi All,
I am an Abbaper Planning to learn Crm technical .I have checked many threads but there is no proper information for Crm Technical details such as where to start and how to start Crm technical . I am very much confused with the Crm Technical details which has given in the threads . As an Abaper what should i learnn into CRM (Topics) and where can i get good material .? I am planning to move from general ABAP to Crm Abap or Crm Technical . Please give me list of topics , areas in Crm and material that will be very helpful to me.
Thanks in Advance,
PriyaHi Priya,
I too knew to CRM technical .I used to work as ABAPer.
i want to share something which i know.
CRM techincal is nothing but the same thing what you do in R/3.the same reports,bdcs etc.
But here we do have CRM ic web client (tele sales application -web) .BSP(business server page) is used to develop this application.the other is POTAL application uses CRM as one of its back end systems.Then you need to WEB dynpro(abap or java).again other part of the techincal is CRM middleware.Middleware is a tool where it acts as the interface b/w CRM to many other application s like R/3,BW,Mobile applications etc.Middleware is part of the CRM .So whenever you want to access the data from R/3 you use middleware as an interface just like ALE idoc in R/3.same concept works here.Ther you would say IDOC here it is BDOC.the other application is ISA(internet sales applciation).this totally uses JAVA technology.and Here IPC ll come into the picture.Internet pricing config.it is a tool which ll be used to calcualte the price and discounts to any products where you want to sell them online like here it is ISA.
So Here the conclusion is So what what you like to go on ..
1. IC web client development using BSPs
2.Webdynpro for portal
3.Middleware consultant
4. ISA ,IPC developer
or total 4 ?
hope you got some idea on techical part of CRM.
Ganga reddy -
Hello,
We have added a field on cic0-maintain business tr-transaction data-organization after 'Sales Group'. The filed has been added in ORDERADM_H object. First time it gets populated but if I come back to this tab again , I find it is blank. Where exactly I have to make this change so that this is permamant. I am ABAP and new to CRM techincal.
Thanks in advance.HI
R u talking about GUI or UI
did u added field by using EEWB or by using general attribue
can u elobarate -
BAPI for CRMD_ORDER support message? Urgent
Hi Experts,
I want to change the support messages created.
For that do we have a BAPI, for the support message?
It is an urgen requirement..
Points will be rewarded ....
thanks,
MahanteshHey Mahantesh,
As i already mentioned in my previous post, you have to use FM CRM_ORDER_MAINTAIN in the BADI ORDER_SAVE to update any field which is present in tcode CRMD_ORDER.
Please Consult CRM techincal consultant to know how to use FM CRM_ORDER_MAINTAIN in order to update the ibase and component.
please reward points for usefull answer.
Regards,
Anand... -
Techincal master data creation from CRM
Hi ,
I am getting below error in IC Web 7.0 for creation of techincal master data.
Error - An internal number range interval cannot be determined for category ISU_CONNOBJ
An internal number range interval cannot be determined for category IUS_POD
I have already assing no range for product type material.
Thanks,
Nitinfixed the issue
-
I am working in crm 5.0 . When I am trying to create a badi it always needs an enhancement spot. I do not have much idea about enhancement spot. Please give me step by step method for creating badi in crm 5.0. I know how to create badi in crm 4
Hi Sucheta,
To create BADI in CRM 5.0,
1. Go to SE 18, give the enhancement spot like following are standard ones:(its all about the purpose of creating a badi as its one of the enhancemen type so asks fro the spot where to enhance) with its techincal details:
Table Name ENH_EDT_LAYOUT
Field Name OBJECT1
Data Element ENH_ED_OBJ
The Standard enhancement Spots are:
/CEM/LRO_CUST_FIELDS EM/CREI interface: Customer extension fiel
/CRMS/CMG_PART_DETER Case Management: BAdI Partner Determinatio
/CRMS/CMG_REC_ATTR BAdI: Attributes for Links in Case Record
/CRMS/GET_PART_PPF_C BAdI: Partner Determination for Actions
/LIME/COLLECTOR BAdI to Fill Collections in LIME
/LIME/CUST BAdI for LIME Customizing
/LIME/DISPATCHER BAdI for Distribution of LIME Documents
/LIME/DOC_CHECK BAdI for Static Checks of Incoming Documen
/LIME/MASTER_DATA BAdI to Read Master Data for LIME
/LIME/QCI LIME QCI Converter
ARC_ADD_TABLE Extending the Structure Definition for Arc
ARC_CRM_ACT_ON BAdI for Archiving Object CRM_ACT_ON
ARC_CRM_COMP BAdI for Archiving Object CRM_COMP
ARC_CRM_GAG For Archiving Object CRM_GAG
ARC_CRM_GAP For Archiving Object CRM_GAP
ARC_CRM_IPMCON BAdI for Archiving Object CRM_IPMCON
ARC_CRM_IPMPUC BAdI for Archiving Object CRM_IPMPUC
ARC_CRM_IPMSAC BAdI for Archiving Object CRM_IPMSAC
ARC_CRM_LEAD BAdI for Archiving Object CRM_LEAD
ARC_CRM_LEAS For Archiving Object CRM_LEAS
ARC_CRM_OPPT BAdI for Archiving Object CRM_OPPT
ARC_CRM_SACONT BAdI for Archiving Object CRM_SACONT
ARC_CRM_SALDOC BAdI for Archiving Object CRM_SALDOC
ARC_CRM_SDBPBL Enhancement Spot for Archiving Object CRM_
ARC_CRM_SDBSOL For Archiving Object CRM_SDBSOL
ARC_CRM_SERORD BAdI for Archiving Object CRM_SERORD
ARC_CRM_SRCONT BAdI for Archiving Object CRM_SRCONT
ARC_CRM_SRVCON BAdI for Archiving Object CRM_SRVCON
ARC_CRM_SUR BAdI for Archiving Object CRM_SUR
ARC_CRM_UBBPOL BAdI for Archiving Object CRM_UBBPOL
ARC_SCMG Enhancements for Case Archiving
ARC_SRM_GSP Enhancements for Record Archiving
BADI_IBASE_IBARC IBase: Archiving
BADI_MI_SYNC_SERVICE BADI use in the Sync Service "MI_HOST"
BADI_MSA50 BAdis created for MSA5.0
BADI_MSE50 BAdis created for MSE 5.0
BADI_NUMBER_GET_NEXT
BADI_SORTER BAdI for sorting BAdI implementations
BADI_SORTER_TEST Test for BADI_SORTER_LAYER
BADI_TEST_SYNCSERVICE BADI_TEST_SYNCSERVICE
BADIS_SEU BAdIs for SEU
BDT_XCHNG_CREATE_SET Influence XCHNG Indicator during Creation
BIZC_CONFIGURATION Business Content: Configuration
BIZC_PRECONFIGURATION Business Content: Preconfiguration
BRF BRF-Releated BAdI Enhancements
BUPA_INITIAL_SCREEN
BUPA_LOCK Locking of a Business Partner
BUPA_MASK_LIST_ITEM SAP BP: Exit for masking the de-personalized fields of t
BUPA_OUTBOUND Business Partner Data Exchange (Outbound)
BUPA_PARTNER_CATEGORY Partner category for non update roles
BUPA_UOM Unit of Measure System for Each Partner/Address
BUPR_LOCK Locking of a Business Partner Relationship
CACL_MAIN01 BAdI for Required Field Check
CGPL_FETCH_RELATIONS Find the Linked Projects/Tasks Not Yet Loaded
CLEAR_DB_SAVE Clearing Tool: Exits of the (B)API Functions
COM_MERGE_DATA_SET Set Type-Specific Implementations
COM_PRODUCT_BSP_SPOT Enhancement Spot for PC UI Product Master
COM_PRODUCT_SE Spot for Searching for Product/Ind. Object Using Search
COM_SE_F4 SES: F4 Search Help integration
CRM_ATTR_PERS_CONTRO Editing Customer Attributes
CRM_BUPA_TFW_MEMORY TFW: Buffer Evaluation
CRM_CMG_ALT_CASE_APP Alternative Case Applications
CRM_CMG_BSP_EXT Case BSP Framework Extension SPOT
CRM_CMG_CASE_ACCESS Control for Processes in Case Management ("Internal Even
CRM_CMG_CASE_BOR_KEYS To get the external keys of the case linked BOs
CRM_CMG_NOTES_ACCESS Control for Processes of Case Notes
CRM_CONFIG_GRID_PRICE BAdI for Pricing of Matrix Products
CRM_CREI Entitlement Management Complaints and Returns Processing
CRM_ESELLING_SEARCH Enhancements in Internet Sales
CRM_ESERVICE_SEARCH Enhancements in E-Service
CRM_FINANCE_PAYMENT_SUM Read Payment Schedules for Lease
CRM_FS_BSP_MODEL_IL_FSBP Enhancement Spot for Business Partner PC-UI
CRM_FS_BSP_MODEL_IL_FSQ Enhancements for FS Quotation
CRM_IC_EXT_SPOT IC Web Client Rule Driven Interaction
CRM_IPM_AVAIL_CALC_GRP IPM: Calculate Rights Availability (Rights Groups)
CRM_IPM_AVAIL_ORD_CR_GRP IPM: Create an Order for Available Rights (Rights Groups
CRM_ISPS_GAP Grantor Managament Enhancements for Application
CRM_IST_PROD_FILTER Filtering of Items Determined in Bundle Explosion
CRM_IST_XI_CONF_MAPFROM_STATUS Define XI Status if XI Distribution is Available at the
CRM_LEAS_LINK_CREATE Generates Links Between Financing Items
CRM_MASTER_AGREEMENT BAdIs for Outline Agreement Selection
CRM_MI Investigation
CRM_PRODUCT_ATTRTEXT_SPOT Product Attribute Text Spot
CRM_UBB_PREBILLING Enhancements for UBB Prebilling
CWB_EXTERNAL
DD_ENQU_LISTENER Listener for Enqueues
EFG_PRINT_PARAMS Print Parameter
EFG_SPOOL_OUTPUT BAdI for Status of Spool Output Requests
ES_ENHCROSS_REBUILD Rebuild ENHCROSS
ES_ENHCROSS_UPDATE Entry for AFTER-IMPORT method for conversion of ENHCROSS
ES_SAPLOMCV_BADI BAdIs for Conversion Exit
EXTRACT_DATA Data selection for IPC
FKKCORR_EXP_9992 Correspondence: Example - Definition of Corresp. Type 99
FPB_PERS_GENERAL Personalization: General Enhancements for Framework
FSBP_ALIAS_BAPI_EXTENSION BAdIs for Aliases for Parameter Extension
FSBP_CREDT_STANDNG_BAPI_EXTEND BAPI Parameter Extensions for Credit Standing Data
HRTM00_TL_CALCULATION Talent Management: Enhancement Spot for Calculating Stat
IS_OIL_ACTIVE BAdI for Determining Whether Industry Business Solution
MDF_FND_CRT MDF Fund create
MDS_CTRL_ACT_CHECK Additional Checks for Maintenance View MDSV_CTRL_OPT_A
MDS_CTRL_PPO Post-Processing Office Call from the Controller
MISYNCSERVICE Badi for SyncService (MI)
OA_BADI_LINK BADI for ArchiveLink Links
PLM_AUDIT_SAP_TXT Audit Management: Platform-Specific Connection for Long
PLM_AUDIT_TEXT_ID Definition of Text Types for Each Audi
RCM_REC_WD
RCM_RECORD_BADI RCM: BAdIs for the Record
RCV_BP_ISOLATION Business Partner Decoupling
SCMA_TREE_STATUS
SFW_SWITCH_CHANGED Subsequent processing after switch cha
SOLAR_DOCUMENT_EXITS
SRM_DOC_ACT_AUTH_C SP Document -Enhancment spot for activ
SUSR_CUA_STATUS_SWITCH Status Change of the CUA Connection
WD_BADI Web Dynpro: BAdI Definitions
WF_BWP_DYN_COLUMN Set Dynamic Columns in Inbox
WF_BWP_OBJ_ATTRIBUTE Set Default Attributes for Objects in
WF_BWP_SELECT_FILTER Filter for Inbox Selection
YY_ORDER_SAVE Testing purpose
2.You can create also new enhancement spot (your Own) and create a BADI definition in the second Screen under the tab "Enhancement Spot Element Definition" for both ZZ as well as standard enahcement spots(in change Mode).
For More Information just go through the Link:
http://help.sap.com/saphelp_erp2005vp/helpdata/en/da/1c40425c459923e10000000a155106/frameset.htm
Hope this will help you
Regards,
Arjun
<b>Reward points if it helps</b> -
Upgrade from CRM 5.0 to CRM 7.0 - ISA
Hi All,
Currently we have CRM 5.0 implementing ISA applications, and soon we wil be upgrading to CRM 7.0.
We have some customised ISA applications running on 5.0, so during this Upgrade process, what would be the techincal approach for the ISA applications to be able run fine with new CRM 7.0.
Please guide me with your inputs about how to go on with this upgrade process.
Thanks,
Aman.There are changes in the flow and the files of CRM ISA 7.0...donot compare things with 5.0...we had to start from scratch...
-
Hi Experts,
We identified top 50 Big tables in our SAP CRM production. We need to archive this tables. I am new this archiving methodology. Can any one guide me how to do this.
Regards,
RaoHi Srinivasarao,
In CRM most of the standard applications have their own archiving objects and these can be archived using the transaction SARA.
There would be certain prerequiest for this and also some techincal setting such as file server configuration etc which needs to be done. Please contact your basis support guys and they will be able to help you.
For basic understanding of data archiving please look at
http://help.sap.com/erp2005_ehp_02/helpdata/en/2e/9396345788c131e10000009b38f83b/frameset.htm
Regards,
Kiran -
ISU & CRM : Business partner : Upload
In our Techincal Architecture we have Both ISU and CRM.
Now I have to Uploade BP in either of them and then replicate into other. Can you please suggest Where should I Uplaod it first.
Also after BP I have to upload other ISU object using Emigall
Please reply.
Thanks,hi
thanx for ur reply...I have already done settings as per that note...still error is being displayed...
Cheers
Hits -
Hi
Can anyone plz tell me wht is CRm Esales and wht exactly we do in that. from functional and techincal point of view.
plz help on this.
Regards
shilpaHi Parul,
The CRM E Sales it a channel to provide access to the Customers to the CRM system . There are two types of scenarios
1> B2B
2> B2C.
In B2B scenario we do business to our existing customers whereas in B2C scenario any one visit your site registor himself / herself and order the products in your website.
Now as a functional cunsoltunt your responsibility is to maintain the shop, catalog, user admin etc. Regarding the technical aspect you should have the knowledge of Java and entrprise portal.
If you need some more info do not hesitate to revert back.
<b>Reward points if it helps!!</b>
Best regards,
Vikash. -
BADI for changing fields during Creation of BP in CRM
Hello to everyone,
I need to find a BADI (or other way) to default several fields during BP creation in CRM (4.0 SR1 SP9). The fields I will like to set are TAX TYPE, TAX NUMBER, TAX CATEGORY, etc.. I have found the BADI BUPA_TAX_UPDATE but i dont see any suitable parameters (structures) to changes these fields. Please advice and thanks in advance.Hi
If you use function BUPA_NUMBERS_GET then your BP number will already be buffered and you can avoid a DB read. It may also be that the BP is not in the DB yet anyway.
You can only pass one GUID in at a time - loop through IT_CHANGED_INSTANCES into a variable of type BU_PARTNER_GUID and pass that into the function as input parameter IV_PARTNER_GUID.
Cheers
Dom -
Refresh CRM data in R/3 report
Hi All,
I've a report in R/3 where i get the Order Status of CRM through a RFC, but when i'm changing the status in CRM through crmd_order, when the report is open in R/3. When i press the refresh button, the status is not changed, it shows the previous status.
Below is the code, can any1 help me how to go about
CALL FUNCTION 'CRM0_READ_RFC_DEST'
EXPORTING
i_consumer = 'CRM'
i_download_type = '*'
i_objname = '*'
I_BAPICRMDH2 =
I_REM_LOGSYS =
TABLES
t_crmrfcpar = t_crmrfcpar
EXCEPTIONS
NO_ENTRY_FOUND = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF NOT t_crmrfcpar[] IS INITIAL.
READ TABLE t_crmrfcpar INDEX 1.
l_rfcdst = t_crmrfcpar-rfcdest.
ENDIF.
Call RFC
*loop at z_guid into lguid.
*endloop.
*refresh ZORDER_STATUS.
CALL FUNCTION 'ZCRM_HEADER_STATUS'
DESTINATION l_rfcdst
IMPORTING
ORDER_IDRET = l_guid
tables
ORD_STATUS = ZORDER_STATUS
Regards
Sanjuany body?
-
Installation of IPC AP 7.0 Jar is getting Failed when uploading in CRM
Hello Experts,
we did some changes in the previosly uploded version of IPC AP 7.0 customer user exit Jar file in eclipse.
While uploading the new modified jar through transaction /SAPCND/UE_DEV in CRM we are getting error :" installation of module <Jar file name > has failed ".
when we checked the logs in SM 53 we seen the below mentioned error:
Message: Exception of type com.sap.sql.log.OpenSQLException caught: Exception of type com.sap.sql.sqlparser.CommonSQLParserException: - statement "DELETE FROM "SVMCRT_MOD_TR_T" WHERE "MODULE_NAME" LIKE ? ESCAPE ^ (reason: Modification of ABAP tables is not permit ted)" is not supported
caught: - statement "DELETE FROM "SVMCRT_MOD_TR_T" WHERE "MODULE_NAME" LIKE ? ESCAPE ^ (reason: Modification of ABAP tables is not permitted)" is not supported
--> com.sap.sql.log.OpenSQLException: Exception of type com.sap.sql.sqlparser.CommonSQLParserException: - statement "DELETE FROM "SVMCRT_MOD_TR_T" WHERE "MODULE_NAME" LIKE ? ESCAPE '^' (reason: Modification of ABAP tables is n" is not suppor ted
caught: - statement "DELETE FROM "SVMCRT_MOD_TR_T" WHERE "MODULE_NAME" LIKE ? ESCAPE '^' (reason: Modification of ABAP tables is not permitted)" is not supported
at com.sap.sql.log.Syslog.createAndLogOpenSQLException(Ljava/lang/Class;Ljava/lang/String;[Ljava/lang/Object;)Lcom/sap/sql/log/OpenSQLException;(Syslog.java:85)
at
if required i can post the complete stack trace.
any inputs/suggestions are most welcome.
Thanks & regards,
SiddharthHi Mark,
Yesterday after Posting the thread we found the same Note ,Issue occured because of JAVA write access was not enabled on the table ,After enabling it as mentioned in SAP Note, Jar file get successfully uploaded.
Thanks for your Help also.
Regards,
Siddharth -
Custom message required on log on pop-up in SAP CRM WEB UI
We required custom message to the log- on popup, right now the message is coming after we give the user ID and password "starting SAP CRM" instead of that
user required welcome message.., how can achieve this ?
Please reply as soon as possible.Hi Pankaj,
did you already check the guide in the CRM Wiki:
https://wiki.sdn.sap.com/wiki/display/CRM/WelcomeUserMessageinWeb+UI
Hope this answers your question.
Best Regards,
Michael -
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.
- MittalHello,
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.
Maybe you are looking for
-
Publish a BI Publisher HTML output to the Oracle Portal
We currently use multiple JSPs to assemble and display employee data in portlets in our Oracle Portal. We're interested in redoing the display of this data using BI Publisher and would still like to send it to a portlet in our Oracle Portal. Essentia
-
Hello, I've been archiving the responses to my distributed form after I import 50 applications at a time (I'm expecting over 2000+ applications). Eventually I would like to merge my separate archive pdf's into one massive pdf file and I want to be ab
-
IP precedence CS1 vs. dscp af11 Which one is higher in the hierarchy, which marking will be given priority / processed first? With dscp AF11, 12, 13 I believe that af11 will be processed first, having a lower drop priority. AF11 has a decimal value o
-
I know that express VI's are generally frowned upon here. My question is why? Is it because people think that the programmer should be able to do (manually) what the express VI is doing? Or is it because express VI's generally dont perform very well?
-
My son has a Powerbook G4 , 10.5.8 OSX and a Itouch 5. what are my options as far as Itunes and his ability to purchase music and sync his music library with his Itouch5?