Comments
A base single Instance CU would be work well. No need to recreate with extensions.The SI CU just needs to store KeyValue pairs to be used later in a process. Keep it simple.codeunit 55108 SingleInstanceKeyValues{ SingleInstance = true; var KeyValues: Dictionary of [Text, Text]; procedure SetKeyValue(KeyName: Text; KeyValue: Text) begin if KeyValues.ContainsKey(KeyName) then KeyValues.Remove(KeyName); KeyValues.Add(KeyName, KeyValue); end; procedure GetKeyValue(KeyName: Text) KeyValue: Text begin if KeyValues.ContainsKey(KeyName) then exit(KeyValues.Get(KeyName)) else exit(''); end; procedure RemoveKeyValue(KeyName: Text) begin if KeyValues.ContainsKey(KeyName) then KeyValues.Remove(KeyName); end;}
