The length of the ‘filteringattributes’ attribute of the ‘sdkmessageprocessingstep’ entity exceeded the maximum allowed length of ‘100’

 

While developing a plug-in for CRM 4.0 triggers can be set when the plug-in can be set off using the Plugin Registration Tool.

When too many triggers are selected the following error will occur.

Unhandled Exception: System.Web.Services.Protocols.SoapException: Server was unable to process request.
Detail:

A validation error occurred. The length of the ‘filteringattributes’ attribute of the ‘sdkmessageprocessingstep’ entity exceeded the maximum allowed length of ‘100′.
Platform

at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at PluginRegistrationTool.CrmSdk.CrmService.Create(BusinessEntity entity)
at PluginRegistrationTool.RegistrationHelper.RegisterStep(CrmOrganization org, CrmPluginStep step)
at PluginRegistrationTool.StepRegistrationForm.btnRegister_Click(Object sender, EventArgs e)

 

What is de filteringattribute attribute?

While registering a plugin trigger in the CRM database the [<OrganizatioName>_MSCRM].[SdkMessageProcessingStepBase] table is updated.
For every plugin step a record is created in this table.
One of the attributes in this table is

[FilteringAttributes] [nvarchar](256)
NULL

During the registration of the plugin step the MetadataSchema is checked and validated a.o. the MaxLength of this attribute.

SELECT Maxlength
FROM [<OrganizationName>_MSCRM].[MetadataSchema.Attribute]
wHERE name =’filteringattributes’

By default the result of this query will be ‘100’. Strange of course since the database will allow to insert nvarchar strings up to 256 characters.

A solution could be

