Skip to content

Instantly share code, notes, and snippets.

@styson
Created July 16, 2010 20:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save styson/07496f71fcbe97f41c74 to your computer and use it in GitHub Desktop.
Save styson/07496f71fcbe97f41c74 to your computer and use it in GitHub Desktop.
<%@ Language=JavaScript %>
<% Response.Buffer = true %>
<%
///////////////////////////////////////////////////////////////////////////////
// Product : Dovetail Admin
//
// Series : Dovetail Software Web Series(tm)
//
// Name : addWorkgroup.asp
//
// Description : Add a new workgroup
//
// Author : Dovetail Software, Inc.
// 4807 Spicewood Springs Rd, Bldg 4 Suite 200
// Austin, TX 78759
// (512) 610-5400
// EMAIL: support@dovetailsoftware.com
// www.dovetailsoftware.com
//
// Platforms : This version supports Clarify 4.5 and later
//
// Copyright (C) 2010 Dovetail Software, Inc.
// All Rights Reserved.
///////////////////////////////////////////////////////////////////////////////
%>
<!--#include file="../include/inc_page_init.asp"-->
<!--#include file="../include/json.asp"-->
<%
var result = {};
result.success = true;
result.errorMessage = "";
try {
var strName = Request.Form("name");
var boWorkgroup = FCSession.CreateGeneric("workgroup");
boWorkgroup.AppendFilter("work_group", "=", strName);
boWorkgroup.Query();
if(boWorkgroup.Count() == 0) {
boWorkgroup.AddNew();
boWorkgroup("work_group") = strName;
boWorkgroup.Update();
} else {
result.success = false;
result.errorMessage = "Workgroup already exists";
}
} catch(e) {
result.success = false;
result.errorMessage = e.description;
}
boWorkgroup.CloseGeneric();
boWorkgroup=null;
Response.Clear();
Response.Write(JSON.stringify(result));
%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment