Edit

SetTaggedValue (taggedTextString, tag, value)

Result type:  text

Definition:  Returns a new tagged text string containing the given tag and value inserted into the provided taggedTextString. The tag must begin with an underscore. If the tag already exists in taggedTextString, the value is replaced. If the value is an empty string, the tag is removed.

Example: 

    let taggedText = SetTaggedValue("", "_colour", "Bronze")
    let taggedText = SetTaggedValue(taggedText, "_size", "Small")

Sets taggedText to "_colour: Bronze; _size: Small; ".

Rationale:  The TaggedText field is normally used with ReadCurentRecordForWindow and WriteCurrentRecordForWindow, but you may need to set values programmatically using ReplaceField.

Availability:  available within MWScript handlers in MoneyWorks Gold 8.1.4 and later.

See Also:

GetTaggedValue: Extract a value from a tagged value field