Showing posts with label isv.config. Show all posts
Showing posts with label isv.config. Show all posts

Fetching the selected records in a grid

Make sure that you read this page if you want to use the selected values in a grid:

Until some time ago I was using one of the functions that CRM uses, but since that is unsupported and the method as described in the article as stated above is supported, I am using the new approach.

In short it comes down to this:

// window.dialogArguments contains an array of the IDs for the
// selected records.
var sSelectedRows = window.dialogArguments;

// If sSelectedRows is empty, do not execute the update.
if (sSelectedRows == "" sSelectedRows.length == 0)
alert("You must select records in order to use this feature.");
//Do something;

Happy coding!

Clone a record

There are some interesting things in the May 2006 Demo VPC that you might not have seen before. One of them is cloning a record. There's an addon written and supplied with the VPC that does take of cloning a contact. I've used it in some other projects and will be using it in my current project again. Ofcourse you can modify the code to match any entity.

I'll add the code here so that you dont have to download the complete VPC. There will be added a piece of code to the isv.config file and an additional file will need to be placed on the server.

Here is the piece that needs to be added in to the isv.config file:

<configuration version="3.0.0000.0">
<Root />
<Entity name="contact">
<ToolBar ValidForCreate="0" ValidForUpdate="1">
<Button Title="Clone Contact" ToolTip="Create a Copy of This Contact" Icon="/CloneContact/contactclone.gif" Url="/CloneContact/CloneContact.htm" WinMode="1" WinParams="dialogHeight:100px;dialogWidth:300px;"/>

This is the code that needs to be stored in the file as indicated in the isv.config file:

<title>Clone Contact</title>


font-family: arial;
font-size: 12px;

border-bottom: solid 1px #cccccc;
text-align: center;


<script language="javascript">

// Set global variable for the cloned contact window
var oClonedContact;

function window.onload()
// Open a new contact form
oClonedContact ='/sfa/conts/edit.aspx','','menubar=0, status=1, width=1000, height=600');

// Set a timeout to wait for the new contact form to load

// Checks if the new contact form has completed loading
// When it completes, CloneContact will be called
// If it's not loaded, it will set a timeout and check again.
function checkPageState()
if (oClonedContact.document.readyState == 'complete')


function CloneContact()
// Get a pointer to the parent window
var oParent = window.dialogArguments;
var oSource = oParent.document.crmForm;

// With the target crmForm
// Name fields
salutation.DataValue = oSource.salutation.DataValue;
firstname.DataValue = oSource.firstname.DataValue;
nickname.DataValue = oSource.nickname.DataValue;
lastname.DataValue = oSource.lastname.DataValue;
jobtitle.DataValue = oSource.jobtitle.DataValue;
parentcustomerid.DataValue = oSource.parentcustomerid.DataValue;

telephone1.DataValue = oSource.telephone1.DataValue;
telephone2.DataValue = oSource.telephone2.DataValue;
mobilephone.DataValue = oSource.mobilephone.DataValue;
fax.DataValue = oSource.fax.DataValue;
pager.DataValue = oSource.pager.DataValue;
emailaddress1.DataValue = oSource.emailaddress1.DataValue;

// Address fields
//address1_name.DataValue = oSource.address1_name.DataValue;
address1_line1.DataValue = oSource.address1_line1.DataValue;
address1_line2.DataValue = oSource.address1_line2.DataValue;
address1_line3.DataValue = oSource.address1_line3.DataValue;
address1_city.DataValue = oSource.address1_city.DataValue;
address1_stateorprovince.DataValue = oSource.address1_stateorprovince.DataValue;

address1_postalcode.DataValue = oSource.address1_postalcode.DataValue;
address1_country.DataValue = oSource.address1_country.DataValue;
//address1_telephone1.DataValue = oSource.address1_telephone1.DataValue;
//address1_addresstypecode.DataValue = oSource.address1_addresstypecode.DataValue;
//address1_shippingmethodcode.DataValue = oSource.address1_shippingmethodcode.DataValue;
//address1_freighttermscode.DataValue = oSource.address1_freighttermscode.DataValue;

// Professional Information fields
//department.DataValue = oSource.department.DataValue;
accountrolecode.DataValue = oSource.accountrolecode.DataValue;
managername.DataValue = oSource.managername.DataValue;
managerphone.DataValue = oSource.managerphone.DataValue;

assistantname.DataValue = oSource.assistantname.DataValue;
assistantphone.DataValue = oSource.assistantphone.DataValue;

// Personal Information fields
gendercode.DataValue = oSource.gendercode.DataValue;
familystatuscode.DataValue = oSource.familystatuscode.DataValue;
spousesname.DataValue = oSource.spousesname.DataValue;

all.birthdate.DataValue = oSource.all.birthdate.DataValue;
all.anniversary.DataValue = oSource.all.anniversary.DataValue;

// Description
//description.DataValue = oSource.description.DataValue;

// Internal Information fields
ownerid.DataValue = oSource.ownerid.DataValue;
originatingleadid.DataValue = oSource.originatingleadid.DataValue;

// Billing Information fields
//creditlimit.DataValue = oSource.creditlimit.DataValue;
//all.creditonhold.DataValue = oSource.all.creditonhold.DataValue;
//paymenttermscode.DataValue = oSource.paymenttermscode.DataValue;
//defaultpricelevelid.DataValue = oSource.defaultpricelevelid.DataValue;

// Contact Methods fields
preferredcontactmethodcode.DataValue = oSource.preferredcontactmethodcode.DataValue;
all.donotemail.DataValue = oSource.all.donotemail.DataValue;
all.donotbulkemail.DataValue = oSource.all.donotbulkemail.DataValue;
all.donotphone.DataValue = oSource.all.donotphone.DataValue;
all.donotfax.DataValue = oSource.all.donotfax.DataValue;
all.donotpostalmail.DataValue = oSource.all.donotpostalmail.DataValue;

// Marketing Information fields
all.donotsendmm.DataValue = oSource.all.donotsendmm.DataValue;
all.lastusedincampaign.DataValue = oSource.all.lastusedincampaign.DataValue;

// Service Preferences fields
preferredappointmenttimecode.DataValue = oSource.preferredappointmenttimecode.DataValue;
preferredappointmentdaycode.DataValue = oSource.preferredappointmentdaycode.DataValue;
preferredserviceid.DataValue = oSource.preferredserviceid.DataValue;
preferredequipmentid.DataValue = oSource.preferredequipmentid.DataValue;
preferredsystemuserid.DataValue = oSource.preferredsystemuserid.DataValue;

// Finally, close the dialog



<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" align>
<tr valign="middle">
<td class="body" align="center">
<div style="font-size= 10pt; font-family= Tahoma;">Cloning Contact...</div>



It's just a free addon from Microsoft, so use it if you can :)

Import has encountered an error and has been canceled

Another error resolving post.

Here's the error:

Import has encountered an error and has been canceled. Your system has been restored to its original state. Import has been canceled because the ISV.Config file could not be imported. Check that the file format is valid.

Also connecting to the CRM Workflow Manager will probably not work. This error message is thrown:
The specified Microsoft CRM server is not responding. This might happen if it is currently unavailable, it is not a Microsoft CRM server, or you are not a valid user. For more information, contact your system administrator.
This is -probably- being caused by incorrect settings in the srf files. Check this by going to the CRM website folder (C:\inetpub\wwwroot\) and browse to the folder MSCRMServices. In that folder open the file bizusersdl.srf in notepad. In that file you do see a folder. Try to browse to that folder by copying the folder name and paste it in Windows Explorer. You'll see that the name is in short format like: c:\progra~1\micros~3\.... This format does not match the location of the crm folder.

I have been able to solve these errors by repairing CRM. Go to the control panel, click add/remove programs and select Microsoft CRM. Then choose for 'Repair'. Another option would be to follow the steps in kb859798 (partner source required). That KB article describes how to reset the .srf mapping in step 8.