Xrm.Page.data.entity Properties and Methods
Xrm.Page.data.entity 屬性和方法
attributes
The collection of attributes for the entity.
實體entity的屬性的集合
getDataXml
Returns a string representing the xml that will be sent to the server when the record is saved
當(dāng)一個記錄被保存的時候,返回將要發(fā)生到服務(wù)器的xml數(shù)據(jù)
getEntityName
Returns a string representing the logical name of the entity for the record
返回string類型,實體entity的邏輯名稱
getId
Returns a string representing the GUID id value for the record
返回string類型,返回當(dāng)前記錄的guid
getIsDirty
Returns a Boolean value that indicates if any fields in the form have been modified
返回bool類型,如果在窗體上面的任何字段發(fā)生的更改,就返回bool
OnSave
Use the addOnSave and removeOnSave methods to add or remove event handlers to the save event
使用addOnSave和removeOnSave事件,當(dāng)發(fā)生保存的時候,執(zhí)行操作
getPrimaryAttributeValue
Gets a string for the value of the primary attribute of the entity
返回string類型,實體的主字段名稱
save
Saves the record with the options to close the form or open a new form after the save is completed
保存記錄,有關(guān)閉窗體和打開新建記錄的選擇方式
Lookup control methods and events
查找字段的方法和事件
Xrm.Page.getControl(arg).addCustomFilter(filter, entityLogicaName)
Use add additional filters to the results displayed in the lookup.
Each filter will be combined with any previously added filters as an ‘AND’ condition.
添加查詢條件,添加的條件用and連接
例子:
<filter type="and">
<condition attribute="address1_city" operator="eq" value="Redmond" />
</filter>
Xrm.Page.getControl(arg).addCustomView(viewId, entityName, viewDisplayName, fetchXml, layoutXml, isDefault)
Adds a new view for the lookup dialog box
添加一個新的查詢窗體
Xrm.Page.getControl(arg).getDefaultView()
Returns the Id value of the default lookup dialog view
返回默認視圖的guid
Xrm.Page.getControl(arg).setDefaultView(viewGuid)
Sets the default view for the lookup control dialog
設(shè)置查找控件的默認視圖
Xrm.Page.getControl(arg).addPreSearch(handler)
Use this method to apply changes to lookups based on values current just as the user is about to view results for the lookup
添加查詢事件之前的方法
Xrm.Page.getControl(arg).removePreSearch(handler)
Use this method to remove event handler functions that have previously been set for the PreSearch event
刪除用PreSearch添加的操作