Methoden über PX Rest Api
bool pxRestApiSetMandant(string mandant)
bool pxRestApiPrintPDF(int dokumentNr, string pdfPath, string listForPDF)
bool pxRestApiPrintDocument(int dokumentNr, string druckerName, string listForPrintDocument, int printAnzahl)
bool pxRestApiListenDruckPdf(string liste, List<PRO_Liste_Selektion> selektionen, string pdfDatei, ref string error)
bool pxRestApiListenDruck(string liste, List<PRO_Liste_Selektion> selektionen, int printAnzahl, ref string error, string druckerName = "")
string pxRestApiGetZusatzfeldWert(dynamic zusatzFelder, string spaltenName)
dynamic pxRestApiSetZusatzfeldWert(dynamic zusatzFelder, string spaltenName, string wert)
bool pxRestApiGutscheinPDF(string gutscheinNr, string pdfPath, string listForPDF)
Abruf eines Wertes über PX Rest Apistring pxRestApiExecuteScalar(string fields, string entity, string filter, string sort, ref string error)
string error = "";
string fields = "Name";
string entity = "ADR/Adresse";
string filter = "AdressNr == 10457";
string sort = "";
string resultScalar = Intern.pxRestApiExecuteScalar(fields, entity, filter, sort, ref error);
int pxRestApiExecuteCount(string fields, string entity, string filter, ref string error)
string error = "";
string fields = "Adresse";
string entity = "ADR/Zahlungsart";
string filter = "Adresse == " + adressNr + " UND HauptZahlungsart == true UND ZahlungsartTyp == 'K'";
int resultCount = Intern.pxRestApiExecuteCount(fields, entity, filter, ref error);
DataTable pxRestApiExecuteDataTable(string fields, string entity, string filter, string sort, ref string error)
string error = "";
string fields = "AdressNr, Name, Vorname, Ort";
string entity = "ADR/Adresse";
string filter = "AdressNr <= 30";
string sort = "";
DataTable resultDataTable = Intern.pxRestApiExecuteDataTable(fields, entity, filter, sort, ref error);
bool pxRestApiExecuteNonQuery(string httpMethode, string request, string payload, ref string error)
string error = "";
string methode = "POST";
string request = "ADR/Zahlungsart";
string payload = "{" +
"\"Adresse\": {" +
"\"AdressNr\": " + adressNr + "" +
"}," +
"\"BankBelegNummer\": 0," +
"\"Bank\": null, " +
"\"Beguenstigter\": null, " +
"\"BelastenVon\": null, " +
"\"EigeneZahlungsart\": false, " +
"\"FormCode\": null, " +
"\"HauptZahlungsart\": true, " +
"\"ZahlArt\": -1, " +
"\"ZahlungsartTyp\": \"K\" " +
"}";
bool result = Intern.pxRestApiExecuteNonQuery(methode, request, payload, ref error);
bool pxRestApiExecuteNonQuery(string httpMethode, string request, object payload, ref string error)
string error = "";
string methode = "PATCH";
string request = "ADR/Adresse/6";
Adresse adresse = new Adresse();
adresse.Adresszeile1 = "Mein test";
adresse.Zusatzfelder = new Newtonsoft.Json.Linq.JObject();
adresse.Zusatzfelder = Intern.pxRestApiSetZusatzfeldWert(adresse.Zusatzfelder, "Z_DebRab_Back", "001122");
adresse.Zusatzfelder = Intern.pxRestApiSetZusatzfeldWert(adresse.Zusatzfelder, "Z_N_K_Sprachcode", "Test STH 01923");
bool result = Intern.pxRestApiExecuteNonQuery(methode, request, adresse, ref error);
public class Adresse
{
public string Adresszeile1 { get; set; }
public dynamic Zusatzfelder { get; set; }
}
string pxRestApiExecuteRawMode(string fields, string entity, string filter, string sort, string depth, string limit, ref string error, bool withoutWATOResult = false)
string error = "";
string fields = "*";
string entity = "ADR/Adresse";
string filter = "AdressNr == 130420";
string sort = "";
string depth = "0";
string limit = "50";
string resultJson = Intern.pxRestApiExecuteRawMode(fields, entity, filter, sort, depth, limit, ref error);
- Response-Payload: Globals.Var.PxRestApiResponse
- ID der angelegten Ressource: Globals.Var.PxRestApiObjectId
- URL der angelegten Ressource: Globals.Var.PxRestApiLocation
Methoden über PX Rest Api Erweiterung mit SQL Statements
List<T> pxRestApiExecuteQuery<T>(string sql)
string pxRestApiExecuteScalar(string sql)
bool pxRestApiExecuteNonQuery(string sql)