2009/12/18

【MSCRM4.0】更新プログラム ロールアップ 8

更新プログラム ロールアップ 8


Microsoft Dynamics CRM 4.0 の更新プログラム ロールアップ 8 (KB 975995)



Microsoft Dynamics CRM 4.0 の更新プログラム ロールアップ 8 がリリースされました。この更新プログラムにはバグ修正とさまざまなパフォーマンス強化機能が含まれており、簡単に展開できるようにパッケージ化されています。

2009/12/10

【MSCRM4.0】パフォーマンス改善ストアドプロシージャ

下記のスクリプトをSQLServer上で実行します。

---------------------------------------------------------------------------

exec sp_configure 'show adv', 1;


RECONFIGURE WITH OVERRIDE;

exec sp_configure 'max degree', 1;

RECONFIGURE WITH OVERRIDE;

exec sp_configure;
---------------------------------------------------------------------------

2009/12/07

【MSCRM4.0】予定エンティティのマルチlookup制御

●複数エンティティ選択を1つ選択に制限します。(図1 → 図2)



(図1)



(図2)




onLoadイベントに下記のスクリプトを追加します。

-----------------------------------------------------------------------------------

FilterLookup = function(target)


{

target.setAttribute("lookuptypes", "2");  //2 ・・・ 取引先担当者

target.setAttribute("defaulttype", "2");  //2 ・・・ 取引先担当者

}



FilterLookup(crmForm.all.requiredattendees);

-----------------------------------------------------------------------------------


※requiredattendees ・・・ 必須出席者

2009/12/03

【MSCRM4.0】フォームにボタン追加

・あるフォーム上にボタンを追加するためには、ボタンに変身してもらう属性が必要です。
 下記の手順で属性を作成し、フォームに追加します。
 
 ①new_button というテキスト形式の新しい属性を作成します。
 ②フォームに①で作成した属性を追加します。
 ③new_buttonのラベルを非表示にします。フォーム上のnew_buttonのプロパティを表示し、
  フォームでラベルを表示のチェックを外します。(図1参照)


(図1)

・追加後、onLoadイベントに下記のスクリプトを追加します。
-----------------------------------------------------------------------------------

function InlineToolbar(containerId)


{



var toolbar = this;

var container = document.all[containerId];



if (!container)

{

return alert("ボタン属性: " + containerId + "が存在しません");

}



container.style.display = "none";

container = container.parentElement;



toolbar.AddButton = function(id,text,width,callback,imgSrc)

{

var btn = document.createElement("button");

var btStyle = new StyleBuilder();

btStyle.Add( "font-family" , "Arial" );

btStyle.Add( "font-size" , "12px" );

btStyle.Add( "line-height" , "16px" );

btStyle.Add( "text-align" , "center" );

btStyle.Add( "cursor" , "hand" );

btStyle.Add( "border" , "1px solid #3366CC" );

btStyle.Add( "background-color" , "#CEE7FF" );

btStyle.Add( "background-image" , "url( '/_imgs/btn_rest.gif' )" );

btStyle.Add( "background-repeat" , "repeat-x" );

btStyle.Add( "padding-left" , "5px" );

btStyle.Add( "padding-right" , "5px" );

btStyle.Add( "overflow" , "visible" );

btStyle.Add( "width" , width );



btn.style.cssText = btStyle.ToString();

btn.attachEvent("onclick",callback);

btn.id = id;



if (imgSrc)

{

var img = document.createElement("img");

img.src = imgSrc;

img.style.verticalAlign = "middle";

btn.appendChild(img);

btn.appendChild(document.createTextNode(" "));

var spn = document.createElement("span");

spn.innerText = text;

btn.appendChild(spn);

}

else

{

btn.innerText = text;

}



container.appendChild(btn);

container.appendChild(document.createTextNode(" "));



return btn;

}



toolbar.RemoveButton = function(id)

{

var btn = toolbar.GetButton(id)

if (btn)

{

btn.parentNode.removeChild(btn);

}

}



toolbar.GetButton = function(id)

{

return document.getElementById(id);

}



function StyleBuilder()

{

var cssText = new StringBuilder();

this.Add = function( key , value ){cssText.Append( key ).Append( ":" ).Append( value ).Append( ";" );}

this.ToString = function(){return cssText.ToString();}

}



function StringBuilder()

{

var parts = [];

this.Append = function( text ){parts[ parts.length ] = text;return this;}

this.Reset = function(){parts = [];}

this.ToString = function(){return parts.join( "" );}

}

}





function makeButton()

{

window.GeneralToolbar = new InlineToolbar("new_button");

GeneralToolbar.AddButton("btnClear","クリア","15%",Clear_Click);

}



function Clear_Click()

{

alert('クリアします');

}



makeButton();
 
-----------------------------------------------------------------------------------

・ボタンが表示され、クリックするとイベントを発生します。(図2参照)


(図2)