locked
Price level not updating by java script RRS feed

  • Question

  • Hi,

    I want to update the default price list when open new opportunity. Please find the java script and the screen shots.  Kindly provide the solution.

    var lookupData = new Array();

     var lookupItem= new Object();

    lookupItem.id = '{FAEE3026-FA58-DF11-A877-001F29C516D6}';  this is correct value
    lookupItem.typename = 'pricelevelid';

    lookupItem.name = 'GENERAL';

    lookupData[0] = lookupItem;
    Xrm.Page.getAttribute("pricelevelid").setValue(lookupData);

    price level is updating as shown below screen but it is not allowing to save the opportunity.

    It should be below screen when select price level from  lookup normally and it is working.


    pnoushu@hotmail.com

    Wednesday, February 15, 2017 8:38 AM

All replies

  • Entity type will be pricelevel.
    Xrm.Page.getAttribute("pricelevelid").setValue([{ id: '{FAEE3026-FA58-DF11-A877-001F29C516D6}', name: 'GENERAL', entityType: 'pricelevel'}]);

    Regards, Saad

    • Proposed as answer by Suresh Sorde Wednesday, February 15, 2017 9:39 AM
    Wednesday, February 15, 2017 9:18 AM
  • lookupItem.typename = 'pricelevelid';

    replace with

     lookupItem.typename = 'pricelevel';

    • Proposed as answer by Suresh Sorde Wednesday, February 15, 2017 9:40 AM
    Wednesday, February 15, 2017 9:40 AM