# Filling a DataView With the Output of a Function Call \[Tutorial\]

**URL:** <https://www.epiusers.help/t/filling-a-dataview-with-the-output-of-a-function-call-tutorial/103550>\
**Category:** Kinetic ERP\
**Created:** [June 2, 2023, 8:07pm UTC](https://www.epiusers.help/t/filling-a-dataview-with-the-output-of-a-function-call-tutorial/103550 "2023-06-02T20:07:41Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlwaysFocus](https://www.epiusers.help/user_avatar/www.epiusers.help/alwaysfocus/32/89973_2.png) [@AlwaysFocus](https://www.epiusers.help/u/AlwaysFocus)\
**Post date:** [June 2, 2023, 8:07pm UTC](https://www.epiusers.help/t/filling-a-dataview-with-the-output-of-a-function-call-tutorial/103550/1 "2023-06-02T20:07:41Z")

</div>

### This example will cover using a function that calls a BAQ that accepts an input paramater and then returns the result dataset as an output parameter from the function to the calling Kinetic app and populates a dataview and displays some of the fields.

1. It is assumed that a BAQ has already built and has been configured to accept at least one parameter:  

2. The Epicor Function will be set up as follows (you don’t actually need the “custom code widget” flag):  

**Since we are only passing one parameter, we’ll use the set field widget**

 ![image](https://www.epiusers.help/uploads/default/original/3X/3/9/39578304382656fbffcb9daa4fe428f2f53e09c3.jpeg)  
 ![image](https://www.epiusers.help/uploads/default/original/3X/0/b/0bb4332437ac1c9742b788547ee141bb550fe1d9.jpeg)

1. Navigate to App Studio for the screen that you will want to call the function from

2. Create a new layer or use an existing one

3. For this example we are going to create an event that triggers when a part number is populated on an order detail line in order entry

4. Create a DataView to hold the results of our function response:  
1)  

5. Create a new event:  

6. Give the event a name

7. Set the event trigger to the following:  

8. Add an **erp-function** widget to the designer:  

9. Set it up as follows:  
1)Top level settings:  

10. Let’s confirm that we are indeed now populating our Custom\_BAQResults DataView.

11. Now we will set up a new field to hold the value of one of our results

12. Navigate back to the App Studio tab and on the **Application Map** , select the **Lines → Detail** page and click on the **Pencil Icon** to edit:  

13. Add a new text box  

14. Set the boxes EpiBinding to be one of the columns in our **Custom\_BAQResults** DataView, the names will match the **Alias** column from our BAQ:  
1)  

15. Success!

Please roast me in the comments for anything I got wrong. 🙂

---

<div class="post-metadata">

**Author:** ![klincecum](https://www.epiusers.help/user_avatar/www.epiusers.help/klincecum/32/100137_2.png) [@klincecum](https://www.epiusers.help/u/klincecum)\
**Post date:** [June 2, 2023, 8:46pm UTC](https://www.epiusers.help/t/filling-a-dataview-with-the-output-of-a-function-call-tutorial/103550/2 "2023-06-02T20:46:50Z")

</div>

> [@AlwaysFocus](#):
>
> Please roast me in the comments

Don’t worry I will when I actually have time to read it.

For now I’ll give you a 👏 for what I’m sure is an awesome post.

Wondering when you would show up.

---

<div class="post-metadata">

**Author:** ![klincecum](https://www.epiusers.help/user_avatar/www.epiusers.help/klincecum/32/100137_2.png) [@klincecum](https://www.epiusers.help/u/klincecum)\
**Post date:** [June 2, 2023, 9:05pm UTC](https://www.epiusers.help/t/filling-a-dataview-with-the-output-of-a-function-call-tutorial/103550/3 "2023-06-02T21:05:38Z")

</div>

You can leave the Api-Key blank. Still shows as required but it’s not for internal calls anymore.

No need to store sensitive information in the layer anymore.

---

<div class="post-metadata">

**Author:** ![AlwaysFocus](https://www.epiusers.help/user_avatar/www.epiusers.help/alwaysfocus/32/89973_2.png) [@AlwaysFocus](https://www.epiusers.help/u/AlwaysFocus)\
**Post date:** [June 2, 2023, 9:33pm UTC](https://www.epiusers.help/t/filling-a-dataview-with-the-output-of-a-function-call-tutorial/103550/4 "2023-06-02T21:33:03Z")

</div>

Correct! I can’t recall exactly which version still required it. If someone is following along in an older version then know that you may require that field. But if you are on cloud you definitely don’t need it.

---

<div class="post-metadata">

**Author:** ![Mark\_Wonsil](https://www.epiusers.help/user_avatar/www.epiusers.help/mark_wonsil/32/51594_2.png) [@Mark\_Wonsil](https://www.epiusers.help/u/Mark_Wonsil)\
**Post date:** [June 4, 2023, 11:43am UTC](https://www.epiusers.help/t/filling-a-dataview-with-the-output-of-a-function-call-tutorial/103550/5 "2023-06-04T11:43:15Z")

</div>

> [@klincecum](#):
>
> Still shows as required but it’s not for internal calls anymore.

Not sure this is a good long-term security strategy though…

---

<div class="post-metadata">

**Author:** ![Justin\_Grant](https://www.epiusers.help/letter_avatar_proxy/v4/letter/j/f05b48/32.png) [@Justin\_Grant](https://www.epiusers.help/u/Justin_Grant)\
**Post date:** [September 24, 2024, 2:18pm UTC](https://www.epiusers.help/t/filling-a-dataview-with-the-output-of-a-function-call-tutorial/103550/6 "2024-09-24T14:18:51Z")

</div>

yes it’s an old post, but still relevant to dynamic combo boxes without a lot of decent documentation on the subject. This is the most detailed thread I’ve found with a step by step.

I just wanted to add that you can bypass the function completely in this example by just setting up the view assigned directly to the BAQ with relevant parameters.

All the steps in this post are very helpful to seeing how to connect the dots in derivative solutions though.

---

<div class="post-metadata">

**Author:** ![jkane](https://www.epiusers.help/user_avatar/www.epiusers.help/jkane/32/57624_2.png) [@jkane](https://www.epiusers.help/u/jkane)\
**Post date:** [December 3, 2024, 3:12pm UTC](https://www.epiusers.help/t/filling-a-dataview-with-the-output-of-a-function-call-tutorial/103550/7 "2024-12-03T15:12:18Z")

</div>

Exactly what I was looking for. Thanks for putting this together.
