imports/vx/server/code/vxapp.js
/**
     * Create a domain record based on facts in expressed in parameters object.
     *
     * @param {object} parameters Parameters object.
     * @return {string} New domain ID.
     */
Create a domain record based on facts in expressed in parameters object.
@param {object} parameters Parameters object.
@return {string} New domain ID.
Create a domain record based on facts in expressed in parameters object . @param { object } parameters Parameters object . @return { string } New domain ID .
createDomainRecord(parameters) {
        if (!parameters) {
            OLog.error("vxapp.js createDomainRecord no parameters were supplied")
            return
        }
        let tenantName = Util.fetchTenantField(parameters.tenantId, "name")
        let domain = {}
        domain.tenant = parameters.tenantId
        if (tenantName) {
            domain.name = Util.i18n("common.value_default_domain_name_with_tenant", { tenantName: tenantName })
            domain.description = Util.i18n("common.value_default_domain_description_with_tenant", { tenantName: tenantName })
        }
        else {
            domain.name = Util.i18n("common.value_default_domain_name")
            domain.description = Util.i18n("common.value_default_domain_description")
        }
        domain.base = true
        if (parameters.userId) {
            domain.userCreated = parameters.userId
            domain.userModified = parameters.userId
        }
        let domainId = Domains.insert(domain)
        OLog.debug("vxapp.js createDomainRecord created domainId=" + domainId + " tenant=" + OLog.debugString(domain))
        return domainId
    }
createDomainRecord ( parameters ) { if ( ! parameters ) { OLog . error ( "vxapp.js createDomainRecord no parameters were supplied" ) return } let tenantName = Util . fetchTenantField ( parameters . tenantId , "name" ) let domain = { } domain . tenant = parameters . tenantId if ( tenantName ) { domain . name = Util . i18n ( "common.value_default_domain_name_with_tenant" , { tenantName : tenantName } ) domain . description = Util . i18n ( "common.value_default_domain_description_with_tenant" , { tenantName : tenantName } ) } else { domain . name = Util . i18n ( "common.value_default_domain_name" ) domain . description = Util . i18n ( "common.value_default_domain_description" ) } domain . base = true if ( parameters . userId ) { domain . userCreated = parameters . userId domain . userModified = parameters . userId } let domainId = Domains . insert ( domain ) OLog . debug ( "vxapp.js createDomainRecord created domainId=" + domainId + " tenant=" + OLog . debugString ( domain ) ) return domainId }
Create a domain record based on facts in expressed in parameters object.
Create a domain record based on facts in expressed in parameters object .
// Use fetchTenantField to prevent default value: