Creating a blueprint and editing a property from C++

I am trying to make an blutility for a character template where you pick a skeleton and it’ll setup some variables for you e.g. the Skeletal Mesh in the Character->Mesh.

So I have made a character blueprint like so:

UBlueprintFactory* Factory = NewObject();
Factory->ParentClass = CharacterClass;

FString Name = FString::Printf(TEXT("BP_%s"), *CharacterName);
AssetToolsModule.Get().CreateAsset(Name, DestinationFolder, Factory->SupportedClass, Factory);

UObject* CreatedAsset = AssetToolsModule.Get().CreateAsset(CharacterName, DestinationFolder, Factory->SupportedClass, Factory);

Then for a simple test to check the property editing works I have this little bit of code which tries to change the construction script boolean on the blueprint:

    UBlueprint* Blueprint = Cast<UBlueprint>(CreatedAsset);
auto ConstructionProp = FindField<UBoolProperty>(Blueprint->GetClass(), "bRunConstructionScriptInSequencer");
if (ConstructionProp)
{
	ConstructionProp->SetPropertyValue_InContainer(Blueprint, true);
}

Everything runs with no errors but actually setting the property value does nothing. Anyone have experience in doing something similar?

Figured it out! All I had to do was save the asset before I tried to change the property.

UPackage* const Package = CreatedAsset->GetOutermost();
FString const PackageName = Package->GetName();
FString const PackageFileName = FPackageName::LongPackageNameToFilename(PackageName, FPackageName::GetAssetPackageExtension());
UPackage::SavePackage(Package, nullptr, RF_Standalone, *PackageFileName, GError, nullptr, false, true, SAVE_NoError);