locked
Javascript SDK.JQuery.retrieveMultipleRecords issue with boolean RRS feed

  • Question

  • Hi

    I have an issue with retrieving the correct boolean value from the Javascript SDK.JQuery.retrieveMultipleRecords method.  In the SuccessCallback part of the method I want to check if the value is True and do stuff according to the condition.  Just a simple example

    SDK.JQuery.retrieveMultipleRecords(
    		"Contact",
    		"$select=*&$filter=ParentCustomerId/Id eq guid'" + AccountId +"'",
    		function (results) {
    		var firstResult = results[0];
    		if (firstResult != null) 
    		{
    			for (var k = 0; k < results.length; k++) 
    			{
    				var ContactDetails = results[k];
    
    				
    				if (ContactDetails.new_myBoolean = true)
    				{
    				     alert('true')
    				}
    
    
    ..........

    In crm the new_myBoolean field is of type two option.  It does not matter whether the field is true all false, it always display true. 


    Please vote if you find my post useful. Add me on Skype @ christo.skype1

    Friday, June 21, 2013 9:45 AM

Answers

  • Hi,

    In your code you have used assignment "=" sign instead of comparison please change it to the "=="

    as show below,

    if (ContactDetails.new_myBoolean == true)
    				{
    				     alert('true')
    				}

    Hope this Map Helps

    Thanks & regards

    Subhash

    Friday, June 21, 2013 11:31 AM

All replies

  • Hi,

    In your code you have used assignment "=" sign instead of comparison please change it to the "=="

    as show below,

    if (ContactDetails.new_myBoolean == true)
    				{
    				     alert('true')
    				}

    Hope this Map Helps

    Thanks & regards

    Subhash

    Friday, June 21, 2013 11:31 AM
  • Looks like I've been doing way to much Pascal code lately.. 

    Please vote if you find my post useful. Add me on Skype @ christo.skype1

    Friday, June 21, 2013 11:55 AM