locked
Getting error 'null' is null or not an object. RRS feed

  • Question

  • I have edited sitemap and hidden dashboard and displayed contracts entity. Afetr this as i m trying to create record for an opportunity form(from many options of forms available) it is giving above error.

    details:

    Field:crmform

    event:onsave

    error: as written above in question.

     

    when i click OK on this error it shows:

    Record is unavailable.

    The requested record was not found or you do not have sufficient permission to wiew it.

    Error log is showing:

    Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: TransactionCurrency With Id = b1eda564-0a24-e011-86a8-1cc1dee8da72 Does Not ExistDetail:

    <OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">

      <ErrorCode>-2147220969</ErrorCode>

      <ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />

      <Message>TransactionCurrency With Id = b1eda564-0a24-e011-86a8-1cc1dee8da72 Does Not Exist</Message>

      <Timestamp>2011-09-27T05:57:57.0829221Z</Timestamp>

      <InnerFault i:nil="true" />

      <TraceText i:nil="true" />

    </OrganizationServiceFault>

     

    Please tell how to resove it.

    Error log is showing


    spkh
    Tuesday, September 27, 2011 6:27 AM

All replies

  • I don't think it has anything to do with sitemap.

    The error suggesting there is problem with the TransactionCurrency.

    Have a look buddy if you can find the currency to match that guid.

    I hope this helps.



    Amreek singh Senior CRM Consultant CDC Praxa Sydney,Australia http://mscrmshop.blogspot.com/
    • Proposed as answer by Amreek Singh Tuesday, September 27, 2011 6:38 AM
    • Edited by Amreek Singh Wednesday, September 28, 2011 12:56 PM
    Tuesday, September 27, 2011 6:38 AM
  • It seems you have hardcoded some guid in your form and CRM is unable to find that, please share your opportunity form code here


    Mahain : MS CRM Freelancer
    Tuesday, September 27, 2011 6:48 AM
    Moderator
  • Yea I have hardcoded the guid. Name of my form is HLS. I am using online version of ms crm 2011.

    Here is code for onload event of form

    HlsOnLoad = function () {

           Xrm.Page.getAttribute("new_platformid").setRequiredLevel("required");
            if (Xrm.Page.getAttribute("new_primarycontactid") != null && Xrm.Page.getAttribute("customerid") != null && Xrm.Page.getAttribute("customerid").getValue()) {
                FilteredLookup('new_primarycontactid', Xrm.Page.getAttribute("customerid").getValue()[0].name);
            }

            if (Xrm.Page.getAttribute("new_confidentialproject") != null && Xrm.Page.getAttribute("customerid") != null && Xrm.Page.getAttribute("new_confidentialproject").getValue() == true) {
                FilteredLookup('customerid', 'confidential');
            }

            if (Xrm.Page.data.entity.getId()) { }
            else {
                var loc = window.location.href;

                //TODO: Update these for dev and prod
                if (loc.search(/link for dev) > -1) { 

                    SetLookupValue('new_currencyid', '{someguid}', 'transactioncurrency', 'US Dollar');
                }
                else { 

                    SetLookupValue('new_currencyid', '{someguid}', 'transactioncurrency', 'US Dollar');
                }
            }
        }
     for onsave

    function Form_onsave() {
        if (Xrm.Page.getAttribute("new_estimatedvalue_base") != null && Xrm.Page.getAttribute("new_currencyid") != null && Xrm.Page.getAttribute("new_estimatedfees") != null && Xrm.Page.getAttribute("new_currencyid").getValue() && Xrm.Page.getAttribute("new_estimatedfees").getValue()) {
            ExchangeRate = simpleQuery('transactioncurrency', 'exchangerate', 'transactioncurrencyid', Xrm.Page.getAttribute("new_currencyid").getValue()[0].id);
            Xrm.Page.getAttribute("new_estimatedvalue_base").setValue(Xrm.Page.getAttribute("new_estimatedfees").getValue() / ExchangeRate);
        }

     


        
        if (Xrm.Page.getAttribute('new_projectenddate') != null) {
            crmForm.all.new_projectenddate.disabled = false;
        }

        getRates();
        calcBilling();

        if (Xrm.Page.getAttribute('new_discount') != null) {
            crmForm.all.new_discount.readOnly = false;
        }
        if (Xrm.Page.getAttribute('new_discountpercent') != null) {
            crmForm.all.new_discountpercent.readOnly = false;
        }
        if (Xrm.Page.getAttribute('new_wealth') != null) {
            crmForm.all.new_wealth.readOnly = false;
        }
        if (Xrm.Page.getAttribute('new_wealthpercent') != null) {
            crmForm.all.new_wealthpercent.readOnly = false;
        }
    }

     

    • Edited by spkh Wednesday, September 28, 2011 12:20 PM
    Tuesday, September 27, 2011 10:48 AM
  • That's really creating this issue, I will suggest you to fetch GUID based on name, instead of hardcodding it please refer my below post that you can use

    http://mahenderpal.wordpress.com/2011/06/28/set-default-price-list-in-ms-crm-2011-using-java-script/


    Mahain : MS CRM Freelancer
    • Proposed as answer by HIMBAPModerator Tuesday, September 27, 2011 10:56 AM
    Tuesday, September 27, 2011 10:56 AM
    Moderator
  • Each organization has a different GUID for each currency. So if you hardcode the guid, it will only work with one organization (importing the solution somewhere else will not work).

    I see you have the GUIDs different for dev and prod, but in general it is a bad practice because you are assuming you will always have the same dev and prod organizations. Why do you need to set the currency in the script? The currency should be set automatically to the default currency.


    Gonzalo | gonzaloruizcrm.blogspot.com

    Tuesday, September 27, 2011 12:28 PM
    Moderator
  • @Mahendra

    I have read your post but I am not able to understand it.

    Do I need to have full knowledge of Rest to use it?


    spkh
    Wednesday, September 28, 2011 12:40 PM