Documentation
¶
Index ¶
Constants ¶
const NAME = "Territory2Model"
Variables ¶
This section is empty.
Functions ¶
func ComponentName ¶ added in v0.63.0
func ComponentName(path string) metadata.MetadataObjectName
ComponentName returns the package.xml member name of a territory or rule file, <Model>.<Name>.
func ModelComponentFiles ¶ added in v0.63.0
func ModelComponentFiles(m metadata.RegisterableMetadata, model, dir, name string, metadataType metadata.MetadataType, format metadata.Format) (map[string][]byte, error)
ModelComponentFiles returns the file for a component of the model named model, territory2Models/<model>/<dir>/<name>.<suffix>, with -meta.xml appended in source format. An empty dir places the file directly in the model's directory.
Types ¶
type FieldValue ¶ added in v0.63.0
type FieldValue struct {
Name struct {
Text string `xml:",chardata"`
} `xml:"name"`
Value TypedValue `xml:"value"`
}
FieldValue is the value of a custom field on a territory or territory model.
type Territory2Model ¶
type Territory2Model struct {
metadata.MetadataInfo
XMLName xml.Name `xml:"Territory2Model"`
Xmlns string `xml:"xmlns,attr"`
Xsi string `xml:"xmlns:xsi,attr,omitempty"`
Xsd string `xml:"xmlns:xsd,attr,omitempty"`
CustomFields []FieldValue `xml:"customFields"`
Description *struct {
Text string `xml:",chardata"`
} `xml:"description"`
Name struct {
Text string `xml:",chardata"`
} `xml:"name"`
RecordVisibility *struct {
Text string `xml:",chardata"`
} `xml:"recordVisibility"`
UserRecordAccess *struct {
Text string `xml:",chardata"`
} `xml:"userRecordAccess"`
}
func Open ¶
func Open(path string) (*Territory2Model, error)
func (*Territory2Model) Files ¶ added in v0.63.0
Files writes the model into its own directory, which also holds its territories and rules: territory2Models/<Model>/<Model>.territory2Model.
func (*Territory2Model) SetMetadata ¶
func (c *Territory2Model) SetMetadata(m metadata.MetadataInfo)
func (*Territory2Model) Type ¶
func (c *Territory2Model) Type() metadata.MetadataType
type TypedValue ¶ added in v0.63.0
type TypedValue struct {
Text string `xml:",innerxml"`
Type string `xml:"xsi:type,attr,omitempty"`
Nil string `xml:"xsi:nil,attr,omitempty"`
}
TypedValue is a custom field value written with its XML schema type, <value xsi:type="xsd:string">, or as <value xsi:nil="true"/> when the field has no value.