Devil Fruits are certainly one of the greatest mysteries in the series, and as much as this video is going to attempt to, there are some things in this world that simply are not possible to explain. Much like that force, it is just now suddenly compelling you to subscribe to the Grand Line Review with that promise of sweet, sweet, one-piece content, to live it straight into your YouTube feed. No one knows how it's there or why it exists, all you can do is let go of your free will, push that button, and enjoy. Hello and welcome to the Grand Line Review, your source for everything one-piece, and today it's time to talk about fruit. What is it, and where does it come from? Well, according to Wikipedia in Botany, fruit is a seed-bearing structure in flowering plants, which doesn't actually correspond to the common term fruit, but to make things even more complicated, I want to discuss what happens when fruit becomes, quite possibly, literally cursed, providing its consumers with great power at a tasty price. Devil Fruits, I suppose, will call them, which form a core aspect of appeal in regards to one-piece, a series that you may have heard of. And one of the more enduring mysteries of said series is that as much as we continue to learn about how Devil Fruits function and their various classifications, there is still one incredibly huge question hanging in the air, which is, where did Devil Fruits come from? Now, it's easy to forget in this day and age, because Devil Fruit powers have become fairly commonplace in one-piece, which does make sense because we keep delving into more and more powerful areas of the world. But I want to start by mentioning that at the dawn of one-piece, these items were almost legendary in nature, so much so that a very early trend of the series was the base civilians were seeing Luffy's rubber abilities and becoming simply aghast at the very idea that Devil Fruit powers did indeed exist. It was like seeing a leprechaun or a Loch Ness monster, or even me stepping foot outside of my house. No one knew it was possible, but here it is. And maybe that's just an East Blue thing, but it's kind of weird in retrospect because these fruit powers are not exactly a secret, given that they are commonplace amongst the marines and the abilities of top-tier pirates tend to be quite well known.  With that said, an early explanation of Devil Fruits was delivered to us in Chapter 19 through the vehicle of flashback shanks, who said they say that Devil Fruit was enhanced by sea devils. Whoever eats it gets amazing powers, but the sea turns against them, which very specifically was in reference to the Barbaranomy, which Buggy would then go on to eat. Accidentally and hilariously, I might add. But this explanation presents the prevailing thought for those individuals who are not keen explorers of the One Piece world. It's the simple human thing of, well, I'm not personally capable of logically explaining this, so it must be sorcery mindset. However, I can't exactly blame them for this because even after having experienced, well, over a hundred of these fruit thingos, I can't logically explain why they exist. I mean, we know how they function via the lineage factor insight, but how Devil Fruits came to be in the first place? Well, I guess we essentially have three options in this regard. Firstly, Devil Fruits are a naturally occurring item which spawned from the majesty of nature and evolution. Secondly, Devil Fruits were specifically engineered by intelligent life forms on this planet, and I really don't want to use the word human because it could have been a whole number of different species in this series.  And there's pretty strong evidence to support at least two of those three ideas, although certainly not enough to give us a concrete path to go down. But Devil Fruits do exist and they had to come into being somehow. So let's go down this rabbit hole. And the first of these ideas is probably admittedly the least exciting one, which is that Devil Fruits are a 100% natural result of a developing world, with the idea being that I suppose there is some kind of rare tree thing out there, likely within the ground line, where this incredible creation organically grew. And we do know of some fairly legendary trees in one piece such as the treasure tree Adam or sunlight tree Eve. But since Adam Wood is a sold commodity and the location of Eve is fairly obvious, given that we've seen its roots providing light to Fishman Island, it's probably unlikely to be either of those, but we will touch again on these trees later. And I suppose you also maybe have a piece of supporting evidence of organic growth, given that smile fruits need to be produced by cultivating them on various bushes and things. But other than the fact that Devil Fruits resemble organic matter, I actually don't think there's a great argument to be made that they were just naturally spawned via the marvel of nature. I mean, the one piece world is full of some pretty fantastic natural phenomena, which is consistently on display within the ground line in terms of weather and stuff, but also the incredible wide array of life forms that one can discover in this world. With that said, Devil Fruits seem to exist on an entirely different plane and certainly veer into the idea of intervention, whether that be man-made or supernatural. And we'll go into the former first because yeah, a lot of Devil Fruits do make sense with the whole nature argument like logia type specifically, which quite literally embody a facet of the natural world. However, there are a whole host of Devil Fruits with curiously specialized powers like say Baby Five's Bukibukinomi, which allows her to transform into seemingly any weapon she so chooses, which can range from a simple sword to complex machinery like a gatling gun or even a functioning missile. And another similar illustration would be Scratchman and Pooh's Devil Fruit, which basically allows him to do the same thing as Baby Five just with musical instruments instead. These are abilities granted by a Devil Fruit that selectively focus on the developments and progress of intelligent life and lends a whole ton of credence to the claim that however they came about, these fruits were indeed man-made. Although to be fair, the true extent of these peculiar abilities is unknown, and I have made the argument before that it could be based entirely on the knowledge and psychology of the fruit wielders. For example, if you gave the Bukibukinomi to a member of a fairly undeveloped part of the world, would they instantly have access to things like missiles and gatling guns or would they only be able to turn into weapons that they are aware of like clubs and spears and maybe big, heavy rocks? Although if that is indeed the case and it complicates matters yet again by asking the question of how one embodies the general concept of weaponry into a fruit rather than pre-programming select options. Although that secondary factor is also bizarre to linger on. So we won't, but really the greatest piece of evidence for man-made fruits is that we have actual examples of them existing in this world because both the smile fruits as well as Dr. Vacapunk's artificial fruit are indeed a thing, although neither of those brands were considered a success, really. The smile fruits for obvious reasons given the abomination that they are and the abysmal success rate upon consumption. And Vacapunk allegedly believes that his fruit was a failure, although at the moment we're not quite sure exactly why that is. But it does go on to show that creating devil fruits is not a complete impossibility. Although it does raise a bit of a red flag when someone like Dr. Vacapunk who is said to be roughly 500 years into the future in terms of his knowledge and advancements cannot successfully reproduce them. That's quite problematic because for the man-made theory to work, it would mean that someone would have had to exist in the past with a mind and resources that could surpass that of even Vacapunk. Which seems like a bit of a tall order especially given that such a character would have had to exist hundreds of years ago maybe even thousands. Like say void century days or even before then. We really could be looking at thousands of years ago with something deeply rooted in perhaps say, I don't know, an ancient kingdom. And it's very hard to pinpoint anything along those lines at this stage. However, due to one key character introduced in Mono, we do know for a fact that devil fruits existed during the void century because Lady Toki had eaten the Toki Toki no Mi. So we do know that they must have been in this world for at least 800 years or so although I suppose that doesn't necessarily mean every individual devil fruit is that old. It could be a situation where new devil fruits were gradually developed over the course of various centuries especially if a civilization made the same breakthrough the Vacapunk and Judge did by discovering that all important lineage factor in living beings. The knowledge of which could simply have been lost during the black hole that is the void century. But even the concept of devil fruits being completely man made does run into a lot of fascinating issues. I mean firstly, if they were all artificial then why does only one of each power exist? Like why weren't super powerful fruits like the Marga Marga No Mi just mass produced or even more handy utility based things like the Hana Hana? I mean an entire civilization of beings who could just sprout extra hands at will could do wonders. But this is really where we dive into the realm of supernatural creation because there is quite a lot that doesn't add up such as the whole idea that devil fruits curse their user because it's not just a simple endeavor to manipulate the DNA of a being it also comes at a cost which is losing the ability to swim in all types of water not just sea water. And maybe that could be quote unquote scientifically covered by stating something along the lines of well the only part of the lineage factor that is susceptible to manipulation just so happens to coincide with the part that handles the bodily reaction to mass amounts of water for reasons which actually you know sure why not I'd be willing to accept that because smile fruits do come with this detriment as well so we actually do have a man made example of this curse in action I suppose. What I find much harder to explain though is the concept of devil fruit reincarnation the idea that after a fruit user passes away that ability then quite seemingly super naturally goes on to house itself in the nearest appropriate fruit in order to respawn into this world that is something that currently has nothing even approaching a sound explanation for especially since we haven't seen it exhibited in the artificial fruits as of yet and also I said that we would go back to the Adam and Eve trees again which I can't ignore because the story of Adam and Eve is pretty well focused on fruit forbidden fruit that is which granted great knowledge at a great cost very similar to the general concept of devil fruits and that forbidden fruit just so happened to be created by a God like being so as much as this may not really seem like it fits one piece there is something to be said for a deity like individual to have conjured devil fruits into existence because it's easy to forget but the supernatural aspect of one piece is actually pretty strong as well I mean yes it's mostly a world based in fictional science but at the same time we do have confirmation of the existence of a soul thanks to Brooke and Big Mom so there is certainly some form of afterlife and thus existence that does span beyond our basic comprehension plus here's a really fun thing in the prototypes of one piece between Romance Dawn versions 1 and 2 there is a distinct magical presence specifically in the second that even features a literal sorcerer and in both of these incarnations Luffy's devil fruit is said to be the product of a mystical or devilish tree indicating that there is a fairly powerful sense of the supernatural at play in this world although that could very much be akin to how we were introduced to devil fruits in one piece with most characters we encounter believing that they are supernatural powers granted by the sea devil it's pretty hard to say although once again having at least one character in these prototypes who was a sorcerer does reinforce that idea pretty heavily so much so that I have very little doubt in my mind that in these early super prototypy days Oda more than likely did plan devil fruits to be explained by either magic or some other supernatural aspect the question then becomes how much of this actually carried over into one piece because Oda then made a decision to eliminate raw magic from the series as well as make the intriguing choice to omit any discussion regarding a tree that devil fruit spawned from so that may very well show the intent to move into the man-made realm and to get rid of that mystic quality as an explanation but still keep it as a question and point of interest in one piece in the end I guess we just don't have anywhere near enough information the only thing I feel slightly confident about saying is that devil fruits are almost certainly not a natural occurrence there are far too many bizarre qualities and inconsistencies about them to have just evolved in this world however even then we can never be 100% sure but that does leave us with two stronger ideas either they were engineered by an incredibly advanced society or individual that history has forgotten or that there is an even more expansive and supernatural layer to one piece that we have yet to properly explore and as for my personal opinion I honestly think it would be hard to be satisfied by either of those explanations because that's kind of just the conundrum of creating a great mystery the only time a mystery is captivating is when we don't have the answer to it as soon as it's solved it all of a sudden feels like something of an underwhelming issue unless of course it comes with a new accompanying question which to be fair Oda tends to be very very good at so look I do eagerly await the day where we do discover the conclusive origin of devil fruits but in the end I almost hope that we never quite fully answer this question but what do you guys think please do leave your thoughts in the comments below or even join my discord server and if you'd like to see more videos like this then please do go and check out some of my other content or even subscribe to the channel for more glorious one piece business uploaded straight into your YouTube feeds but for now this has been the ground line review and I'll see you next time


