Tuesday 16 February 2021

Could not find add method: AddPrefetch (type: System.String)

 Issue:

After the initial unicorn setup with Sitecore instance, there may be a chance to get below issue

Could not find add method: AddPrefetch (type: System.String)

and there is no more information into log files. 



Fix:
To resolve this issue, 
ensure ranbow.*.dll, unicorn.*.dll, configy.dll and Kamsar.WebConsole.dll properly deployed in wwwroot/instancename/bin directory.

Wednesday 30 December 2020

Create Sitecore bulk items from list

There are scenarios where we have to create item list in Sitecore - For example: Countries, States, Products or any dropdown item list.


Prerequisites


Sitecore PowerShell Extension must be installed.

List of items, for reference sharing list click to download CountryList, USStates, IndiaStates or any custom file.

Download script CreateBulkItem.ps1


Demo Time


Create a Sitecore item at below path 

/sitecore/system/Modules/PowerShell/Script Library/SPE/Tools/Package Generator/Content Editor/Context Menu/Packaging

by duplicating existing script item and paste CreateBulkItem.ps1 as below (update list text path in script)


Create Sitecore bulk items from list


Execution Steps

Now right click on the item/folder, where wanted to create item list as per screenshot
Name and Value field's must have default value set as $name in template's standard value


sitecore-bulk-item-step

sitecore-bulk-item-inputs

sitecore-bulk-item-success






bulk-item-list



Note: We can do this activity for different field values using json item list file, we only have to update PowerShell script and Sitecore steps will remains same .


Save your time, Hope this help.