Skip to content

Instantly share code, notes, and snippets.

View tocohara's full-sized avatar

Chris Hardgrove tocohara

View GitHub Profile
@tocohara
tocohara / gist:58502c8c149f71079b99f6a67bff8018
Created December 21, 2020 02:19
Process Re-Open Item Line Method
public virtual int ProcessReOpenItemLine(FSAppointmentDet apptDet)
{
if (apptDet.Status == ID.Status_AppointmentDet.NOT_STARTED)
return 0;
FSAppointmentDet copy = (FSAppointmentDet)AppointmentDetails.Cache.CreateCopy(apptDet);
copy.Status = ID.Status_AppointmentDet.NOT_STARTED;
AppointmentDetails.Update(copy);
@tocohara
tocohara / gist:19b3875a11d703438f25b6b30d7f057a
Created December 21, 2020 02:16
Get Next Reference Number Method
public virtual string GetNextRefNbr(string baseRefNbr, string lastRefNbr)
{
string newNumberSymbol = GetNewNumberSymbol();
if (string.IsNullOrWhiteSpace(lastRefNbr)
|| (newNumberSymbol != null && lastRefNbr.Trim() == newNumberSymbol.Trim())
)
{
return GetInitialRefNbr(baseRefNbr);
}
else
@tocohara
tocohara / gist:527b824cbfd007733c919e913199bbc0
Created December 21, 2020 02:13
Acumatica AppointmentAutoNumber Attribute for the Appointment Reference Number Field
[AppointmentAutoNumber(typeof(
Search<FSSrvOrdType.srvOrdNumberingID,
Where<
FSSrvOrdType.srvOrdType, Equal<Optional<FSAppointment.srvOrdType>>>>),
typeof(AccessInfo.businessDate))]
@tocohara
tocohara / gist:74db2312568daa394293c30dc934c8d6
Created December 21, 2020 02:10
Acumatica Service Order DAC Reference Number Field
public abstract class refNbr : PX.Data.BQL.BqlString.Field<refNbr> { }
[PXDBString(15, IsKey = true, IsUnicode = true, InputMask = ">CCCCCCCCCCCCCCC")]
[PXDefault]
[PXUIField(DisplayName = "Service Order Nbr.", Visibility = PXUIVisibility.SelectorVisible)]
[FSSelectorSORefNbr]
[AutoNumber(typeof(Search<FSSrvOrdType.srvOrdNumberingID,
Where<FSSrvOrdType.srvOrdType, Equal<Optional<FSServiceOrder.srvOrdType>>>>),
typeof(AccessInfo.businessDate))]
[PX.Data.EP.PXFieldDescription]
public virtual string RefNbr { get; set; }
@tocohara
tocohara / gist:5865a6822b57758c947eadfefb2257b8
Created December 21, 2020 02:08
Acumatica Service Order DAC Service Order Type Field
public abstract class srvOrdType : PX.Data.BQL.BqlString.Field<srvOrdType> { }
[PXDBString(4, IsKey = true, IsFixed = true, InputMask = ">AAAA")]
[PXUIField(DisplayName = "Service Order Type", Visibility = PXUIVisibility.SelectorVisible)]
[PXDefault(typeof(Coalesce<
Search<FSxUserPreferences.dfltSrvOrdType,
Where<
PX.SM.UserPreferences.userID, Equal<CurrentValue<AccessInfo.userID>>>>,
Search<FSSetup.dfltSrvOrdType>>))]
[FSSelectorSrvOrdType]
[PXUIVerify(typeof(Where<Current<FSSrvOrdType.active>, Equal<True>>),
@tocohara
tocohara / gist:59f4bdfd3a0bd11b55e281fa9c6b381a
Created July 30, 2020 01:24
Create Shipment Package Details in Acumatica
PUT /entity/Tote/18.200.001/Shipment HTTP/1.1
Host: YourERPInstance
Content-Type: application/json
{
"id": "a14bb7b0-28c2-ea11-8a94-0c54152a4c79",
"Packages": [
{
"id": "a3a541c4-30c2-ea11-8a94-0c54152a4c79",
"Contents": [
{
@tocohara
tocohara / gist:0d0b4b9717ebdd2348bf2072ff0e9029
Created July 30, 2020 01:23
Get Shipment Allocations in Acumatica
GET / entity/ExtendedDefault/18.200.001/Shipment/0000032?$expand=Details/Allocations HTTP/1.1
Host: YourERPInstance
Content-Type: application/json
--return body (partial)
{
"id": "a14bb7b0-28c2-ea11-8a94-0c54152a4c79",
….
"Details": [
@tocohara
tocohara / gist:e2e3a7192c512f2bc9761a68592c5140
Created July 30, 2020 01:20
Create Shipment Packages in Acumatica
PUT /entity/Tote/18.200.001/Shipment?$filter=ShipmentNbr eq '0000032'&$expand=Packages HTTP/1.1
Host: YourERPInstance
Content-Type: application/json
{
"Packages":[
{
"BoxID": {"value":"PALLET"},
"Confirmed": {"value":"true"},
"Description": {"value":"Not So Big"},
"Weight": {"value":"0.0"},
@tocohara
tocohara / gist:47a0740e75c6d348d1517f51409b958b
Created July 30, 2020 01:16
Create Shipment Line Allocations in Acumatica
PUT /entity/ExtendedDefault/18.200.001/Shipment HTTP/1.1
Host: YourERPInstance
Content-Type: application/json
{
"ShipmentNbr" : {"value" : "0000032" } ,
"Details": [
{
"LineNbr" : {"value" : "1" } ,
"Allocations": [
{