Click here to Skip to main content
13,094,454 members (56,677 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


2 bookmarked
Posted 1 Dec 2010

Set a default pricelist in Microsoft CRM

, 19 Dec 2010
Rate this:
Please Sign up or sign in to vote.
If you do not want to deal with numerous pricelists, or you just want a fixed pricelist to be used, this code can help you.
When you start to use Microsoft CRM, you don't always want to hassle with the pricelist. Certainly not if you just want to input simple information.

Even later on, when you want to add *a lot* of information, you can use this snippet to lighten your load.

Add this code to the Form_Load-routine and/or the Form_Save-routine.

The latter will make sure that if the field is intentionally left blank, it is updated just before the save-action.

if(crmForm.all.pricelevelid.DataValue == null)
  //Create an array to set as the DataValue for the lookup control.
  var lookupData = new Array();
  //Create an Object add to the array.
  var lookupItem= new Object();
  //Set the id, typename, and name properties to the object.
  // You should check your system for the actual ID. = '07C0BC95-A8EF-DE11-A87B-00505681263E';
  lookupItem.typename = 'pricelevel'; = 'Standaard';
  // Add the object to the array.
  lookupData[0] = lookupItem;
  // Set the value of the lookup field to the value of the array.
  crmForm.all.pricelevelid.DataValue = lookupData;


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Founder Arkro IT
Netherlands Netherlands
This member doesn't quite have enough reputation to be able to display their biography and homepage.

You may also be interested in...

Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.170813.1 | Last Updated 19 Dec 2010
Article Copyright 2010 by Dennis_Aries
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid