Skip to content

Instantly share code, notes, and snippets.

Created January 16, 2021 08:09
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
using Newtonsoft.Json.Linq;
using PX.Data;
using PX.Export.Authentication;
using System.Web.Http;
using CustomController.Models;
using CustomController.Helpers;
using System.Web;
namespace CustomController
public partial class IIGController : ApiController
public IHttpActionResult PostData([FromBody]JObject data)
var lead = data.ToObject<BusAccount>();
if (lead == null)
return BadRequest("Passed object structure is not corresponding to the requirements");
var retVal = BusAccount.CreateBusAccount(lead);
if (retVal)
return Ok();
return BadRequest("Error has been thrown while processing the data");
protected override void Dispose(bool disposing)
if (HttpContext.Current != null && HttpContext.Current.Session != null)
PXLogin.LogoutUser(PXAccess.GetUserName(), HttpContext.Current.Session.SessionID);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment