Skip to content

Commit 27501ac

Browse files
committed
Adding example
1 parent a6a1b88 commit 27501ac

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

powerapps-docs/developer/model-driven-apps/clientapi/reference/Xrm-Utility/lookupObjects.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,28 @@ search.app:
4141
|successCallback |Function |Yes |A function to call when the lookup control is invoked. An array of objects with the following properties is passed:<br/><ul><li>**entityType**: String. Entity type of the record selected in the lookup control.</li><li>**id**: String. ID of the record selected in the lookup control.</li><li>**name**: String. Name of the record selected in the lookup control.</li>|
4242
|errorCallback |Function |Yes |A function to call when you cancel the lookup control or the operation fails. |
4343

44+
## Example
45+
46+
```javascript
47+
//define data for lookupOptions
48+
var lookupOptions =
49+
{
50+
defaultEntityType: "account",
51+
entityTypes: ["account"],
52+
allowMultiSelect: false,
53+
defaultViewId:"0D5D377B-5E7C-47B5-BAB1-A5CB8B4AC10",
54+
viewIds:["0D5D377B-5E7C-47B5-BAB1-A5CB8B4AC10","00000000-0000-0000-00AA-000010001003"],
55+
searchText:"Allison",
56+
filters: [{filterXml: "<filter type='or'><condition attribute='name' operator='like' value='A%' /></filter>",entityLogicalName: "account"}]
57+
};
58+
59+
// Get account records based on the lookup Options
60+
Xrm.Utility.lookupObjects(lookupOptions).then(
61+
function(success){
62+
console.log(success);},
63+
function(error){console.log(error);});
64+
}
65+
```
4466

4567
### Related topics
4668

powerapps-docs/developer/model-driven-apps/clientapi/reference/executioncontext/getEventArgs.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ Returns an object with methods to manage the **Save** event.
3131

3232
**Description**: See [Save Event Arguments](../save-event-arguments.md).
3333

34-
3534
### Related topics
3635
[Execution context](../execution-context.md)
3736

0 commit comments

Comments
 (0)