web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Entity type not defined!

(0) ShareShare
ReportReport
Posted on by

Hello Everyone,

Recently i have imported one solution in other instance and it is imported successfully. 

Now whenever i am opening any opportunity or going to create new opportunity throws this below error.

EntityNotDefined.png

on the same note when i create Quote from opportunity form it is throwing another error but if i open new quote it does not throw any error. below is the error

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: PriceLevel With Id = 39997901-be75-e611-80e4-c4346bad924c Does Not ExistDetail:
<OrganizationServiceFault xmlns:i="www.w3.org/.../XMLSchema-instance" xmlns="schemas.microsoft.com/.../Contracts">
<ActivityId>140f8d20-54f4-47cd-9b94-6adadf6b79de</ActivityId>
<ErrorCode>-2147220969</ErrorCode>
<ErrorDetails xmlns:d2p1="schemas.datacontract.org/.../System.Collections.Generic" />
<Message>PriceLevel With Id = 39997901-be75-e611-80e4-c4346bad924c Does Not Exist</Message>
<Timestamp>2017-08-18T06:17:33.65429Z</Timestamp>
<ExceptionRetriable>false</ExceptionRetriable>
<ExceptionSource i:nil="true" />
<InnerFault i:nil="true" />
<OriginalException i:nil="true" />
<TraceText i:nil="true" />
</OrganizationServiceFault>

Please help me on this.