The Feywild, a plane of unrestrained and awe-inspiring natural beauty. Bathed in light and filled with mythical creatures, one would be forgiven in believing the Feywild to be a safe travel. While fantastical in appearance, danger certainly lurks around every corner. Dungeons and Dragons, the Wild Beyond the Witchlight, is an adventure that sends you to travel into the Feywild. Starting with the Witchlight Carnival, a festive spectacle that travels through many different worlds, is set forth into a splinter domain of the Feywild known as Prismir. The journey is filled with many encounters that seem to be pulled straight from fairy tales. Being such, this adventure is interesting in the fact that it can be solved without fighting a single battle. You can certainly hack and slash your way through most things, but for those who wish to seek a more peaceful option, there's plenty of alternative course of actions for you to take. The Wild Beyond the Witchlight is a great adventure for first-time players, along with Dungeon Masters if they don't mind the theme. For players, it allows those who excel at things other than combat to shine bright, while bringing hilariously strange encounters for you to punch through if you so wish. For Dungeon Masters, the adventure is set up in such a way that it doesn't demand a ton of reading on their part. The sections flow smoothly between one another, and each chapter in the book does a fantastic job in giving you a strong overview of what is to come. I strongly recommend that you read the adventure as it is incredibly creative. Having said that, I will outline the main story of the adventure, along with some small details that may be of interest just to highlight the creativity of the writers. Follow me as we explore the story that unfolds in Dungeons and Dragons, The Wild Beyond the Witchlight. You have been summoned to the abode of a human warlock named Magic Rosloff.  His adventuring days are behind him, and he looks quite old and frail. Nevertheless, he is delighted to make your acquaintance. I have acquired many treasures and made important contacts during my lengthy adventuring career, says Magic. I would like to pass the treasures I possess in the Favours I am owed to you. In exchange, I ask that you travel to Prismere, a domain in the Feywild, and find out what fate has befallen the Archfey that rules it. This Archfey, Zybilna, is my patron and inspiration, the source of my power. I have been unable to contact Zybilna for the better part of a year, and I fear something terrible has happened. My adventuring days are over, but Zybilna has been good to me, and I would like to know she is well before I take my leave. Every 80 years, our world is visited by a traveling extravaganza called the Witchlight Carnival. It recently returned and is camped three days travel from here. I am asking you now because this carnival might pack up and leave in a week or two, and it contains your only route to Prismere, a Feycrossing if you will. Seek out Zybilna of Prismere, help her if you can, and return with proof that she is alive and well. Upon your return, all the hard-won earnings of my adventuring career shall be yours. Magic tells you that Zybilna is a fairy godmother to mortals. She created the carnival as a means by which mortals could enter her realm and beseech her aid. When magic last visited the carnival, it was run by a pair of Shatterkai, elves native to the Shadowfell named Mr. Witch and Mr. Light. He assumes they are still in charge. Magic dimly recalls that Witch and Light acquired the carnival more than a hundred years ago from an Eladrin, an elf native to the Feywild. With his old age comes old description that may not be as reliable due to the nature of his first day and knowledge. He recounts that Prismere is a domain of delight ruled by Zybilna, who dwells in the palace of heart's desire, a magnificent structure in the heart of the domain. Zybilna can assume many forms and is brilliant, secretive, and wise. When she presents herself to mortals, Zybilna usually assumes the form of a statue-esque woman with long white hair and a small tattoo shaped like a chicken's foot below one eye. Upon hearing the description of Zybilna's appearance, it unlocks a long forgotten childhood memory of yours. When you were a child, you had met Zybilna. The memory ranges from her reuniting you with the lost pet or fishing you out when you fell into an icy cold pond. While the memories were hazy, they were definitely there. You turn to magic and inform the old adventure that you will accept his request and embark towards the carnival, which happens to be not too far from a nearby settlement. Number 1 Witchlight Carnival Arriving to the carnival, you are greeted with the sight of a spectacle. The Witchlight Carnival is a fairground of kaleidoscopic tents and wagons, crewed by wondrous beings including many denizens of the Feywild. This is no ordinary carnival, it uses magic to travel from world to world across the material plane, visiting each world once every 8 years and setting up business on the outskirts of populated areas. The carnival spends a few days at each location, then packs up and moves to another location on the same world until the decision is made to leave that world and visit the next. The carnival includes a fey crossing, allowing travel to and from the Feywild domain of Prismir.  The carnival games range from exciting snail races and relaxing swan gondola rides to amusing circus performances and roaming treants. Everything that seems to be ordinary to a carnival comes with a little twist that gives it a joyous flair of the Feywild. For example, the gondola ride is a boat being pooled with the swan that seems to love to converse about metaethical topics. There is a teapot in the middle that, when entered, expels you out of the spout in case in a bubble before popping high in the sky and gently lowers you to the ground with magic. The Ferris wheel is one decorated with unicorns that have secret names to them and will telepathically speak to you if you decipher their names. These are just a few examples of the oddities you will find at the witch-like carnival. Through your time at the carnival, you learn a few things that are certainly troubling. Regarding Zybilna, you learn from Matriah that Zybilna of Prismir is frozen in time. Three hags have seized control of Zybilna's domain and split it among them. Together, these hags form the hourglass coven. The hags' names are Bavlorna, Blightstraw, Skabatha, Nightshade, and Endolin, Moongrave. And their splinter realms are called Hither, Tither, and Yon. Each realm is split by a dense fog, and travel between the realms would be near impossible without the help of a guide. The coven is so riddled with distrust that each hag is convinced her sisters are plotting against her. Something is afoot, and it's best that you confront these hags and, if needed, vanquish them. You learn from the employees of the carnival that the path to Prismir is hidden behind that of a house containing mirrors called the Hall of Illusions. Currently, the carnival is being run by that of two strange individuals named Mr. Witch and Mr. Light, and only they know the method to use the mirror house to travel to Prismir. They run the carnival with a magical object called the Witchlight Watch that, if stolen, may be used as leverage to travel to the Feywild. You eventually steal the Witchlight Watch, sending Mr. Witch and Mr. Light into a frantic search, sensing their desperation for its return. You offer to return the Watch to the two of them if they take you to Prismir. They agree and lead you to the Hall of Illusions where, keeping good on their word, begin the process of taking you to the Feywild. As Witch and Light move through the Hall of Illusions, their reflections in the mirror show them as gloomy Shatterchai children with their own youthful reflections following behind. Soon they call you to a halt. The mirrors now reflect everyone's true age. Mr. Witch addresses you in a hushed tone. Everything you seek and more lies beyond this mirror. If you mean to step through, then stand in front of the glass and repeat this rhyme. Hither, thither, here and there, wander, yonder, show me where. Uttering the phrase, Ms. Whirls in one of the mirrors, blotting out your reflection. This is the portal to the Feywild. As you prepare to step through the portal, Mr. Witch and Light send you off with the following advice. Mind the rule of three, future, present and past. And find the Alicorn and free the Dormant Queen at last. Cryptic as it is, you take the following bit of information with you as you step into the mirror and into the realm of Prismir. Chapter 2, Hither. After stepping through the mirror in the Witchlight Carnival, you travel to the portion of Prismir known as Hither. It is an enormous swamp containing mysterious sites half sunk in the muck. In the distant sky, you spot a great balloon made of patchwork material. It spins out of control as though punctured, causing the wicker basket that hangs from it to swing wildly. The balloon plunges out of sight, disappearing into the fog approximately a mile away. Figuring that to be the place to start your investigation, you travel down the bridge and into the swamps immediately below. As you descend, you are immediately mugged by some harragon brigands. They reveal that they work for an individual named Agdon Longscarf and seem to be collecting memories for Agdon. You may relinquish some of your memories or protest. Either way, they leave and retreat into the swamps and you proceed onwards.  Hanging from the crenellations on the lower side of the tower's peak is a large woven basket at the end of a tangle of ropes and tattered fabric. In the basket, you find a fairy dragon knight by the name of Ser Talavar. He introduces himself as such, proclaiming he is one of the loyal servants to an archfey known as the Summer Queen. Stuck in a cage that resides in the basket, he pleads with you to free him, unless the basket falls from its hanging state and into the jaws of some snakes right below. Ser Talavar explains that he must be free so that he can return to his queen and report the news that Zybilna has been overthrown by three hags known as the Hourglass Coven. He informs you that the key to the cage is found a little way further from here in a location known as Tellamy Hill and is in the possession of a goblin named Jinglejangle. You agree to the fairy dragon's request and travel to Tellamy Hill. Tellamy Hill is a sentient hill that is friendly, lest you choose to provoke it. It speaks through the surrounding shrubbery and trees covering the hill. You tell Tellamy Hill that you are only here to find a goblin and retrieve a key in its possession to free a nearby creature. Sensing you to be of no harm, it guides you to the top where you find Jinglejangle. Jinglejangle is an odd goblin covered in keys. You ask Jinglejangle for the key to Ser Talavar's cage and she happily hands it over informing you that she just really likes to collect keys. Jinglejangle also informs you that a group of brigands has stolen some truffles from her. Annoyed at the thievery, she points the way to the brigands tollway, the headquarters of Agdon Longscarf and his gang of brigands. You reassure Jinglejangle that you'll take care of the matter and the goblin dances enjoy as you leave the hill. As you leave, it seems as Tellamy Hill is delighted with Jinglejangle's high spirits. Before heading to the brigands tollway, you travel back to the tower and free Ser Talavar from his cage. Polite and courteous, Ser Talavar thanks you for your aid and bids you a fond farewell, adding your valor will not be forgotten. He flies off in a hurry as you leave for the brigands tollway. Arriving at the tollway, you encounter the harragon brigands along with one that wears a long bright blue scarf. This is Agdon Longscarf. He darts around you quickly, stealing things from your body all while taunting you. You eventually get ahold of his long scarf and capture him. With his defeat, his former followers shun him and regard you as formidable. You inquire about the hag, Bavlorna, and they reveal that she resides in a location called Downfall and offer to take there. Accepting the request, you travel to Downfall and make your way to the hag. Along the way, you find a scarecrow named Clapperclaw who seems to have misplaced a Ted. It offers to be your guide if you wish to travel to the realm of tether but would really appreciate a Ted being returned to him. Hidden in a vault in Bavlorna's house is the head of Clapperclaw in which you may return to the scarecrow. Regardless if you return a Ted, Clapperclaw acknowledges your request to save Prismir and offers to be your guide if you ever need it. Finally meeting the hag, she requests that you help her with some chores before properly hearing you out. You help her with tasks such as finding her missing book or picking up a crate of small animal carcasses. After doing so, you meet with Bavlorna once again and she informs you of a few things. The hag tells you that Scabatha resides in a hollowed out tree in tether named Lumarch. Within the heart of the tree will be the portraits of Bavlorna and three others Endelin, Scabatha and Tasha. She wishes to obtain Scabatha's portrait and is willing to strike a bargain with you for it. When questioned about Tasha, a new name you have yet to hear of, the witch goes silent and says nothing more. Whether you accept her bargain or not, you exit Bavlorna's house and take a balloon stationed outside along with Clapperclaw as a guide into tether. With that, you travel off into the sky and across the fog that separates hither and tether. Chapter 3. Thither The missed parts to reveal a primeval forest. A fragrant breeze wafts between the enormous trees sending moats of pollen dancing into the air.  You've entered thither, the realm of prismia ruled by Scabatha. After entering, you exit the balloon and travel to a nearby cave. Within the cave, you find an old man named Nib who is cursed to spend his vast wealth to craft items for those who ask. You ask the unfortunate soul for information regarding Scabatha and he tells you that she also goes by the name of Granny Nightshade. Granny Nightshade runs a workshop in Loom Lurch using children as workers to craft the creepiest toys. She is obsessed with capturing Will of the Feywild, a boy who runs a crew known as the Getaway Gang that helps children skate per workshop. Nib points you in the direction of Little Oak, a tree ant that protects the Getaway Gang. Thanking him for his time, you leave and proceed onwards to Little Oak. When you arrive at Little Oak, you find children scampering up the tree ant and hiding within a tree house. You assure them that you have not come to harm them and they reluctantly invite you in. Will, the leader of the gang, tells you of their plan to infiltrate Loom Lurch once more and rescue the remaining children.  Will hands you a unicorn costume that allows you passage towards the wayward pool and instructs you to light a fire in a bowl that resides in the middle of the pool. Along with the costume, he introduces you to an oil can named Squirt that may be of aid in navigating the land of yawn. With that, you don the unicorn costume and travel towards the wayward pool. Once in the middle of the pool, you light the bowl found here as instructed. Suddenly, a unicorn by the name of Lamorna appears. She asks why you've come to Thither and you explain to her your goal to find Zabilna and rid Prismir of the hourglass coven. She sympathizes with her cause and reveals to you that Zabilna was the archfey of Prismir but was usurped by her cruel hagg step-sisters. The step-sisters captured Lamorna's mate, Eladon, stole his horn and used this magic to imprison Zabilna in a stronghold known as the Palace of Hearts Desire. Lamorna informs you that Eladon is currently a prisoner of the hags and his horn is the key to free Zabilna. Additionally, she recommends finding Amador the dandelion, one of yawn's denizens, to safely lead you to the Palace of Hearts Desire. Thinking the unicorn for aid, you press on heading towards Moon Lurch. Once arriving at Moon Lurch, you find it to be a large hollow tree that houses the hag of this realm. You meet with the hag, Skabatha, also known as Granny Nightshade, roaming around in her abode. She informs you that she wishes to spoil a play that is occurring in her step-sisters castle in Yawn, Motherhorn. Skabatha offers you a reward of your choice if you wish to aid her. Regardless if you accept a deal or not, you aid Will in his game with freeing the children and discover Eladon's horn in one of the cupboards. You scour the building, searching for the unicorn, until you find a flying rocking horse that has been in debt, where a horn once stood. Noting that this must be Eladon, you commit to return once it news the horn to free Zabilna from her frozen prison. You rush back to Little Oak to drop off the children before venturing into the mist towards Yawn, with Squirt as your guide. Chapter 4 Yawn Parting through the mist, you stand on a path that wends between rocky crags on a mountainside. The sky is dark and full of thunder clouds. For a second, lightning splits the sky, striking nearby mountaintops and illuminating a distant pinnacle of rock that has a foreboding castle carved out of it. Deciding to head towards the sinister castle in the distance, you don't head far until you encounter a slender elf wearing a crescent moon mask and a dandelion adorning a small rapier. The dandelion goes by the name of Amador and is accompanied by her companion, Paulinella, the honeybee. The elf present is Gleam and she is a twin that once resided in the Witchlight Carnival. Having been cursed by Endelin, the hag of Yawn, Gleam wishes to find her twin sister, Galister, and recruits the dandelion and you for aid. She informs you that not too far from here is the Lockbury Henge, where you may find a clan of Chorids and strike up an alliance with them. Additionally, an elf named Allagarthus at the Fey Beacons may need your help.  Atop a boulder strewn plateau, you find a circle of eight megaliths containing the Chorids. They live in fear of Endelin, but refuse to act against her in the case that the Brighanox may attack them at their weakest. The Chorids believe that the Brighanox are in league with Endelin and would be more than willing to aid you if the Brighanox were taken care of. They point you in the direction of the Brighanox mines which lie beneath the mountains and you promptly leave heading to deal with them. On the way there, you find the Fey Beacons where you can see a lake along with eight beacons. An elf on the lake is desperately trying to light the beacons but the peritons in the sky constantly douse the flames. The elf is named Allagarthus and is trying to return home via lighting the beacons. When the Fey Beacons are lit, it allows the one who lights the beacons to return home wherever that may be. You aid the elf by putting on an extravagant performance for the peritons which impresses them and you are able to persuade them to stop their nuisance. With that, the elf lights the beacon and leaves into the lake returning home. You continue your journey to the bottom of the mountains where you find the Brighanox mine. Within these mines, you meet with the Brighanox to find that they too despise Endelin and wish to see her downfall. You inform them of the cords in the mountain above that wish for the same outcome and formulate a truce between the two clans. They take you to a secret tunnel that leads into the stage workshop of Endelin's home, Motherhorn. At Motherhorn, you are directed to a stage where you put on a performance to gain an audience with the hag. Impressed with your skills, she invites you to her room in which she offers you a bargain in exchange for any request you may have. Whether you accept or refuse her deals, you leave her presence and explore more of Motherhorn. From here, you infiltrate the large amphitheater and find Gleam's sister Glister locked in a cage. You devise a plan to disguise Glister in a convincing costume and escape Motherhorn. The two sisters reunite, and the only task left is to take them home. Guiding them to the Fae Beacons, they light each one before plunging into the lake and back to their home. Amador is satisfied with the outcome of Gleam and Glister and offers to guide you to the Palace of Hearts' Desire. Accepting her aid, you walk off into the mist following the dandelion's path. Chapter 5 Palace of Hearts' Desire Guided by Amador, you part through the fog and find a twilight palace that emerges dreamlike from the clouds. A great marble tower, ringed by delicate spires, cast a shadow over the rooftops below. Another tower teeters nearby, torn from its foundation and held aloft by a coiled beanstalk. Monstrous vines cling to the palace walls and took the promontory of rock on which it perches. Hundreds of birds burst from the canopy of the ancient forest below you and scatter in all directions. Moments later, a much more fearsome creature erupts from the woods, a sinewy pale green dragon that takes to the sky and flies towards the palace. Its mighty wings carry it to great heights. Once above the palace, it drops like a stone and vanishes from sight behind the palace's high wall. The creature that you've just witnessed is the Jabberwock and had just arrived home from its long hunt. You step forth into the courtyard of the palace and into its large garden. Solving a riddle in a location known as the Maiden's Pawn, you retrieve a crown that you magically imbue at the tower of two entities, Envy and Wrath. Envy is a magical statue that resembles a lion and Wrath is one that resembles a stag. Each one magically comes to life when adorned with the imbued version of the crown that corresponds to it, Gold for Envy and Silver for Wrath. The two were created to protect the garden when Zybelna was absent from the palace and their presence indicates that Zybelna is currently missing. They aid you in unlocking the various doors that are within the castle, thus revealing the mysterious secrets of the frozen palace. You enter the palace doors and begin to explore it, stumbling upon a particularly wary butler named Thinnings. Earning his trust, he reveals to you some information. After using Zybelna's cauldron to neutralize the archfey and most of her court, the hags of the hourglass coven left an organization called the League of Malevolence in the palace to guard the cauldron. Only three members of the league, Kellic, Warduke, and Zargosh, are in the palace presently. The League of Malevolence is searching Prismir for a unicorn horn so that Kellic can free Ringelrond, his arch enemy, from temporal stasis and steal his staff of power. To free a creature frozen in time, one must touch it with a unicorn horn while speaking the creature's true name. In regards to the archfey, Zybelna is only an alias and will not work as a name to free her. Additionally, years ago, Zybelna befriended a Jabberwock and trained it to drink from her cauldron. It still frequents the palace and loiterers around the cauldron, making it impossible for Kellic and the others to guard the cauldron effectively. The only creature in the palace that stands a fighting chance against the Jabberwock is Zybelna's great owl, Bloodybeak. You thank thenings for the handy information and scour the palace of heart's desire for Zybelna's true name. Dodging through rooms of magic and encountering foes such as the League of Malevolence, you gather as many clues as you can find of Zybelna's true name. Many clues seem to indicate that her true name is Iguil, the Witch Queen, but some of her childhood items seem to indicate an alternative name, Natasha. Now knowing a few names to try, you make your way to the ballroom where you find the Jabberwock along with the frozen Zybelna. You lure the Jabberwock with the sound of music towards the aviary where Bloodybeak, the owl, attacks the Jabberwock on sight.  After a few attempts, the name Natasha seems to do the trick. Her eyes spring to life as the rest of the body relaxes and animates. Once more able to move, Zybelna lurches forward a step, then quickly regains her balance. Damn, too late, she says with a snarl. Her eyes dart around in search of her enemies before fixing on you. Have we met? She asks. Ending of Wild Beyond the Witchlight. You stand before Zybelna, the Archfey of Prismir. Zybelna requests that you update her on what has happened and you tell her as much as you know of the situation. It dawns on Zybelna that she has met you before when you were young and gives you a knowing look. Zybelna is troubled to learn of what has happened to Prismir and vows to undo the damage the hourglass coven has wrought, a task that will take considerable time and effort. The surviving hags can sense when Zybelna is released from temporal stasis or, rather, they can sense when their hold of Prismir is lost. The instant Zybelna regains control of her domain, the hags news their plane shift spells to flee to Gehenna where they maintain a cramped tower guarded by Eucloth mercenaries. They don't think that Zybelna is aware of the tower but her spies learned about it some time ago. Zybelna takes no immediate action against the surviving hags, preferring to let them stew in exile. The coven stays together even though its members constantly blame one another for their failures. The hags are united by the fear of Zybelna's wrath and they live in torment, dreading the day when Zybelna seeks them out and inflicts punishment on them for their wickedness. As beings of unfettered emotion and potential, children are of great importance to Zybelna. The arch-face sees to it that any children held captive by the hourglass coven are liberated, rid of unhappy memories and escorted back to their home by pixie courtiers. Lastly, remembering your task from magic, you request that Zybelna conveys a message to the old man for he was the one who sent you to confirm her safety. She does so and sends you back to the house of the old man, barely clinging to life with a wide grin on his face. Hello, everybody. I hope you enjoyed the story overview of Wild Beyond the Witchlight. As far as D&D adventures go, it's really weird. This is one of those adventures I recommend you give a read just because it's so creative. It's like reading a fairy tale unfolded in an adventure. If you have an adventure that you'd like me to cover, do let me know. I recently picked up Journey to the Radiant Citadel and hope to cover that soon. As of right now, the spell jammer books are coming in in about a week and I wish to pick that up to cover the adventures in it. If I recall correctly, it's a short adventure that goes on for about a few levels so it'll be something that I can cover in more detail. These videos take a lot of time for me to make so I usually have to cut off a lot of the stuff from the final product. I had a poll recently and asked if y'all wanted me to keep some of the smaller details and it voted yes so I had to tweak the script of this adventure a little bit. With the shorter adventures, I hope to keep more of the details in it so y'all can get a bit more of the fluff. If you enjoyed the video, I'd really appreciate a like and subscribe. Yeah, and thanks.


Artificial intelligence, AI, has the potential to revolutionize healthcare, but its use can also lead to serious risks to human health and well-being. Misuse of narrow AI can increase opportunities for control and manipulation of people, enhance and dehumanize legal weapon capacity, and render human labor increasingly obsolete. Self-improving artificial general intelligence, AGI, could pose an existential threat to humanity itself. To mitigate these risks, we must develop effective regulations, including the prohibition of certain types and applications of AI, and call for a moratorium on the development of self-improving AGI. The medical and public health communities should engage in evidence-based advocacy for safe AI, rooted in the precautionary principle. This article was authored by David McCoy, Frederick Fedderspiel, Ruth Mitchell, and others.


Hello, hi everyone. I am Sanjay Gupta. I welcome you on Sanjay Gupta Tech School. Today we have day 54 of the Salesforce Learning Bootcamp. And you can see today we are going to discuss one more type of asynchronous Apex and the type is batch Apex, right? So I hope yesterday I explained you how we implement future Apex. So you understood that well, and you did some practice also, like how how we can implement future methods with the help of asynchronous Apex process, right? And I gave you one assignment as well. So I hope you have practiced that. So for the folks, those who are joining this session for the first time. So if you want to know, like, if you if you join this session for the first time, and you want to follow all the sessions of the bootcamp, so you can just go through with this slide, which shows like, who am I and what experience I have, and what all certifications I have done. So you can just go through with this slide so that you can have enough insight. And here we have a session tracker. This session tracker is basically containing all the live recordings for those sessions which are already delivered. And here you can see day by schedule is available. So whenever there is a session, so on that day, I just provide a link here so that you can follow. So the link of this session tracker is available in the description of this video. And there is an exercise sheet. So if you click on this link, so you will find an exercise sheet. So in this exercise sheet, on daily basis, I just provide you some questions for practice. So you can just follow this as well. And I know like many folks are already following both the documents, but the new folks who find this video randomly. So this time just explaining for them, right? So these are seven virtual learning best practices that everybody needs to follow. So you need to proper focus on live session, take proper notes, write down doubts, ask them in QA part of the session. Don't miss any session as all the topics are connected. Practice each and every session with the exercises. So I already showed you the exercise sheet. And if you miss any session, or you want to ask doubts, so we have a telegram group, you can join that as well and practice these on daily basis. So do regular practice and become a consistent learner. And if we move forward, so here you can see the telegram group link is available, or you can say QR code is available. So you can scan and become part of this telegram group. And this is the timeline. So we are in week 15. So this is the second session of this week. And soon as in Kronos apex topic will also be covered. And next week, I will be delivering you the basics of visual force, right? And after that, you will be having integration sessions, which are very much important for you. So as per your demand, I just added visual force and integration in this bootcamp. Right? So just follow this. And if you have not followed Sanjay Gupta Tech School on these platform, so do follow my platform is available on YouTube that you are already watching LinkedIn, where I just provide all timely updates. Recently, I just shared admin Udemy course, free coupon code on LinkedIn. So I just share lots of material on LinkedIn. So you can follow me there. Instagram, like you frequently use so you can follow me there. I just provide all the notifications there and telegram, like this telegram channel, if you join, so there also you will receive timely notification and important things. And session tracker and exercise sheet links are available in the description of this video. So through that you can access. Okay, so share this channel with lots of folks because there will be more and more bootcamps in regular intervals and help me to reach 100k subscribers by the end of this month. So this is humble request. So if you want to show gratitude and support, so please help me to reach 100k subscribers. Thank you. And now jumping on to the topic. So today's topic is batch apex. So we'll be discussing about that. Right. So those folks who joined late or those who are watching the recording. So once again, welcome on the channel. So I just completed the brief introduction part. Now we'll be focusing on the topic like what is batch apex. So yesterday we discussed about how to implement future method. And while explaining future method, I just told you, like we use future method if we want to run any process as synchronously, like a separate thread will be there. And that thread will be executing the process in the background whenever resources are available. So generally, if you want to do web service call out, so we prefer future methods, right? But first of all, now we need to understand the requirement of batch apex, right? So what batch apex is? So basically, batch apex runs large jobs. It can process thousands or millions of records. So basically what we need to do whenever you want to work on your existing data, whenever you want to work on your existing data that that is already available in your org. So that data you can process with the help of batch apex, right? So with the help of batch apex, you can query that existing data and you can apply a certain process and through that process, whatever modifications you want to done in each record, you can do. So basically processes records as synchronously in batches. So for example, if you have 1000 records that you want to process, so basically 1000 records won't be processed altogether, they will be divided into different, different batches. So default batch size is 200. So if you queried 1000 records, so those 1000 records will be divided into five pieces of 200 records each light. So in first go, first 200 records will be processed in second go. Next 200 records will be processed. So this way your whole data will be divided into separate batches. That's why it is known as batch apex. And generally we use batch apex for data cleansing and archiving purpose. So data cleansing means like if you have unwanted data, you have some data or you have some records, those are available under particular object, but they are of no use. So you can just clean them or delete them. Archiving means like they will be deleted. So cleansing means it can be done like you are updating some records.  So these kind of operations if you want to perform on existing data. So for that purpose, we basically use batch apex, right? So these are some introductory points related to batch apex. So how batch apex works. So this is very much important to understand. So like batch apex basically works. So here we have to implement an interface. So basically whenever you want to write any batch apex class, so you will be implementing an interface. So with the help of syntax, I will tell you what is actually the interface name. So right now you just need to understand like we have an interface that is predefined. And in that interface, we have several methods. So to implement batch apex, you need to implement that interface and whatever methods are available in that interface, you need to define them, right? So the execution logic of the batch class is called once for each batch of record that is being processed. So basically when you implement any interface in the batch apex, so there will be total three methods. One will be start one will be execute and one will be finish. So if you are processing on 1000 records, so start and finish will work once. But your execute method will be running five times if you have default batch size of 200, right? So the execution logic unit, you need to write in the execute method. Okay, so in upcoming slides, I will be discussing each method in detail as well. So we have three methods start, execute and finish. So execute method will be having all the business logic, and that execute method will be running again and again, it will be depending upon like how many batches or like how many records you have, those you will be processing. So each time when a batch class is invoked, the job is placed on the apex job queue and is executed as a discrete transaction, right? So it will be running asynchronously. So in the background, like it will be initiated and it will be running in the background. And in the foreground, you can just execute any other process also. So what are the advantages of implementing batch epics? So every transaction starts with a new set of governor limits, right? So this is simple like every transaction starts with a new set of governor limits. So like if you have different batches, so each batch will be having new set of governor limits. So there are less chances like your transaction will fail. And if one batch fails to process successfully, all other successful batch transactions aren't rolled back. So for example, if you are processing 1000 records, so if we take 200 as default batch size, so there will be total five batches, right? So those five batches from those five batches, if one batch is failing, so that one batch 200 records will be unsuccessful, remaining four batches 800 records will be successful. They won't be rolled back. So this is another benefit of using batch epics, right? So if one batch is failing, so it won't be impacting other batches, they will be executing properly if they have no errors, right? So this way, I hope you understood how batch epics actually works. Now, as I told you, we'll be implementing an interface. So interface name is database dot batchable. So this interface, we just need to implement and you will be having three methods there start, execute and finish. So in every batch epics class, you will be defining all three methods. And these three methods serves different purposes, right? So one by one, we are going to discuss about each method so that you can understand. Yeah, so Sachin is asking what's the benefit we will get if we process 10k records as synchronously. So Sachin basically, when we implement this batch epics and you want to process 10k records as synchronously. So like once you initiated your batch epics, so if you want to run it synchronously, so in that case, once that batch process is completed, then only you can initiate any other process. But here what will happen once you have initiated that batch epics? And suppose you are working on millions of records, so it will take lots of time. So what will happen? It will be running in the background and in the foreground, you can start working and initiate any other process as well. And later on what we can do this batch epics, we can schedule as well, right? So it will be running at particular time interval like weekly or daily basis at particular time. So this way you can just schedule your batch epics. So for real time example, like we have mobile data nowadays and we have daily limit for mobile data in India. And like for example, if you have purchased the plan and where you are getting one GB data on daily basis, so what happens at 12 midnight, whatever your data usage is, your limit is refreshed automatically at 12 midnight and for next day, you will be having again one GB data in your mobile phone. So that is done through scheduled batch, right? So batch is implemented. You don't need to run it manually. It will be executed automatically with the help of scheduled epics, right? So if you implement any batch epics, so that batch epics, you can just schedule as well, right? So we have three methods start, execute and finish. So we'll be understanding them. So Jenna is asking, can we increase the batch limit? So yes, we can, we can decide what, what should be the batch limit, but maximum is 2000, right? So default is 200 minimum, you can have one and maximum is 2000. So Sachin, you posted it correctly, right? Thank you for sharing your knowledge. So this is important to know. It is also an interview question like can we change the batch size? And what is the default batch limit? What is the maximum? What is the minimum? So everything you need to remember. Now if we move forward, so one by one, we'll be discussing about each method. So first method is start. So start method basically collect the record or objects to be passed to the interface method, execute for processing. So in simple terms, if I say start method basically collects the data on which we want to apply a process, right? So start method is called once at the beginning of the batch epics job. So this is important to know, like in entire batch epics, it will be called once, no matter how many records you have. It basically returns a database dot query locator object or an iterable that contains the records or objects passed to the job. So this we'll see with the help of example, when I will be showing you the code, so you will see will be generally using database dot query locator because it can give you a large number of records. So when query locator object is used, the governor limit for the total number of records retrieved by SOQL queries is bypassed and 50 million records can be queried, right? So generally, we prefer database dot query locator if you want to retrieve the data in start method. And whereas with an iterable governor limit by SOQL queries is enforced. So generally, SOQL can query 50,000 records, so that limit will be applied. But if you go with database dot query locator, so that limit will be bypassed and you can query 50 million records. So generally, start method is used to fetch the data. Then we have second method which is execute. So it perform actual processing for each batch of data passed default batch sizes to 100 records, batches of records can execute in any order. It doesn't depends on which order they are received from the start method, right? So this is also important to know if you have created a five, 10, 15, 20, no matter how many batches you have created, they can execute in any order. It take a reference to the database dot batchable context object and list of S object or a list of parameterized time. So this number four we'll be understanding with the help of syntax. And when using database dot query locator use the returned list, right? So generally, we will be using database dot query locator to fetch the data and whatever data will be fetched through database dot query locator. So that will be returned through start method and it will be available in the execute method in form of list of S object, right? And last method is finished. So it is executed post processing operation. So once all your batches are processed through execute method. So it comes in the picture and it will be executed once. So it calls once after all batches are processed, right? For example, sending an email process can be implemented in finish method. So once all your batches are processed, so if you want to send an email, so that code you can write in the finish method. Okay. So this is the syntax that you need to understand. So first line says public class, then my batch. So this is the class name, then implements is a keyword. And then we are implementing database dot batchable. So this is a syntax, you need to use it as is. Then we have first method that is start, we have second method that is execute, we have third method that is finish, right? And each method you can see we need to pass one parameter of type batchable context, database dot batchable context and BC is a name of variable. It is available in each method, whether it is finish, execute or start. And start is having written type. So we have two options. We can use database dot query locator, we can use a triple as well. So it depends like how many records you are query basis on that you can prefer. And whatever data will be returned from the start method that will be stored here under this records. So list of P. So here you just need to specify the S object. Right? So this is the general syntax that will be using to implement any process with the help of batch epics. Right? So now moving forward, if you want to execute your batch, so what you need to do whatever batch class you are implementing, you need to create its instance. And then you need to call this execute batch method. And in that method, you can pass that instance that you have created. Okay. And the batch ID will be returned. So you can just receive it. And that batch ID, you can use to know the status of the batch. And if you want to pass the batch size, so this way you can change. So in above statement, default batch size will be 200. In below statement, default batch size will be 100. So if you want to manipulate batch size, so you can just pass it as a second parameter. So I'm just asking, we can't schedule as in chrono-sypics. So let me jump here. And I'm going to show you the chat as well so that you can see what all questions are here. So we cannot schedule synchronous epics. It is not possible. If you want to do that, so we have scheduled triggered flow. So there you can create a process. And other classes also, yeah, that also you can schedule. But for that, you will be using synchronous, sorry, you will be using scheduled epics process that is part of as in chrono-sypics, right? So through that, you can call any epics class that you can schedule. But if you are talking about code, so you need to use as in chrono process for sure. Yes, Sachin, if we need to process more records, so instead of going through synchronous, we can go through as synchronous process. So Mamta is asking how many times execute method called so execute method basically processes depending on number of records. So if you like Sachin mentioned a solution, so it depends on how many records are you are fetching. So if you're fetching or querying 1000 records, so there will be five batches because default batch size is 200. So in that case, your execute method will be executing five times. Yes, really, after completion of lightning web component, there will be deployment related sessions as well. Okay, so I hope you understood the basic process of batch epics. So moving moving forward. So in previous step, like the batch ID which we received, if you want to know the status of your batch epics, so you can apply this as SQL which says select ID status job items processed, total job items number of errors from async epics jobs where ID equals to batch ID. So if you execute this as SQL, so you will be getting the information about your batch epics. And yesterday, I showed you like through UI also, you can see the status. So we can utilize that functionality as well. Now I'm going to give you a small demo where I will be implementing a batch epics. And we'll show you like how it will be implemented and executed. So we'll be implementing its test class as well. Okay, so jumping here and I'm going to implement it for you. So basically, what I'm going to do, I'm going to implement a batch epics, which will be querying all the opportunity records and all those opportunity records will be updated. And on opportunity we have a field called lead source. So I will be updating that lead source for all the opportunities. So basically what I'm going to do, I'm going to create a opportunity processor, right? So public class opportunity processor. And here I'm writing implements database dot batchable. And here we need to pass s object, right? After that, I'm passing one more interface that is database dot stateful, right? So now I'm creating one integer variable that is record count. So this record count is initially zero. And for this record count variable, we actually implemented this database dot stateful. So I will be explaining you the purpose of this database dot stateful. So right now you can just ignore it. You need to focus on this database dot batchable s object. So if you want to convert your apex class into batch epics, so you need to implement this interface, database dot batchable, right? And here we have the we have created this variable record count. So I will be explaining the use of this. But before that, I'm going to implement all three methods, start execute and finish. So public then database dot query locator, then name of method is start. And here we need to write database dot batchable context and variable name can be anything, right? So this is the name of method start is the name of the method. And this parameter you need to pass because this is this start method is basically available in this interface. And it is predefined. That's why we need to pass this parameter here of type database dot batchable context. Now here we are writing return database dot get query locator and here I'm going to write this SOQL, right? So basically what I'm doing I'm just querying ideal lead source of all the opportunity cards. And I'm not storing it into a list. I'm just writing the statement with return. So the start method will be returning the data which we are going to query with this SOQL. Right? Now I'm going to define one more method that is public void execute. And again, here I just need to pass this as a parameter. So I can just copy and paste it. Now here I need to use one more parameter that will be list of opportunity. And those opportunities I'm just storing into O PPS. So this is a list and whatever data will be returning from here that data will be automatically stored in this O PPS variable. So this list name can be anything. The s object will depend like what type of data you are querying from which object you are querying the data, right? So this way you can define these type and name. And here we need to implement the process. Right? So here I can apply null check as well. So if not O PPS dot is empty, if it is not empty, so there may be chances like if you query some data and there is no record available under the object. So for that purpose, you can apply null check. And here what you can do you can apply for opportunity. So what will happen? We have all the opportunities here in this O PPS. So this opportunity list will be traded one by one and data will be available into this O PPS. Now what we need to do this O PPS dot lead source, we need to modify. So what I'm going to do for all opportunity records, like whatever opportunity records are available under the object, I just want to update all opportunity record lead source to web. So this is my requirement and this I'm going to show you for a demo purpose, right? In real time, what we do we can apply where clause here we can apply some limits so that particular record will be queried and basis on that we will be applying the process. Okay, so once this loop is completed, once this loop is completed. So here I can write update O PPS and I'm just writing record count equals to record count plus O PPS dot size. Now we need to understand why I wrote this statement. So basically what I'm doing, whatever opportunity size is what whatever number of records are available in this O PPS list. So that size will be added into this record count. So I already told you if you are working on large number of records, so this execute method will be executed many times. So every time what will happen, this record count will be counted will be counting total number of records which are available in this opportunity list. So for example, you are querying 900 records and default batch sizes 200. So first batch will give you 200. So 200 will be added into record count. Then for next batch when this execute method will be executing. So this record count will be having value as 400 because prior it was having 200 and next time it will be having new 200 added, right? And this is happening because of this database dot stateful. So if I remove this database dot stateful, so for each execute method record count will be initialized with zero. If I remove this database dot stateful interface, so what will happen this record count variable will be reset zero will be reset as zero whenever execute method begins its execution for individual batches. Now if you want to preserve the value of record count variable for different different batches. So for that purpose, you need to write this database dot stateful interface, right? So this is the purpose of this method. Now after this, what we need to do, we need to implement one more method that is public void finish. And here also we need to write database dot batchable context BC. And here I'm going to write system dot debug. So as you know, finish will be working once finish will be working once. So here what we can do we can just show the final value of record count. So the number of records which which you are processing. So the total number of records will be available here because we are preserving the data of record count variable every time whenever execute method is executed. Right? So this way you can implement your batch apex. So this execute method is important, because here you will be implementing all the business logic. In start method, you will be querying all the data on which you want to apply the process. And in finish, you can write the statements whatever you want to execute once all the batches are processed with the help of execute method, right? So this way we can implement it. Now what we need to do, we need to execute this, right? So right now, we are not going to schedule it. So we need to execute it manually. And for manual execution, what we need to do, we just need to go to anonymous window. And under anonymous window, I will be writing some code and it will start execution. Before that, I'm going to take you under apex jobs. So here you can see we have apex jobs jobs. If you want to search for apex jobs, so here you can search under setup. So apex jobs option will be available and right now we have one apex jobs that we executed yesterday.  And here you will see one more entry. Picks will be so you will see one more entry available. Okay, so now I'm going to execute it. So I'm just opening anonymous window. And here I will be writing few lines of code so that you can understand how our batch apex can be called. So there is little bit internet fluctuation. So I'm just repeating whatever I explained. So I just showed you how you can search for apex jobs. And once you find apex jobs, so what you can do here, you can see whatever batch apex you have executed, right? So that entry will be available here. And here in anonymous window, I will be writing the code so that you can understand how it will be executed. Okay, so here I'm going to write the code. So first of all, what you need to do, you need to create an instant of sorry, instance of your class. So generally, what we do we create static methods, and we call those static methods with the name of class. But here, we are not having any static method, because it is different process. So you need to create an instance like this. And in initial sessions, I told you like, I explained you how we can create instance. So this is the same if you don't have any static method, so you can create instance of the class.  And here you can pass this value. Okay, so with this your batch will be executed. Now before executing this batch, I'm moving here under opportunities, right? So under opportunities here, I'm going to select all opportunities. And I'm going to add a field. So I'm going to add the field as lead source. So from here, I'm selecting lead source and shifting it in the beginning and clicking on save. So right now you can see lead source is different for records for few records, it is blank for few records, it is having a different but now when I will be executing the batch, it will be web for all the records, right? It will be web for all the records. And here you can see we have lots of records. We have lots of records, so total 267 records we are having. So I guess total number of batches will be two because default batch size is 200, right? So now I'm going to execute this so that you can experience how batch actually walk. So moving to developer console here we have anonymous window. These two lines are available. So I'm just clicking on execute. So both the lines will be executed. And here it is showing some error. Execute batch. Okay, it is showing some error. So I'm just going to have it again. Okay, I just found the mistake. Basically, what I did, I didn't save the code. So if you see here, it is showing some asterisk. I didn't save the code. So what I need to do. First of all, I'm just going to save this. So clicking on the class and pressing control s. So here you can see it is saving. Now it is saved. And I'm going to click on execute once again. So it is now executed. Right. So before start executing your code, you need to save whatever batch epics you have implemented. Right now I'm moving here first. So I'm refreshing this page. Apex jobs. So here we have one entry right now future method. But now you will see two entries. We have one more entry for batch epics. Right. So it is for second of May 739 a.m. You can see job type is batch epics. It is completed because we have less number of records. Total batches to because 200 more than 200 records were there. So two batches are processed failures are zero. And you can see other details are available. Okay. Now if we go here and if I pin it and refresh the opportunity tab. So here you can see all the records are having lead source as well. All the records. So this way if you want to mass update your existing records basis on particular SOQL so you can use batch epics for execution. Right. Now you might be thinking how we can pass batch size manually. So right now default batch size is 200. If you want to modify it we can do but before that I want to show you one more thing. So in finish method we use this statement. Total records processed. So if I go here under locks. So here I just need to open these one by one so that I can find a debugs. So I just need to click on debug only and here you can see total records processed is 267. So it is showing total number of record like 200 records process through one batch and 67 records process through another batch and why it is showing 267 because we implemented this interface database dot stateful. If you remove it so it will show you 67 only. So first batch 200 will be counted but when second batch will be started its execution. So record count will be initiating with zero. If you don't write this database dot stateful interface. Right. So I hope you understood everything whatever is written over here. Now I'm going to modify it. So I'm passing 100 here or let's say 50. I'm passing 50 here. So we have 267 records. Right. So total six batches will be there. Total number of batches will be 600. Okay. So again I'm going to execute it and moving here this page I'm going to refresh. So you will see one more entry here. So you can see one more entry. So earlier we executed it at 739 AM second execution happened at 742 AM. And here you can see total number of batches six because we provided batch size as 50. Right. So this way you can manually manipulate the batch size but default is 200. If you want to provide this batch size manually you can do very well. Right. So this way I hope you understood. Now I'm going to take your questions. So Abhishek is asking when we use trigger and when we use batch class. So answer is simple if you have new newly created or you are updating your record from UI you are deleting your records then trigger executes. But if you are not doing anything on your record and you want to do mass operations on your existing records then we implement batch class.  So if you use iterable so SQL limit will be applied but if you use database dot query locator so that limit won't be applied and you will be able to query 50 million records. So in our example we used a database dot query locator as a return type and to get the data we are using this method get query locator. So generally we prefer this notation only. Yeah. So start and finish only runs once and execute will run in batches until all the records passed from start are done. Yeah. Exactly. Yeah. So basically whenever there are large number of records and you want to do some operations on those existing records so every time we go for batch epics. So next question is when you pass the second parameter that is 50. So if we want to split the batch into multiple for that we have to use the second parameter or not. And yeah it is an optional parameter. So Jenna you can see in first execution I didn't use it. So I just passed one parameter right. And in second execution I wrote it like this. So this batch size is optional if you provide so accordingly batches will be processed. If you don't provide so default batch size will be 200. Okay. So with this now I'm moving further. So now what we need to do we need to understand how we can implement it's test class. Right. So I already explained you the process like how we can implement batch epics how we can execute how we can monitor. So everything I explained to you. Right. So now what we need to do. So here we monitored here we saw the results and from here we implemented batch epics through anonymous window we actually executed and later like on Thursday you will see how we can schedule batch epics as well. But before that I'm going to create new class and will be implementing its test class. So opportunity processor test. So it will be annotated with at the rate is test I'm saving it. And for practice purpose if you go to this document so here one batch code like batch code you need to implement for this requirement. So for all the accounts where billing addresses populated you need to copy that billing address to all the related contacts mailing address. Right. So this you need to do with the help of batch epics you need to write its test class as well. Okay. So I hope you are enjoying this exercise document those who are following this bootcamp and it is very important if you want to become expert in Salesforce and it is kind of your internship. So if you are following this bootcamp from the beginning so you can consider this like bootcamp your internship because in the internship also industry experts teach you few topics they give you assignment tasks and you implement them. So you can consider this bootcamp as your internship. So moving forward now I'm going to implement the test class. So here at the rate is test for the method so I'm writing private static void test batch class. So basically here we need to create the data. So we processed batch on opportunity. So I'm going to create opportunity list here. So in test class first of all we'll be creating the data. So here I'm going to create 200 records. So here we need to provide the required field value. So test I is opportunity name then we need to provide close date. So close date I'm just writing system dot today. Then we need to provide the stage. So stage name I'm providing as prospecting. Right. So this way I'm just creating the data. So here you can see total 200 records will be created. Right. 200 records will be created and those records will be having some data. After completion of this loop I'm just writing insert OPP list and here I can write test dot start test so that we can have fresh government limits and after this insert what I need to do I just need to initiate that batch. Right. So I just need to initiate that back. So what we'll be doing. So from here I'm just copying this and I'm going to paste it here. Okay. So you can see first of all I just inserted all the opportunities then opportunity processor this class instance I'm creating and then I'm calling this that execute batch method where I'm passing the instance and here like we will be processing it for 200 records. So in test class whenever you test your batch so you can provide batch sizes 200 right and here I'm going to write test dot stop test. Okay. So this way like first of all we created the data then we called batch epics now what we need to do we need to query opportunity records so that we can verify whether opportunity records are updated or not. Right. So here we created 200 records and through that batch epics all 200 records should be having lead sources web. So what I'm going to do I'm going to create list of opportunity naming it as updated opportunities. Now here I'm going to query from opportunity here I'm going to query from opportunity where lead source equals to web. Right. So what I did I just queried all the opportunity records where lead sources web. Right. So you can see I'm querying the opportunities where lead sources web. So we created 200 records here then we executed a batch. So batch will be updating all 200 records. Now here I just need to apply a system dot assert equal and I just need to check the size of this list updated opportunity if it is equals to 200 it means 200 records are updated with lead source as web if it is equal so this will pass if it is not passed then like your logic is not correctly implemented. Okay. So I'm just saving the code and it is having some error. So here I just missed this bracket. So yesterday I also did same mistake. So now you can see the code is saved permanently and this test class is available here. Now moving to test tab clicking on run test. So it is failing. So let's see what is the error. So assertion is failing expected 200 and actual is zero. So there is some mistake in the code. So let me just check it again. So I'm just checking what mistake I did. So we inserted the opportunities then opportunity process instance we created then in database dot execute batch we are passing it. So the code seems correct. Okay. So here I'm just changing it. Although it is case insensitive but here I'm just changing it and trying to execute it once again. Again it is failing. So let me just check. So I'm just checking why it is failing. If you find out any mistakes or let me know in the chat. Yeah. So I think wamshi picked my mistake. So what I did I just created these opportunities but I didn't add this opportunity to opportunity list. So thank you for those who pointed out this error. So here I just need to write OPP list ad and here I need to add opportunities. So this is a statement I missed. So inside loop I just need to add all the opportunity instances into OPP list. Now opportunities will be inserted and it will run. So again I'm just saving the code and so this happens sometimes because I just wrote the code and I was unable to find out the bug. So with your help I'm able to complete it now. So I'm just clicking on run test. Okay. It is again showing some error. So let me see what is it now. So insert failed. Okay. So here it is asking please populate amount on opportunity. So there is one validation available which is saying us to populate opportunity amount as well. So what we need to do we need to populate amount also. Right. So I think this time it will run successfully. So again I'm clicking on run test. Yeah this time you can see your test classes passing successfully. Right. And if I go here and check the code coverage so it is 100% all the lines are covered which we implemented. So this way whenever you want to write your batch epics or just implement the batch epics and through this test class this way you can test whether it is working fine or not. So first of all you need to create the data and then insert that then execute your batch and then query the records which you modified or updated and then apply the assert operation. And I hope you understood why assert is important because I just forgot to write the statement. So I just found out this error with the help of assert equal. If I didn't write assert equal so we won't be able to verify whether code is working fine or not. So this is best practice to write assert equals in each code. So this way I hope you understood how batch epics works how we can implement how we can test it through anonymous window how we can monitor it how we can view the updated values on UI and how we can implement the test class. Right. Now I'm moving to the chat so that I can take your questions. So Jenna I already told you like second parameter is optional. Yes Jenna we can change batch size limit from 200 to 500. Yeah. So you just need to pass that second parameter but that the actual default size that is 200 that you cannot change. So Venkatesh I already explained how to write test classes for if else condition. So if you have if else condition so in that case you will be implementing two test methods in your test class. Right. So that I already explained you. Yeah. So there is one question when to use private public and global. So generally a private we use if you want to use that method or variable inside the class. So if you want to restrict method or variable into one class then you use private. If you want your method can be accessible outside the class then you use public and if you want your methods will be accessible outside the namespace outside the application then you can use global. Right. So Venkatesh this scenario I already demonstrated when we were discussing about test class so you can just go through the test class sessions you will understand how we can implement positive and negative test cases for if else conditions. Okay. So this way I hope everybody understood whatever I explained today and this way batch epics is completed and tomorrow we will be discussing about cueable epics and day after tomorrow I will show you how we can schedule epics classes with the help of scheduled epics. So this is it for today's session. If you have more question you can ask otherwise you can go and do some practice and at nine PM we'll be having cybersecurity bootcamp. So do join that and please share this channel link with with the folks. So from next month I will be starting new bootcamp that will be on C and C++ programming. So all the beginner those who are related to college freshers switching from non IT to IT if they want to begin their coding journey. So C and C C++ programming languages are based for beginners. So that bootcamp will be running for two to three months. It will be starting from next month like June 1st week. I have already created a telegram group for that. So you can just join the telegram group if you want to receive timely notification. Right. So there are a few more questions coming up. So Mamta is asking can you explain so bulkification is simple. So whenever we need to create lots of reports so here we are creating bulkification. So this loop will be written 200 times 200 opportunities will be created through this statement OPP and all the opportunities will be added into this opportunity list. Right. So Charlie I already showed you like this batch of topics we implemented to change the existing lead source value to web for all the records. It is working so you can implement it in your system. So whatever records you are having already in your org so all those records lead source will convert into web. So Navin we are not updating lead source prospecting prospecting is basically stage. So here we didn't provide lead source lead sources null blank and then it will be updated to web. So here we didn't provide lead source any value. Lead source is a pick list and that will be having none. So once that batch will be executed so all the records will be having lead source as well. Venkatesh the topics which I already completed I won't be repeating them because I have limited time. So you can just go and check the test class sessions. There you will get to know for if else how we can write two different methods. Thank you for appreciating my efforts. So I'm trying to explain everything in detail so that I can answer all of your questions. So I'm doing this for the community so that you can learn things properly. So this is it for today's session. We'll see you tomorrow with new topic that is queueable epics. Thank you everybody for joining this session. Keep learning keep motivating yourself and keep providing some feedback for me. So from few days you have not provided any feedback and reviews. So I would request please provide some feedback and reviews so that I also can get some motivation and please show some gratitude and support and help Sanjay Gupta Tech School YouTube channel to reach 100k subscribers on YouTube by the end of this year. Right. So right now I am running two boot camps one on Salesforce and one on cybersecurity. From next month there will be one more bootcamp and I'm also planning to have one more bootcamp on Salesforce cloud. Right. So there will be three four boot camps running in parallel at different times. Right. And gradually you will be having a lot more. So I'm working on different different concepts. So wherever things are working out so I will be sharing all the information with you so that you can get benefited. Thank you everybody for joining this session. See you tomorrow at same time.


Hi everyone. Happy Sunday. I'm Joe for jaspyscasegrace.com coming at you with a quick random number block randomizer for Spectre football picker team 4 featuring these three teams right here. The Bengals currently on this Sunday, the 12th, and overtime against the Niners and they're driving. They're almost in the red zone. And Buffalo trying to come back and at least high up the Buccaneers with a minute left in the game. This is pretty exciting to Buffalo as the ball. Big thanks to this group for getting into it. A lot of football action on the website, jaspyscasebreaks.com. A lot of football action happening on in reality as well on TV. This TV two-screen day, I think. Jaspys on one screen, football on the other screen.  Got a catch-and-run all the way to the 12 for the Bills. Three into two, five exciting day. Three into two, five times for names and numbers. One. Two, three, four, and five. You got Eric down a mark. Three into two, five times for the numbers. One. Two, three, four, and five. After five times, we got eight down to zero. Now remember, zero gets any and all redemptions including one-of-one redemptions. And if there's non-numbered cards, we'll be randomizing those as well. All right, Eric with eight, Gale with four and six, Jose with seven, Logan M with two, Jose with nine, Robert with one. Gale with five, Jeremy 33 with three, and Mark with L. Mark L with zero that is. So any and all redemptions for those three teams including one-of-one redemptions. Robert, you'll still get any live one-of-ones though. Let's order these by number. All right, thanks for watching everybody. A couple more fillers to go and then we're in Brakesville. Check it out, jaspyscasebreaks.com. Bye-bye.


Okay, njroute22.com here in a new venue don't ask me why I just felt like doing something different and today it's been actually three weeks since I filmed a cheap wine reviews vlog today it's in a new environment here it's gonna be a little bit boomy I don't have my wireless mic because I don't have an adapter for my camera my 10 year old DLSR DSLR so it's gonna be boomy I'll try and fix it in post-production but today's wine is the Laia 2017 I'm gonna give you a little background on the Laia Laia was a wine I discovered five years ago made six years ago it's a Spanish wine it's like a Garnacha Monastrel that type of thing and I remember drinking it was a 2011 maybe a 2012 vintage 14 and change percent and it was a good wine man was like seven or eight seven bucks seven eight dollars a bottle and it was good and then all of a sudden the 2013 2014 2015 vintages left us with our two-bottle review feeling pretty pretty crappy something happened so I happened to stumble across this Laia 2017 vintage aged in stainless steel barrels and then finished off with four months in a French oak barrel whatever that means and I just want to let you know one thing tomorrow I think I had a little bit about a wine industry editorial coming out about about why we're a little bit cynical when it comes to the the verbiage that seems to be unique to the wine industry and as well as it's infected all the wannabe wine reviewers as well I read all these independent customer reviews on wine merchant websites and they all talk in the same like like model the same like like framework oh it was this it has a note of this it's strong on this God man it cannot be any more in your mind than anything else but anyway this wine here is is made by a winery called bodegas adhalaya and I think that's where they get the Laia name from and here's what they say about it it was it's the grapes are grown in a in the hot dry region of Spain in limestone soils which is great actually I'll explain in a minute and it's about two to three thousand feet above silo which is good because that helps with the insects and all sorts of other problems that you might have with wine and this is why I heard from some people I can't tell you if it's true or not but they don't need the same level of pesticides as they do in like low lower altitude regions in California for instance so even though it's not an organic wine it may actually be as good if not better from a pesticide standpoint then that a that a organic wine may or may not have the 2012 2011 we're good and then we we took a few years off from it and we're trying again I'm on my second bottle you're drinking it watered down today's coffee sponsored by Wawa not really but it's inadvertently freely sponsored by Wawa man it's refreshing this year I gotta say I'm gonna try some I'm gonna try some plain I never do this I hate doing it I'm not gonna pay attention to the finish or the lingering or any of that crap I'll tell you this much I don't think it's very good straight I prefer it watered down it has a little bit of a I don't know I don't want to say yeasty it's hard to explain exactly but a lot of people online on the interwebs say or said that it's it's underpriced this wine should be twice as much I don't know maybe it's the 15% that got them and they felt all jolly I don't know it's a decent one and seven I paid 749 Berkeley there's this liquor store there and I'm gonna go off on a side note here I'm a little bit perturbed at the larger wine retailer such as Bourbon Street up on the central to western section of central New Jersey central you know anywhere from like I guess Lebanon or Bridgewater that area all the way out to Phillipsburg incredible buying power now and ten or more stores and their price on these lower end bottle of wines bottles of wine that are normally you know seven eight bucks at an independent single liquor store they charge ten bucks for so not only do they get you know power of economy of scale by buying more cases they probably pay a dollar less a bottle than the independent guys and they charge two dollars more so they're making hand over fist when it comes to the lower end wines and that is starting to bother me a little bit and and I don't know what to do about I think they shouldn't they do price match if you bring a receipt in from another store so I highly recommend it if Bourbon Street or for a what's the other liquor store buy right buy right I have to say shop right liquors does does charge the low end price at the independent stores but there's a place in Union I think called shoppers wines then as these low-end bottles one for a buck less than in the lowest other places 699 a bottle so that really gets to me when it comes to these these these wine stores they these people were becoming filthy rich because they have convenient liquor store and someone's not going to be willing to drive you know an extra 10 minutes or 10 miles to save two dollars so it almost works out in their favor and that to me is taking advantage of people they they should they should just do like the other guys do even the I can go on all these people just think about think about think about all the reviews you read there they're like incredible verbal tapestries okay there's all sorts of flavor and analogies and really it is just grape juice it's grape juice with and you make it up in your head it's like maybe some childhood memory gets gets recollected and it's it's pretty much all red wine tastes same I never really say wow that tastes like rocks or that tastes like string cheese or it always tastes pretty much like wine I mean a lot of people like this lie wine and I guess I mean after getting my taste buds numbed after bottle number one I have to tell you that bottle number two tastes different it tastes different it's more pleasant and it's easier to drink the more you drink the first few steps after letting it breathe of course that's what they say and believe it you are yeah maybe letting it breathe equalizes some of the some of the molecules in there that point about the lie but the whole point is it's $7.49 cents and it's right in the middle of the five to ten dollar price range and 15% alcohol it packs a punch and it probably has more if there's one takeaway with this it's it's and pay attention to my wine ran tomorrow please it's try not to read too much into it the wine is going to be acceptable most of the time even the cheapest of the cheap wines you're going to be able to suck down a few glasses and not feel vomitously sick the wine industry is fascinating and I don't see too many people challenging you because the minute you challenge it they cut you off you won't get any advertising you won't give you free wine I don't get any of that crap anyway so why what do I have to lose I think I have more to gain by getting more people to wake up about the fact that I don't think there really is much difference between a six or seven dollar bottle of wine and a fifty or a hundred dollar bottle of wine the taste is momentary and fleeting I'm almost wanting to bet if someone wants to donate two hundred and fifty dollar bottles of red Spanish wine to the mjbru22.com and let me try them the same exact way I drink them you know water down I love this by the way double you have to double the cups to keep the ice from melting back to me to prove this point that that there really is no difference I would be happy to indulge I'll be back in a little while mjbru22.com back the next day after drinking a lyre 15% two bottles and I have to say I don't feel so swell today I'm not sure if it's because I didn't drink for six days in a row beforehand but I don't think the lyre passed the test I really don't but I think the two bottle test should work no matter whether I drink the night for or not for a week before so I'm not going to drink the lyre anymore unless I know I'm just going to have a glass or two I mean it's a it's a pretty okay wine but it doesn't pass the two bottle test and that's it it's a beautiful day and too bad my I don't feel the same way the day looks and that's it until the next two bottle test have a good week