Skip to main content


Showing posts from December, 2018

Test.loadData on Pricebook, Product, PriceBookEntry and RecordType

I remember when I was writing test class; Pricebook and the gang (Pricebookentry, Product) always giving me headache before I able to grab the concept. I also try to experiment on how to populate test data using Test.loadData on those object and quickly gave up as I was chasing for the dateline. When I have a dateline, I always finding myself to choose familiar road although it can be slow because I know I   can choose either to walk or run instead trying other new road which I unsure whether I able to walk or run or maybe eaten by monster. *who knows*   I was once asked question here  , the answer give me a hope that Test.loadData seem possible to be try on those object. After doing some experiments, here my conclusion : 1. Define relationship with Id and the Id is not necessary all integer.  If you notice in my previous post , you will notice that I use all number to represent Id BUT it does not mean that we need to use all number. For Id, we can use alphanumeric so