;;Key Value Map Definition Sample /* - This example defines a Key Value Map named TSPL IndiaStateCode. - The Key Type is set to Sys Id, indicating that the keys are system-defined identifiers. - Each Key Value maps a state identifier, such as AndhraPradesh or Assam, to its corresponding state code. The Default attribute returns an empty string if a matching key is not found in the map. ;;Syntax Syntax [Key Value Map : ] Key Type : Key Value : : Key : Default : */ [Key Value Map : TSPL IndiaStateCode] Key Type : Sys Id Key Value : AndamanNicobarIslands : "35" Key Value : AndhraPradesh : "37" Key Value : ArunachalPradesh : "12" Key Value : Assam : "18" Default : ($$InitValue:String) [#Menu : Gateway of Tally] Add : Item : "Key Value Map Definition" : Display : TSPL KeyValueMapSample [Report : TSPL KeyValueMapSample] Form : TSPL KeyValueMapSample [Form : TSPL KeyValueMapSample] Part : TSPL KeyValueMapSample Width: 30% Screen [Part : TSPL KeyValueMapSample] Line : TSPL KeyValueMapSampleTit,TSPL KeyValueMapSample [Line : TSPL KeyValueMapSampleTit] Field : TSPL KeyValueMapSampleTit [Field : TSPL KeyValueMapSampleTit] Use : Name Field info : "Key Value Map" Align: Centre Full Width: Yes Border: Thin Bottom [Line : TSPL KeyValueMapSample] Field : medium prompt, TSPL KeyValueMapSample Local : Field : medium prompt : Set as : "Assam Code" Space Top: 3 mms ;;The function is used for the 2nd pattern where if the search is found then the function will evaluate the corresponding expression defined in the map in the current object context. ;;If the search is not found, the function will use the default attribute. [Field : TSPL KeyValueMapSample] Use : Name Field Set as : $$GetValueFromKeyValueMap:TSPLIndiaStateCode:Assam Set Always: Yes Width : 3 Cms Style : Small ;;End of File