Update [<OrganizationName>_MSCRM].[MetadataSchema.Attribute
SET Maxlength = 256
where name =’filteringattributes’

If the MaxLength is set to more then 256 a SQL Error may occur since data will be truncated.

Note: After an update IISReset /noforce is required.

Note: Above customization is unsupported and you must take precautionary measure to make sure to avoid any problem with CRM system.

Advertisements

Copying Dynamics CRM form values to the clipboard

For multiple records MS CRM options like mail merge and Excel exports are mighty handy.
For single record data export the Clipboard is more the way to go.

If you need the name and address of a certain account or contact … you want that to be directly available… in your CTRL-V.
If you want to print using a label printer… perhaps.
Exporting it to Excel or starting the Mail Merge may be a bit much to do… you for one record.

Start using this option… an ISV button “Copy name and address to clipboard” executing a JavaScript copying certain values to the clipboard.

OnLoad

CopyToClipboard =

    function () {

        // Construct the string you want on the clipboard.

        var sClipBoard = crmForm.all.firstname.DataValue + ” ” + crmForm.all.lastname.DataValue + “\n” +

                       crmForm.all.address1_line1.DataValue + “\n” +

                       crmForm.all.address1_city.DataValue + “, ” + crmForm.all.address1_stateorprovince.DataValue + ” ” + crmForm.all.address1_postalcode.DataValue;

        // Use/Create a input area

        var oClipBoard = document.getElementById(“ClipBoard”);

        if (oClipBoard == null) {

           oClipBoard = document.createElement(“input”);

           oClipBoard.setAttribute(“id”, “ClipBoard”);

           oClipBoard.setAttribute(“type”, “hidden”);

            document.getElementById(“crmForm”).appendChild(oClipBoard);

            }

        // Put in the clipboard string

        oCopyArea.innerText = sClipBoard;

        // Now copy to the string clipboard

        var oCopyText = oCopyArea.createTextRange();

        oCopyText.execCommand(“Copy”);

        };

 

Make the function available as an ISV button:

 
 

        <Entity name=”contact” >

          <ToolBar>

            <Button JavaScript=” CopyToClipboard ();” Icon=”/_imgs/ico_16_132.gif” ValidForCreate=”1″ ValidForUpdate=”1″ AvailableOffline=”true”>

              <Titles>

                <Title LCID=”1033″ Text=” Copy name and address to clipboard ” />

              </Titles>

              <ToolTips>

                <ToolTip LCID=”1033″ Text=” Copy name and address to clipboard ” />

              </ToolTips>

            </Button>

          </ToolBar>

        </Entity>

DateJS.js and MS CRM

My customer had a wish of calculating estimated revenue based on hour per week, amount per hour and calculated based on business days between start date and the end data.
There was a tiny little detail that caused some thinking… which was that the end data is most cases start date + 3 months… so I needed to calculate the end data.


Problem #1 was the calculation of business days between two dates.
This wasn’t too hard, since Google found me an answer that looked like this:

Solution #1

function calcBusinessDays(dDate1, dDate2) { // input given as Date objects

var iWeeks, iDateDiff, iAdjust = 0;

if (dDate2 < dDate1) return -1; // error code if dates transposed

var iWeekday1 = dDate1.getDay(); // day of week

var iWeekday2 = dDate2.getDay();

iWeekday1 = (iWeekday1 == 0) ? 7 : iWeekday1; // change Sunday from 0 to 7

iWeekday2 = (iWeekday2 == 0) ? 7 : iWeekday2;

if ((iWeekday1 > 5) && (iWeekday2 > 5)) iAdjust = 1; // adjustment if both days on weekend

iWeekday1 = (iWeekday1 > 5) ? 5 : iWeekday1; // only count weekdays

iWeekday2 = (iWeekday2 > 5) ? 5 : iWeekday2;

// calculate difference in weeks (1000mS * 60sec * 60min * 24hrs * 7 days = 604800000)

iWeeks = Math.floor((dDate2.getTime() – dDate1.getTime()) / 604800000)

if (iWeekday1 <= iWeekday2) {

iDateDiff = (iWeeks * 5) + (iWeekday2 – iWeekday1)

} else {

iDateDiff = ((iWeeks + 1) * 5) – (iWeekday1 – iWeekday2)

}

iDateDiff -= iAdjust // take into account both days on weekend

return (iDateDiff + 1); // add 1 because dates are inclusive

}

Problem #2 was the calculation of the end date.
Adding a month is not a function in standard JS… so I tried

Let’s say the start date was December 1st this year, which in CRM looks like this:

Wed Dec 1 10:27:00 UTC+0100 2010 [Object]

If I calculate my end date in the old school fashion JS:

New Date.setDate(startDate.getDate() + 90) 
My date will look like this 
"Wed Dec 1 10:27:00 UTC+0100 201090" [string] 
MS CRM will handle this string, when a field is set to this value. 
However de calcBusinessDays function required a Date Object and not a string. 

Solution #2

http://www.datejs.com/ is the solution here.

Add the Data.js to be loaded in the <CRM Install Folder>\_static\_common\scripts\global.js

document.write(‘<script language=”javascript” src=”\/_customJava\/customDate.js”><\/script>’)

The calculation then looks like this:

crmForm.all.new_expectedrevenue.DataValue = calcBusinessDays(crmForm.all.new_startdate.DataValue, crmForm.all.new_enddate.DataValue.add(3).month()) * crmForm.all.new_rateperhour.DataValue;

The date function in the DateJS library do return Date objects.

Other examples of the DataJS library are below… it’s a very powerful library.

// Get today’s date

Date.today();

// Add 5 days to today

Date.today().add(5).days();

// Get Friday of this week

Date.friday();

// Get March of this year

Date.march();

// Is today Friday?

Date.today().is().friday(); // true|false

// What day is it?

Date.today().getDayName();

// Get the first Monday of the year

Date.january().first().monday()

// Get the last Friday of the year

Date.dec().final().fri()

// Set a date to the 15th of the current month at 4:30 PM,

// then add 90 days and make sure that date is a weekday,

// else move to the next weekday.

var d1 = Date.today()

.set({ day: 15, hour: 16, minute: 30 })

.add({ days: 90 })

if (!d1.isWeekday()) {

d1.next().monday();

}

// Lets start simple. “Today”

Date.parse(‘today’);

// How about tomorrow?

Date.parse(‘tomorrow’);

// July 8?

Date.parse(‘July 8’);

// With a year?

Date.parse(‘July 8th, 2007’);

// And time?

Date.parse(‘July 8th, 2007, 10:30 PM’);

// Get the date, move to Monday (if not already Monday),

// then alert the date to the user in a different format.

var d1 = Date.parse(‘8-Jul-2007’);

if (!d1.is().monday()) {

d1.last().monday();

}

alert(d1.toString(‘dddd, MMMM d, yyyy’));


Hide “CRM for Outlook” button

We’ve been implementing MS CRM 4.0 on premise at a customer that uses Lotus Notes.
After installing roll-up 7 the CRM for Outlook button became available.
Since this customer doesn’t use MS Outlook, the request came to hide the CRM for Outlook button.

It’s pretty easy, once you know it.

  • On the Microsoft Dynamics CRM Application Server start RegEdit.
  • Locate the registry subkey: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSCRM.
  • Create a new DWORD (32-bit) Value by the name DisableOutlookSetupLink and set the value to 1 to disable the CRM for Outlook button for all users.

ISV Buttons reappear after resize

MS CRM 4.0 has a great feature… disappearing ISV button label on a CRM Form when the form is not maximized.

However there is a problem…. the reappearance of ISV buttons after resizing the window.

Only a F5 (refresh) of the window will re-disappear the ISV buttons… since the OnLoad is re-executed.

 

In my case I have five button for Complaint Handling (never mind that).

When I open my complaint record, there is one ISV button… that’s correct

On Resize

Hey… this isn’t right.

Hit F5 and…

Ye… that’s right.

Now maximize again…

No… not good…

 

 

Solution

In the OnLoad handle hiding the ISV buttons in a separate funtion and attach the onresize to the form.

attachEvent(“onresize”,HandleButtons);

 

function HandleButtons() {

    // HandleButtons

    switch (parseInt(crmForm.all.statuscode.DataValue)) {

    case 3:        // Received

        HideIsvButton(new Array(“Assign to Investigator”, “Assign to Coordinator”, “Approve Complaint”, “Close Complaint”));

        break;

    case 6:     // Register

    …

}

 

That’s all there’s to it.

 

 

 

Calling Postcode webservice from www.webservices.nl using from JavaScript

 

See here my implementation for calling both the national address and the international postcode webservice from www.webservices.nl.

 

    When multiple addresses need to be resolved, this is the dialog that should come up.

 

 

 

 

Webservice JavaScript

 

var CONTACT_ADDRESS_1 = 10;

var CONTACT_ADDRESS_2 = 11;

var CONTACT_ADDRESS_3 = 12;

var ACCOUNT_ADDRESS_1 = 20;

var ACCOUNT_ADDRESS_2 = 21;

var ACCOUNT_ADDRESS_3 = 22;

 

var ORGANISATION_NAME = “CRMORGANISATION”;

var SERVER_URL = “http://crm.dev.intra/&#8221;;

 

// —————————————–

// Validate Address with webservices.nl

// —————————————–

 

function AddressWebservice(i_Land, i_Postcode, i_Huisnummer, i_Toevoeging, i_Straat, i_Plaats, FORM_ADRES) {

/*

Examples for calling the webservice

https://ws1.webservices.nl/rpc/get-simplexml/UTF-8/addressReeksFullParameterSearch/WebService_User/****************/////93//2991/KK//

https://ws1.webservices.nl/rpc/get-simplexml/UTF-8/internationalAddressSearchV2/WebService_User/***********************///unter%20den%20eichen/1//wiesbaden///de//

*/

// Pre-checks

    this._debug = false;

    

    if (this._debug) {

        debugger;

    }

 

    // For dutch addrress postocde and huisnummer is required.

    // For international adresses al least 3 out of 4, when postcode is not filled

    if (i_Land == ‘NETHERLANDS’ || _IsNull(i_Land)) {

        if (_IsNull(i_Postcode) || _IsNull(i_Huisnummer)) { return true; }

    }

    else {

        if ((_IsNull(i_Postcode)) && (_IsNull(i_Straat))) {

            return true; }

        else {

            if ((_IsNull(i_Huisnummer)) && (_IsNull(i_Plaats))) {

                return true;

            }

        }

    }

    
 

// Set the credentials to successfully logon to the webservice

this._auth_username = ‘Webservice_User’;

this._auth_password = ‘*********************’;

    

/*

Interface for addressReeksFullParameterSearch method

*/

this._N6L_province = ”; // string

this._N6L_district = ”; // string

this._N6L_city = ”;                 //i_Plaats; // string

this._N6L_street = ”;                 //i_Straat; // string

this._N6L_houseNo = i_Huisnummer // int

this._N6L_houseNoAddition = i_Toevoeging; // string

this._N6L_nbcode = Left(i_Postcode.toUpperCase(),4); // string

this._N6L_lettercombination = Right(i_Postcode.toUpperCase(), 2); // string

this._N6L_addresstype = ”; // string

this._N6L_page = ”; // int

/*

Interface for the internationalAddressSearchV2 method

*/

this._I11L_organization = ”; // string

this._I11L_building = ”; // string

this._I11L_street = i_Straat; // string

this._I11L_housenr = i_Huisnummer + i_Toevoeging; // string

this._I11L_pobox = ”; // string

this._I11L_locality = i_Plaats; // string

this._I11L_postcode = i_Postcode.toUpperCase(); // string

this._I11L_province = ”; // string

this._I11L_country = i_Land // string

this._I11L_language = ‘NL’; // string

this._I11L_country_format = ‘iso_2’ // string

 

var _baseurl = ‘https://ws1.webservices.nl/rpc/get-simplexml/UTF-8&#8217;;

var _webmethod_international = ‘internationalAddressSearchV2’;

var _webmethod_national = ‘addressReeksFullParameterSearch’;

var _webservicecall = ”;

    this.items = new Array();

 

// Check address for the Netherlands

if (i_Land == ‘NETHERLANDS’ || _IsNull(i_Land)) {

        _webservicecall = _baseurl + ‘/’ + _webmethod_national + ‘/’ + this._auth_username + ‘/’ + this._auth_password + ‘/’ +

this._N6L_province + ‘/’ + this._N6L_district + ‘/’ + this._N6L_city + ‘/’ + this._N6L_street + ‘/’ + this._N6L_houseNo + ‘/’ +

this._N6L_houseNoAddition + ‘/’ + this._N6L_nbcode + ‘/’ + this._N6L_lettercombination + ‘/’ + this._N6L_addresstype + ‘/’ + this._N6L_page;

 

}

else {

_webservicecall = _baseurl + ‘/’ + _webmethod_international + ‘/’ + this._auth_username + ‘/’ + this._auth_password + ‘/’ +

this._I11L_organization + ‘/’ + this._I11L_building + ‘/’ + this._I11L_street + ‘/’ + this._I11L_housenr + ‘/’ +

this._I11L_pobox + ‘/’ + this._I11L_locality + ‘/’ + this._I11L_postcode + ‘/’ + this._I11L_province + ‘/’ +

this._I11L_country + ‘/’ + this._I11L_language + ‘/’ + this._I11L_country_format;

}

    

    var xmlhttp = GetXmlHttp();

if (xmlhttp) {

        xmlhttp.open(“POST”, _webservicecall, true);

        xmlhttp.setRequestHeader(“Content-Type”, “application/x-www-form-urlencoded”);

        

        try

        {

            xmlhttp.send(_webservicecall);

        }

        catch(ex)

        {

            alert(ex);

            //succesFullTransformation = false;

        }

        

        xmlhttp.onreadystatechange = function()

        {

            if(xmlhttp.readyState==4 && xmlhttp.responseXML)

            {

                var response = xmlhttp.responseXML;

            

                //var errorCode = response.documentElement.selectSingleNode(“ErrorCode”);

                //var errorMessage = response.documentElement.selectSingleNode(“ErrorMessage”);

                

                if (this._debug) {

                    debugger;

                }

                

                if (response == null || response.documentElement == null) {

                    var _msg = “Fout bij het ophalen van de postcde.\nControleer of de volgende combinatie een juist adres kan opleveren: \n”;

                    _msg += ((_IsNull(i_Land))?””:”Land: ” + i_Land + “,\n”);

                    _msg += ((_IsNull(i_Postcode))?””:”Postcode: ” + i_Postcode + “,\n”);

                    _msg += ((_IsNull(i_Huisnummer))?””:”Huisnummer: ” + i_Huisnummer + “,\n”);

                    _msg += ((_IsNull(i_Toevoeging))?””:”Toevoeging: ” + i_Toevoeging + “,\n”);

                    _msg += ((_IsNull(i_Straat))?””:”Straat: ” + i_Straat + “,\n”);

                    _msg += ((_IsNull(i_Plaats))?””:”Plaats: ” + i_Plaats);

                    alert(_msg);

                    return null;                     

                }

                else {

                    if (i_Land == ‘NETHERLANDS’ || _IsNull(i_Land)) {

                        this.items = NationalAddresObject(response); }

                    else {

                        this.items = InternationalAddresObject(response); }

                    }

                

                SetAddressFields(FORM_ADRES, this.items);

            }

        }

    }

}

 

function InternationalAddresObject(xmlResponse) {

    //alert(‘Under Construction’);

    

    var _resultcount = xmlResponse.documentElement.selectSingleNode(“/response/result”).childNodes.length;

    this.items = new Array();

    

    // adresregel 1, huisnummer, toevoeging, adresregel 2, adresregel 3, plaats, postcode, provincie, land

 

    switch(_resultcount)

    {

        case 0 :

            alert(‘Ongeldig huisnummer en postcode combinatie voor een buitenlands adres. Voer een geldig huisnummer en postcode combinatie in.’ );

            break;

        case 1 :

            this.items[0] = xmlResponse.documentElement.selectSingleNode(“/response/result/entry/address/street”).text;

            this.items[1] = xmlResponse.documentElement.selectSingleNode(“/response/result/entry/address/housenr”).text;

            this.items[2] = ”;

            this.items[3] = ”;

            this.items[4] = xmlResponse.documentElement.selectSingleNode(“/response/result/entry/address/province”).text;

            this.items[5] = xmlResponse.documentElement.selectSingleNode(“/response/result/entry/address/locality”).text;

            this.items[6] = xmlResponse.documentElement.selectSingleNode(“/response/result/entry/address/postcode”).text;

            this.items[7] = xmlResponse.documentElement.selectSingleNode(“/response/result/entry/address/province”).text;

            this.items[8] = xmlResponse.documentElement.selectSingleNode(“/response/result/entry/address/country”).text;

            break;

        default :

            //if (_resultcount == 20) {

                //alert(‘Er zijn 20 adressen of meer gevonden voor deze dit huisnummer en postcode combinatie.’);

                var arrAddresses = new Array();

                

                var _results = xmlResponse.selectNodes(‘/response/result/entry/address’);

                for (i=0; i<_resultcount; i++)

                {

                    arrAddresses[i] = _results[i].getElementsByTagName(‘street’)[0].text + ” ” +

                                     _results[i].getElementsByTagName(‘housenr’)[0].text + ” ” +

                                     _results[i].getElementsByTagName(‘countryspecific_locality’)[0].text + ” (” +

                                     _results[i].getElementsByTagName(‘province’)[0].text + “) ” +

                                     _results[i].getElementsByTagName(‘country’)[0].text

                }

 

                var props = ‘dialogHeight:400px;dialogWidth:730px;center:yes;resizable:no;status:no;scroll:no’;

                retval = null;

                retval = window.showModalDialog(‘/_static/_common/scripts/qnh/addresslist.html’, arrAddresses, props);

 

                if (this._debug) {

                    debugger;

                }    

                    

                if (retval != null) {

                

                    this.items[0] = xmlResponse.getElementsByTagName(‘result’)(0).getElementsByTagName(‘entry’)(retval).getElementsByTagName(‘address’)(0).getElementsByTagName(‘street’)(0).text

                    this.items[1] = xmlResponse.getElementsByTagName(‘result’)(0).getElementsByTagName(‘entry’)(retval).getElementsByTagName(‘address’)(0).getElementsByTagName(‘housenr’)(0).text

                    this.items[2] = ”;

                    this.items[3] = xmlResponse.getElementsByTagName(‘result’)(0).getElementsByTagName(‘entry’)(retval).getElementsByTagName(‘address’)(0).getElementsByTagName(‘province’)(0).text;

                    this.items[4] = ”;

                    this.items[5] = xmlResponse.getElementsByTagName(‘result’)(0).getElementsByTagName(‘entry’)(retval).getElementsByTagName(‘address’)(0).getElementsByTagName(‘locality’)(0).text

                    this.items[6] = xmlResponse.getElementsByTagName(‘result’)(0).getElementsByTagName(‘entry’)(retval).getElementsByTagName(‘address’)(0).getElementsByTagName(‘postcode’)(0).text

                    this.items[7] = xmlResponse.getElementsByTagName(‘result’)(0).getElementsByTagName(‘entry’)(retval).getElementsByTagName(‘address’)(0).getElementsByTagName(‘province’)(0).text

                    this.items[8] = xmlResponse.getElementsByTagName(‘result’)(0).getElementsByTagName(‘entry’)(retval).getElementsByTagName(‘address’)(0).getElementsByTagName(‘country’)(0).text

                    

                }

                break;

    }

    

    if (this._debug) {

        debugger;

    }

    

    return this.items;

}

 

function NationalAddresObject(xmlResponse) {

    //alert(xmlResponse.xml);

    var _resultcount = xmlResponse.documentElement.selectSingleNode(“/response/results”).childNodes.length;

    this.items = new Array();

    

    switch(_resultcount)

    {

        case 0 :

            alert(‘Ongeldig huisnummer en postcode combinatie voor een adres in Nederland. Voer een geldig huisnummer en postcode combinatie in.’ );

            break;

        case 1 :

            this.items[0] = xmlResponse.documentElement.selectSingleNode(“/response/results/entry/straatnaam”).text;

            this.items[1] = ”;

            this.items[2] = ”;

            this.items[3] = ”;

            this.items[4] = ”;

            this.items[5] = xmlResponse.documentElement.selectSingleNode(“/response/results/entry/plaatsnaam”).text;

            this.items[6] = xmlResponse.documentElement.selectSingleNode(“/response/results/entry/wijkcode”).text +

                            xmlResponse.documentElement.selectSingleNode(“/response/results/entry/lettercombinatie”).text;

            this.items[7] = xmlResponse.documentElement.selectSingleNode(“/response/results/entry/provincienaam”).text;

            this.items[8] = ”;

            break;

        default :

            alert(‘Er zijn meer adressen gevonden voor deze dit huisnummer en postcode combinatie’);

            break;

    }

    

    return this.items;

    

}

 

function SetAddressFields(i_Address, arrAddress) {

 

    // fill the form fields with

}

 

//——————–

// Common scripts

//——————–

function _IsNull( value ) {

return ( “undefined” == typeof( value ) || “unknown” == typeof( value ) || null == value || ”==value );

}

 

function xreplace(checkMe,toberep,repwith){

    var temp = checkMe;

    var i = temp.indexOf(toberep);

 

    while(i > -1)

    {

        temp = temp.replace(toberep, repwith);

        i = temp.indexOf(toberep, i + repwith.length + 1);

    }

    return temp;

}

 

function Left(str, n){

    if (n <= 0)

        return “”;

    else if (n > String(str).length)

        return str;

    else

        return String(str).substring(0,n);

}

 

function Right(str, n){

if (n <= 0)

return “”;

else if (n > String(str).length)

return str;

else {

var iLen = String(str).length;

return String(str).substring(iLen, iLen – n);

}

}

 

function GetXmlHttp() {

 

    var x = null;

    try

    {

        x = new ActiveXObject(“Msxml2.XMLHTTP”);

    }

    catch (e)

    {

        try

        {

            x = new ActiveXObject(“Microsoft.XMLHTTP”);

        }

        catch (e)

        {

            x = null;

        }

    }

 

    if (!x && typeof XMLHttpRequest != “undefined”)

    {

        x = new XMLHttpRequest();

    }

 

    return x;

}

2. AddressList.html

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”&gt;

<HTML>

    <HEAD>

        <title>Selecteer een adres</title>

        <meta content=”Microsoft Visual Studio 7.0″ name=”GENERATOR”>

        <meta content=”C#” name=”CODE_LANGUAGE”>

        <meta content=”JavaScript” name=”vs_defaultClientScript”>

        <meta content=”http://schemas.microsoft.com/intellisense/ie5&#8243; name=”vs_targetSchema”>

        <link href=”address.css” rel=”stylesheet” type=”text/css”>

    </HEAD>

    <body MS_POSITIONING=”GridLayout” onload=”init()”>

        <script language=”javascript”>

        function init()

        {

         //debugger;

         var arrList;

            var i;

            

            arrList = window.dialogArguments;

            

            var lb = document.getElementById(‘AddressSelector’);

            for (i=0;i<arrList.length;i++)

            {

                lb[lb.options.length] = new Option( arrList[i], 0);

            }

        }

        

        function closeme(val)

        {

            var SelText;

            var ret;

            var arrTokens;

            

            if (val == true)

            {

                var lb = document.getElementById(‘AddressSelector’);

                

                if(lb.selectedIndex >= 0)

                {                    

                    ret = lb.selectedIndex;

                }

                else

                {

                    ret = null;

                }

            }

            else

            {

                ret = null;

            }

            window.returnValue = ret;

            window.close();

        }

        </script>

        <form id=”crmForm” name=”crmForm” class=”crm” method=”post” runat=”server”>

            <table cellspacing=”0″ cellpadding=”0″ border=”0″ width=”100%” height=”100%”>

                <TBODY>

                    <tr height=”48″>

                        <td>

                            <table cellspacing=”0″ cellpadding=”0″ class=”mnubar” id=”mnuBar1″>

                                <tr>

                                    <td id=”tdTitle” class=”mnuTitle mnuRight” noWrap>Zoek een adres</td>

                                </tr>

                            </table>

                            <div style=”BORDER-TOP:#a8aeb5 1px solid; BORDER-BOTTOM:#ffffff 1px solid”></div>

                            <table cellspacing=”0″ cellpadding=”0″ class=”mnubar” id=”mnuBar2″>

                                <tr>

                                    <td id=”tdTitle” class=”mnuTitle mnuRight” noWrap></td>

                                </tr>

                            </table>

                            <div style=”BORDER-TOP:#a8aeb5 1px solid; BORDER-BOTTOM:#000000 1px solid”></div>

                        </td>

                    </tr>

                    <tr>

                        <td style=”PADDING-RIGHT:10px; PADDING-LEFT:10px; PADDING-BOTTOM:10px; PADDING-TOP:10px”>

                            <table width=”100%” height=”100%” cellspacing=”0″ cellpadding=”0″>

                                <tr>

                                    <td height=”15″></td>

                                </tr>

                                <tr>

                                    <td>

                                        <div class=”tab” style=”DISPLAY:inline”>

                                            <asp:Label id=”Label1″ style=”Z-INDEX: 101; LEFT: 10px; POSITION: absolute; TOP: 9px” runat=”server”>Selecteer een adres:</asp:Label>

                                            <SELECT id=”AddressSelector” style=”Z-INDEX: 104; LEFT: 11px; WIDTH: 688px; POSITION: absolute; TOP: 32px; HEIGHT: 168px”

                                                size=”10″ ondblclick=”closeme(true)” class=”INPUT”>

                                            </SELECT>

                                            <INPUT style=”Z-INDEX: 102; LEFT: 528px; WIDTH: 68px; POSITION: absolute; TOP: 208px; HEIGHT: 24px”

                                                type=”button” value=”OK” name=”btnOK” onclick=”closeme(true)”> <INPUT style=”Z-INDEX: 103; LEFT: 616px; WIDTH: 72px; POSITION: absolute; TOP: 208px; HEIGHT: 24px”

                                                type=”button” value=”Cancel” name=”btnCancel” onclick=”closeme(false)”>

                                        </div>

                                    </td>

                                </tr>

                            </table>

                        </td>

                    </tr>

                    <tr height=”23″>

                        <td class=”statusbar” colspan=”2″></td>

                    </tr>

                </TBODY>

            </table>

        </form>

    </body>

</HTML>

3.Address.css

formButton

{

background-color: #6699cc;

padding: 2px 4px 3px 4px;

color: #000000;

font-size: 8pt;

font-family: tahoma;

height: 17px;

filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0,

StartColorStr=#B4C5DF, EndColorStr=#91A9D0);

border-width: 0px;

}

 

TEXTAREA

{

font-size: 8pt;

font-family: tahoma;

width: 100%;

height: 100%;

border: 1px solid #7b9ebd;

 

}

 

.inputfields

{

font-size: 8pt;

font-family: tahoma;

width: 100%;

height: 19px;

border: 1px solid #7b9ebd;

}

 

INPUT.rad

{

width: 15px;

border: 0px;

cursor: hand;

}

 

DIV.tab

{

    overflow-y:            auto;

    padding: 10px;

}

 

TD.sec

{

    width:                100%;

    color:                #000000;

    font-weight:        bold;

    padding-left:        0px;

    padding-bottom:        2px;

    text-overflow:        ellipsis;

    overflow:            hidden;

}

 

TD

{

font-size: 11pt;

font-family: tahoma;

}

 

TD.bar

{

    border-bottom:        1px solid #000000;

}

 

 

TD.req

{

    font-weight:        bold;

    color:                #9F2409;    

    overflow:            hidden;

    text-overflow:        ellipsis;    

    padding-top:        5px;

}

 

TD.statusBar

{

    background-color:    #63769B;

    color:                #ffffff;

    padding-left:        5px;

    height:                24px;

    border-bottom:        1px solid #485673;

    font-weight:        bold;

}

 

 

LABEL

{

cursor: hand;

}

 

TD.radioLabel

{

padding-left: 2px;

padding-right: 10px;

}

 

TABLE.layout

{

table-layout: fixed;

width: 100%;

height: 100%;

}

 

div.tab

{

width: 100%;

height: 100%;

border: 1px solid #466094;

background-color: #EEF0F6;

display: none;

}

 

body

{

    font-size: 11px;

    margin:    0px;

    border: 0px;

    background-color: #acc0e9;

    cursor: default;

}

 

td

{

font-size: 11px;

}

 

table

{

cursor: default;

}

 

a

{

    color: #0000ff;

    font-weight: bold;

}

 

span.menu

{

height: 100%;

padding: 2px;

padding-left: 5px;

padding-right: 5px;

border: 1px solid #7288AC;

}

 

table.mnuBar

{

    color: #000000;

    height: 22px;

    width: 100%;

    filter:    progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#DCDFE5, EndColorStr=#BDC2CB);

}

 

td.mnuTitle

{

font-size: 11px;

font-weight: bold;

letter-spacing: 1px;

cursor: default;

color: #000000;

}

 

td.mnuRight

{

width: 100%;

text-align: right;

padding-right: 5px;

}

 

INPUT

{

font-size:        8pt;

width:            100%;

height:            19px;

border:            1px solid #7b9ebd;

}