Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Setting Default Pricelist

Posted on by 760

Hi ,

I want to set a default value for pricelist when the forms open

but my script is not working

var object = new Array();
object[0] = new Object();
object[0].id = "D48ABA4F-D1AC-E711-8103-C4346BADB6BC";
object[0].name = "Local";
object[0].entityType = "pricelevelid";
Xrm.Page.getAttribute("pricelevelid").setValue(object);

*This post is locked for comments

  • Suggested answer
    bw17 Profile Picture
    bw17 10 on at
    RE: Setting Default Pricelist

    Not sure if this helps but I created a business rule to achieve the same desired result mentioned. Would a business rule work for your scenario?

  • Suggested answer
    Nithya Gopinath Profile Picture
    Nithya Gopinath 17,074 on at
    RE: Setting Default Pricelist

    Hi Arci,

    Modify the code as shown below.

    var object = new Array();
    object[0] = new Object();
    object[0].id = "D48ABA4F-D1AC-E711-8103-C4346BADB6BC";
    object[0].name = "Local";
    object[0].entityType = "pricelevel";
    Xrm.Page.getAttribute("pricelevelid").setValue(object);

    Hope this helps.

  • Suggested answer
    shivaram Profile Picture
    shivaram 3,315 on at
    RE: Setting Default Pricelist

    Hi,

    Entitytype should be pricelevel...

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans