• Marcel Gómez
  • NEWBIE
  • 5 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 6
    Replies
Hi everybody,
I'm having an issue when testing a simple class that is intended to copy the Billing and Shipping Addresses from an Order object to a custom object. The thing is, I set address fields on the Order, insert the Order and everything is fine. But later, when I perform a Select query on the same Order, Address fields are not returned on the result object.

Here is my code
 
Order order = new Order();

		order.BillingCity 		= 'bcity';
		order.BillingCountry 	= 'bcountry';
		order.BillingPostalCode = 'bpostalcode';
		order.BillingState 		= 'bstate';
		order.BillingStreet 	= 'bstreet';
		
		order.ShippingCity 		= 'scity';
		order.ShippingCountry 	= 'scountry';
		order.ShippingPostalCode= 'spostalcode';
		order.ShippingState 	= 'sstate';
		order.ShippingStreet 	= 'sstreet';

		order.AccountId 		= account.Id;
		order.OpportunityId	= opp.Id;
		order.Status 			= status;

		order.EffectiveDate 	= Date.today();
		order.EndDate 		= Date.today().addDays(365);

		insert order;

		system.debug('---------------------------- Order: ' + order);
		system.debug('---------------------------- Query Order: ' + [select 
         																BillingAddress,
         																ShippingAddress,

         																BillingCity,
         																ShippingCity,

         																AccountId,
         																Status,
         																EffectiveDate,
         																EndDate
     																FROM Order
     																WHERE Id =: order.Id]);

if you execute this code, you'll see that the first system.debug invokation will show the Order object as it is in memory, while the second system.debug line, will show the Order with all fields set but those related to Billing and Shipping Addresses (BillingCity, ShippingStreet, etc), also fields BillingAddress and ShippingAddress are null.
How is that possible? Is there any workaround for this situation?
My main goal is been able to assert that Order.BillingCity == CustomObject.BillingCity__c.

Thank you so much for your time.
Hey!
I'm repeatedly getting following known exception:
Too many query rows: 50001 
An unexpected error has occurred. Your development organization has been notified.
The thing here is that my query is retrieving only 18 rows, so my jaw fall to the floor instantly.

This is my query:
SELECT Date__c, Country__c FROM Insight2__c GROUP BY Date__c, Country__c ORDER BY Date__c ASC

This is the log main lines, check the 2nd line to verify there is only 18 rows retrieved:
16:24:46.0 (110288675)|SOQL_EXECUTE_BEGIN|[6]|Aggregations:0|SELECT Date__c, Country__c FROM Insight2__c GROUP BY Date__c, Country__c ORDER BY Date__c ASC NULLS FIRST
16:24:46.0 (380090845)|SOQL_EXECUTE_END|[6]|Rows:18
16:24:46.0 (380142615)|EXCEPTION_THROWN|[6]|System.LimitException: Too many query rows: 50001
16:24:46.0 (380413663)|HEAP_ALLOCATE|[6]|Bytes:30
This is the screenshot of the developer console query editor with the exact same query and the above mentioned 18 rows:
User-added image

Thanks guys!

 
Hi everybody,
I'm having an issue when testing a simple class that is intended to copy the Billing and Shipping Addresses from an Order object to a custom object. The thing is, I set address fields on the Order, insert the Order and everything is fine. But later, when I perform a Select query on the same Order, Address fields are not returned on the result object.

Here is my code
 
Order order = new Order();

		order.BillingCity 		= 'bcity';
		order.BillingCountry 	= 'bcountry';
		order.BillingPostalCode = 'bpostalcode';
		order.BillingState 		= 'bstate';
		order.BillingStreet 	= 'bstreet';
		
		order.ShippingCity 		= 'scity';
		order.ShippingCountry 	= 'scountry';
		order.ShippingPostalCode= 'spostalcode';
		order.ShippingState 	= 'sstate';
		order.ShippingStreet 	= 'sstreet';

		order.AccountId 		= account.Id;
		order.OpportunityId	= opp.Id;
		order.Status 			= status;

		order.EffectiveDate 	= Date.today();
		order.EndDate 		= Date.today().addDays(365);

		insert order;

		system.debug('---------------------------- Order: ' + order);
		system.debug('---------------------------- Query Order: ' + [select 
         																BillingAddress,
         																ShippingAddress,

         																BillingCity,
         																ShippingCity,

         																AccountId,
         																Status,
         																EffectiveDate,
         																EndDate
     																FROM Order
     																WHERE Id =: order.Id]);

if you execute this code, you'll see that the first system.debug invokation will show the Order object as it is in memory, while the second system.debug line, will show the Order with all fields set but those related to Billing and Shipping Addresses (BillingCity, ShippingStreet, etc), also fields BillingAddress and ShippingAddress are null.
How is that possible? Is there any workaround for this situation?
My main goal is been able to assert that Order.BillingCity == CustomObject.BillingCity__c.

Thank you so much for your time.
Hey!
I'm repeatedly getting following known exception:
Too many query rows: 50001 
An unexpected error has occurred. Your development organization has been notified.
The thing here is that my query is retrieving only 18 rows, so my jaw fall to the floor instantly.

This is my query:
SELECT Date__c, Country__c FROM Insight2__c GROUP BY Date__c, Country__c ORDER BY Date__c ASC

This is the log main lines, check the 2nd line to verify there is only 18 rows retrieved:
16:24:46.0 (110288675)|SOQL_EXECUTE_BEGIN|[6]|Aggregations:0|SELECT Date__c, Country__c FROM Insight2__c GROUP BY Date__c, Country__c ORDER BY Date__c ASC NULLS FIRST
16:24:46.0 (380090845)|SOQL_EXECUTE_END|[6]|Rows:18
16:24:46.0 (380142615)|EXCEPTION_THROWN|[6]|System.LimitException: Too many query rows: 50001
16:24:46.0 (380413663)|HEAP_ALLOCATE|[6]|Bytes:30
This is the screenshot of the developer console query editor with the exact same query and the above mentioned 18 rows:
User-added image

Thanks guys!

 
Hi,
I got this error message for the Routing Records with Approvals challenge, hopnig someone can help, thanks!

Challenge not yet complete... here's what's wrong: 
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Process failed. First exception on row 0; first error: NO_APPLICABLE_PROCESS, No applicable approval process was found.: []