imports/vx/server/code/vxapp.js
/**
     * Create a tenant record based on facts in a parameters object.
     *
     * @param {object} parameters Parameters object.
     * @return {string} New tenant ID.
     */
Create a tenant record based on facts in a parameters object.
@param {object} parameters Parameters object.
@return {string} New tenant ID.
Create a tenant record based on facts in a parameters object . @param { object } parameters Parameters object . @return { string } New tenant ID .
createTenantRecord(parameters) {
        if (!parameters) {
            OLog.error("vxapp.js createTenant no parameters were supplied")
            return
        }
        OLog.debug("vxapp.js createTenant parameters=" + OLog.debugString(parameters))
        let tenant = {}
        if (parameters.userId) {
            tenant.userCreated = parameters.userId
            tenant.userModified = parameters.userId
            tenant.pocUserId = parameters.userId
            tenant.country = Util.getProfileValue("country", parameters.userId)
            tenant.address1 = Util.getProfileValue("address1", parameters.userId)
            tenant.address2 = Util.getProfileValue("address2", parameters.userId)
            tenant.city = Util.getProfileValue("city", parameters.userId)
            tenant.state = Util.getProfileValue("state", parameters.userId)
            tenant.zip = Util.getProfileValue("zip", parameters.userId)
        }
        let tenantId = Tenants.insert(tenant)
        OLog.debug("vxapp.js createTenant created tenantId=" + tenantId + " tenant=" + OLog.debugString(tenant))
        return tenantId
    }
createTenantRecord ( parameters ) { if ( ! parameters ) { OLog . error ( "vxapp.js createTenant no parameters were supplied" ) return } OLog . debug ( "vxapp.js createTenant parameters=" + OLog . debugString ( parameters ) ) let tenant = { } if ( parameters . userId ) { tenant . userCreated = parameters . userId tenant . userModified = parameters . userId tenant . pocUserId = parameters . userId tenant . country = Util . getProfileValue ( "country" , parameters . userId ) tenant . address1 = Util . getProfileValue ( "address1" , parameters . userId ) tenant . address2 = Util . getProfileValue ( "address2" , parameters . userId ) tenant . city = Util . getProfileValue ( "city" , parameters . userId ) tenant . state = Util . getProfileValue ( "state" , parameters . userId ) tenant . zip = Util . getProfileValue ( "zip" , parameters . userId ) } let tenantId = Tenants . insert ( tenant ) OLog . debug ( "vxapp.js createTenant created tenantId=" + tenantId + " tenant=" + OLog . debugString ( tenant ) ) return tenantId }
Create a tenant record based on facts in a parameters object.
Create a tenant record based on facts in a parameters object .