Thanks in advance

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Luke Sartain Profile Picture
    1,266 on at

    In your solution do you have any code or business rule that is attempting to set the price list?  If so it's possible that the guid for that price list between the two instances is different.

  • Suggested answer
    Community Member Profile Picture
    on at

    Thank you Luke for the heads up i was confused where this issue is coming from and where i should check. :-)

    The first issue i resolved by myself the second issue is still persist.

    Thank you dear

  • Community Member Profile Picture
    on at

    Hello LUKE,

    I am getting this error when i open Dashboard, Quote or Opportunity. Do you have any idea.

    <CrmScriptErrorReport>

     <ReportVersion>1.0</ReportVersion>

     <ScriptErrorDetails>

      <Message>Uncaught TypeError: Cannot read property 'toString' of null</Message>

      <Line>46</Line>

      <URL>/%7B636386150580000344%7D/WebResources/wa_numbertoword?ver=-939939155</URL>

      <PageURL>/form/page.aspx?lcid=1033&themeId=f499443d-2082-4938-8842-e7ee62de9a23&tstamp=4231748&updateTimeStamp=636366168325815914&userts=131475226565871741&ver=-939939155#etc=1084&extraqs=%3fetc%3d1084&pagemode=iframe&pagetype=entityrecord&counter=1503052469913</PageURL>

      <Function>anonymousr:Cannotreadproperty'toString'ofnull</Function>

      <FunctionRaw>TypeError: Cannot read property 'toString' of null</FunctionRaw>

      <CallStack>

       <Function>anonymousr:Cannotreadproperty'toString'ofnull</Function>

      </CallStack>

     </ScriptErrorDetails>

     <ClientInformation>

      <BrowserUserAgent>Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36</BrowserUserAgent>

      <BrowserLanguage>undefined</BrowserLanguage>

      <SystemLanguage>undefined</SystemLanguage>

      <UserLanguage>undefined</UserLanguage>

      <ScreenResolution>1280x1024</ScreenResolution>

      <ClientName>Web</ClientName>

      <ClienState>Online</ClienState>

      <ClientTime>2017-08-18T16:04:32</ClientTime>

     </ClientInformation>

     <ServerInformation>

       <OrgLanguage>1033</OrgLanguage>

       <OrgCulture>1033</OrgCulture>

       <UserLanguage>1033</UserLanguage>

       <UserCulture>1033</UserCulture>

       <OrgID>{76A6F02B-3E2F-402C-801A-3E106F39DA0D}</OrgID>

       <UserID>{E6F5D2CD-0473-E711-80E4-3863BB34AB88}</UserID>

       <CRMVersion>8.2.1.344</CRMVersion>

     </ServerInformation>

    </CrmScriptErrorReport>

  • Luke Sartain Profile Picture
    1,266 on at

    Looks like you have a script error in your wa_numbertoword.js file.  If you post the source code for that script we can take a look.

  • Community Member Profile Picture
    on at

    var th = ['', 'Thousand', 'Million', 'Billion', 'Trillion'];

    var dg = ['Zero', 'One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine'];

    var tn = ['Ten', 'Eleven', 'Twelve', 'Thirteen', 'Fourteen', 'Fifteen', 'Sixteen', 'Seventeen', 'Eighteen', 'Nineteen'];

    var tw = ['Twenty', 'Thirty', 'Forty', 'Fifty', 'Sixty', 'Seventy', 'Eighty', 'Ninety'];

    function toWords(s) {

               s = s.toString();

               if (s != parseFloat(s))

                   return 'not a number';

               var x = s.indexOf('.');

               if (x == -1) x = s.length;

               if (x > 15)

                   return 'too big';

               var n = s.split('');

               var str = '';

               var sk = 0;

               for (var i = 0; i < x; i++) {

                   if ((x - i) % 3 == 2) {

                       if (n[i] == '1') {

                           str += tn[Number(n[i + 1])] + ' '; i++; sk = 1;

                       }

                       else if (n[i] != 0) {

                           str += tw[n[i] - 2] + ' '; sk = 1;

                       }

                   }

                   else if (n[i] != 0) {

                       str += dg[n[i]] + ' ';

                       if ((x - i) % 3 == 0) str += 'Hundred '; sk = 1;

                   }

                   if ((x - i) % 3 == 1) {

                       if (sk) str += th[(x - i - 1) / 3] + ' '; sk = 0;

                   }

               }

               if (x != s.length) {

                   var y = s.length; str += 'point ';

                   for (var i = x + 1; i < y; i++) str += dg[n[i]] + ' ';

               }

               return str.replace(/\s+/g, ' ');

           }

    function NumberToWord(executionContext) {

    setInterval(function(){

    var varInteger = null;

    var num = Xrm.Page.getAttribute("totalamount").getValue().toString();

    //console.log(num);

    if(num != null)

    {

    num = num.replace(/[\, ]/g, '');

    num = num.replace(/[\$ ]/g, '');

    var splitNum = num.split(".");

    if(splitNum[0] == null || splitNum[0] == "0")

    {

    varInteger = "Zero";

    }

    else

    {

    varInteger = toWords(splitNum[0]);

    }

    if(splitNum[1] == null)

    {

    varFraction = "Zero";

    }

    else

    {

    varFraction = toWords(splitNum[1]);

    }

    //console.log(varInteger + " - " + varFraction);

    Xrm.Page.getAttribute("wa_totalamountinwords").setValue(varInteger);

    Xrm.Page.data.save();

    }

    }, 2000);

    }

  • Verified answer
    Luke Sartain Profile Picture
    1,266 on at

    Looks like you're trying to convert totalamount to a string when totalamount is null.  You need to only get the string if it contains a value.

    Try this:

    var th = ['', 'Thousand', 'Million', 'Billion', 'Trillion'];

    var dg = ['Zero', 'One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine'];

    var tn = ['Ten', 'Eleven', 'Twelve', 'Thirteen', 'Fourteen', 'Fifteen', 'Sixteen', 'Seventeen', 'Eighteen', 'Nineteen'];

    var tw = ['Twenty', 'Thirty', 'Forty', 'Fifty', 'Sixty', 'Seventy', 'Eighty', 'Ninety'];

    function toWords(s) {

              s = s.toString();

              if (s != parseFloat(s))

                  return 'not a number';

              var x = s.indexOf('.');

              if (x == -1) x = s.length;

              if (x > 15)

                  return 'too big';

              var n = s.split('');

              var str = '';

              var sk = 0;

              for (var i = 0; i < x; i++) {

                  if ((x - i) % 3 == 2) {

                      if (n[i] == '1') {

                          str += tn[Number(n[i + 1])] + ' '; i++; sk = 1;

                      }

                      else if (n[i] != 0) {

                          str += tw[n[i] - 2] + ' '; sk = 1;

                      }

                  }

                  else if (n[i] != 0) {

                      str += dg[n[i]] + ' ';

                      if ((x - i) % 3 == 0) str += 'Hundred '; sk = 1;

                  }

                  if ((x - i) % 3 == 1) {

                      if (sk) str += th[(x - i - 1) / 3] + ' '; sk = 0;

                  }

              }

              if (x != s.length) {

                  var y = s.length; str += 'point ';

                  for (var i = x + 1; i < y; i++) str += dg[n[i]] + ' ';

              }

              return str.replace(/\s+/g, ' ');

          }

    function NumberToWord(executionContext) {

    setInterval(function(){

    var varInteger = null;

    var num = Xrm.Page.getAttribute("totalamount").getValue();

    //console.log(num);

    if(num != null)

    {

    num = num.toString();

    num = num.replace(/[\, ]/g, '');

    num = num.replace(/[\$ ]/g, '');

    var splitNum = num.split(".");

    if(splitNum[0] == null || splitNum[0] == "0")

    {

    varInteger = "Zero";

    }

    else

    {

    varInteger = toWords(splitNum[0]);

    }

    if(splitNum[1] == null)

    {

    varFraction = "Zero";

    }

    else

    {

    varFraction = toWords(splitNum[1]);

    }

    //console.log(varInteger + " - " + varFraction);

    Xrm.Page.getAttribute("wa_totalamountinwords").setValue(varInteger);

    Xrm.Page.data.save();

    }

    }, 2000);

    }

  • Community Member Profile Picture
    on at

    Hi, may I know how you resolved the first issue?

    I got the same error "Entity type not defined".

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans