sections in the article
This article explains why custom CVL value keys need to be updated manually. It also gives you an example of how to update a CVL value key manually.
Why update keys manually?
When you make changes to the keys of a custom CVL and then deploy or replace it in the inriver Control Center, there will be a discrepancy between the key values that have been stored within the fields of your entities prior and the new ones in your Custom CVL.
When you have modified the keys used in a Custom CVL's key/value dictionary and then uploaded said Custom CVL to inriver through inriver Control Center, your next step is to update the keys that were stored prior.
The update can be done manually through one of the inriver APIs.
Example
Below is an example of how to update a custom CVL key or any CVL that's in an environment's model.
using System; using System.Security.Authentication; using inRiver.Remoting; namespace ServiceCenterExamples { class Program { static void Main(string[] args) { var manager = CreateManager("myUsername", "myPassword", "myEnvironment"); var cvlValue = manager.ModelService.GetCVLValueByKey("OldKey", "MyCustomCvl"); if (cvlValue==null) { return; } cvlValue.Key = "NewKey"; manager.ModelService.UpdateCVLValue(cvlValue); Console.WriteLine("Finished"); } private static IinRiverManager CreateManager(string username, string password, string environment) { try { return RemoteManager.CreateInstance("https://remoting.productmarketingcloud.com", username, password, environment); } catch (AuthenticationException e) { Console.WriteLine($"Not Authorized! \n {e.InnerException}"); throw; } catch (Exception exception) { Console.WriteLine(exception.InnerException?.ToString()); throw; } } } }
Comments
0 comments
Please sign in to leave a comment.