# New Order Type - Throws Exception while saving

**URL:** https://talk.openmrs.org/t/new-order-type-throws-exception-while-saving/14004
**Category:** Bahmni
**Created:** [November 3, 2017, 8:08pm UTC](https://talk.openmrs.org/t/new-order-type-throws-exception-while-saving/14004 "2017-11-03T20:08:20Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![ramashish](https://talk.openmrs.org/letter_avatar/ramashish/32/5_5575768a8748004e209b776fc1b2916d.png) [@ramashish](https://talk.openmrs.org/u/ramashish)
#### Post date: [November 3, 2017, 8:08pm UTC](https://talk.openmrs.org/t/new-order-type-throws-exception-while-saving/14004/1 "2017-11-03T20:08:21Z")

</div>

When a new order\_type is created and mapped it to a new concept class so that it appears in “Orders” under “Consultation” as shown in the image (List of Consultants) it loads the page properly but throws exception while bahmniEncounterTransactionService.save(bahmniEncounterTransaction) on this [line](https://github.com/Bahmni/bahmni-core/blob/1826ec64cc89e69f17415e5d43405680cf1ae8d4/bahmni-emr-api/src/main/java/org/openmrs/module/bahmniemrapi/encountertransaction/impl/BahmniEncounterTransactionServiceImpl.java#L127)

 ![image](https://talk.openmrs.org/uploads/default/original/2X/3/3db88ce200058fd821f71604a4a6e3d9fdfd57ff.png)

OpenMRS settings as mentioned [here](https://bahmni.atlassian.net/wiki/spaces/BAH/pages/32014568/Configure+Orders+Tab+for+Lab+and+Radiology#ConfigureOrdersTabforLabandRadiology-MasterDataSetupforOrderTab) -

 ![image](https://talk.openmrs.org/uploads/default/original/2X/8/8b26be7dc45fd16009626ab4375437903f6dbc9b.png)

Created the required rows in mySQL ![image](https://talk.openmrs.org/uploads/default/original/2X/6/60881fd86bc72f9ab7f8b12af8247003c04d54f7.png)

What is it that is missing on this [Wiki Page to set up new order type](https://bahmni.atlassian.net/wiki/spaces/BAH/pages/32014568/Configure+Orders+Tab+for+Lab+and+Radiology#ConfigureOrdersTabforLabandRadiology-MasterDataSetupforOrderTab) that the code is throwing exception?

---

<div class="post-metadata">

### Author: ![darius](https://talk.openmrs.org/user_avatar/talk.openmrs.org/darius/32/8082_2.png) [@darius](https://talk.openmrs.org/u/darius)
#### Post date: [November 17, 2017, 8:53am UTC](https://talk.openmrs.org/t/new-order-type-throws-exception-while-saving/14004/3 "2017-11-17T08:53:09Z")

</div>

@ramashish I finally got a chance to look into this. The wiki page was missing that you need to also set the `java_class_name` column of the `order_type` table to `org.openmrs.Order`. I have updated the SQL snippet in the wiki page now, and I verified in my local install that by setting this I am able to save orders for a new order type.

Please try this out and confirm that it works, and that the wiki docs are now correct.

---

<div class="post-metadata">

### Author: ![sayoshi](https://talk.openmrs.org/letter_avatar/sayoshi/32/5_5575768a8748004e209b776fc1b2916d.png) [@sayoshi](https://talk.openmrs.org/u/sayoshi)
#### Post date: [June 25, 2019, 5:41am UTC](https://talk.openmrs.org/t/new-order-type-throws-exception-while-saving/14004/4 "2019-06-25T05:41:21Z")

</div>

@ramashish sorry for bothering you! I just need to know whether sales orders are generated for you new orders under consultation panel. If so can I please know the process? thank you
