Manuais
PHC GO Fetch Records of an entity
 

Method


The method to be called is:



Parameters


In the request headers the Authorization header must have the Access Token:

  • Authorization: {{accessToken}}


JSON body


In the body of the POST a JSON structure like this one has to be passed:

{
"entity": "entityName",
"filterItem": "filterName",
"valueItem": "filterValue"
}

 

Return Information


Any call made to this method will return a JSON information with this structure:

  1. If the option value is “0”:


    Returns a JSON with an Array of entity objects of the entity requested saved in PHC GO

  2. In case of error:


    {
    "code": 100,
    "message": "Error message"
    }


 

JSON Specification for fetch records of a given entity



NameTypeObservations
entityStringRequired, must me the table name of entity for example: Cl, Ft, Re, etc

If the request is an addon table, must be passed like this: uXXXX_table_name.
filterItemStringFilter Name
valueItemStringFilter Value

Practical Example



Existing client:

fetchRecords

{
"entity": "CL",
"filterItem": "no"
"valueItem": "2"
}

saveInstance

[
{
"nome": "Albertino Maciel",
"no": 2,
"estab": 0,
"ncont": "146016378",
"morada": "Rua Capitães de Abril,A-dos-Bispos",
"local": "Vila Franca de Xira",
"esaldo": 849240.93,
"nome2": "Albertino M.",
"vendnm": "Sara Sofia Ramos",
"refInt": "Lisboa",
"clstamp": "6b5-4c9e-b77b-f96932e1dd1",
"pncont": "PT",
"vendedor": 1,
"telefone": "263125451",
"tlmvl": "968562365",
"fax": "",
"email": "amaciel@email.pt",
"url": "",
"clivd": false,
"obs": "ALTERA",
"obsdoc": "",
"tipo": "Cliente Final",
"ccusto": "",
"zona": "Centro",
"tipoidentificacao": "BI",
"segmento": "Médio",
"tpstamp": "z202101041505056010072479",
"tpdesc": "2% a pronto para clientes",
"isperson": false,
"bino": "10789562",
"bidata": "2010-10-01T00:00:00Z",
"bilocal": "Lisboa",
"naturalid": "Lisboa",
"nascimento": "1985-07-12T00:00:00Z",
"eplafond": 0,
"desconto": 0,
"descpp": 0,
"tipodesc": "",
"swift": "",
"iban": "",
"nib": "",
"vencimento": 0,
"alimite": 90,
"preco": 1,
"preconame": "Preço de Venda 1",
"autofact": false,
"diames": "",
"mesesnaopag": "",
"autorizacaoactiva": false,
"numAutorizacaoSDD": "",
"numSeqAut": 0,
"allowADC": false,
"conta": "",
"contach": "",
"radicaltipoemp": 1,
"radicaltipoempname": "Gerais",
"cliref": "",
"nocredit": false,
"naoencomenda": false,
"canConnectElectroComm": 0,
"moeda": "EUR",
"inactivo": false,
"publicEntity": false,
"cfuncao1": "Comercial",
"cfuncao2": "",
"cnome1": "Sr. Albertino",
"cnome2": "",
"cemail1": "",
"cemail2": "",
"ctelefone1": "",
"ctelefone2": "",
"imagestamp": "",
"idiom": "Jamaicano",
"gln": "",
"portalAccessDenied": false,
"morada2": "",
"codpost": "2600-011",
"paisesstamp": "185",
"pais": "Portugal",
"provincia": "",
"municipio": "",
"tabiva": 2,
"miseimpstamp": "",
"labelField": "PT Normal - 23,00%",
"taxa": 23,
"codmotiseimp": null,
"motiseimp": null,
"fullmotiseimp": "",
"regrecargo": false,
"sujirs": false,
"codcativastamp": "",
"cativataxname": "",
"cativandoctax": 0,
"cativataxstamp": "z202312271242414130093330",
"situacaoNumADC": "",
"hasValidIBAN": false,
"hasValidBIC": false,
"usadadosclienteoufornecedor": false,
"codpais": "PT",
"clLabelField": "Albertino Maciel",
"customerid": "2/146016378",
"ishashtagallowed": true,
"hashtaglinear": "",
"SelectEntityDimension": "",
"isdimensionallowed": true,
"hashtags": [],
"entitydimensions": [],
"IsParcialLoad": false,
"addonOwner": "",
"ousrinis": "admin",
"ousrdata": "2022-04-29T00:00:00Z",
"ousrhora": "15:59:09",
"usrinis": "admin",
"usrdata": "2023-12-21T00:00:00Z",
"usrhora": "15:05:15",
"syshist": false,
"logInfo": "Albertino Maciel - 2 - 0 - 146016378",
"Operation": 2,
"revisionNumber": 118
}
]



sticky_note_2Notas

The ItemVO is the copy of the ItemVO obtained from fetchRecords. We only change the desired data, in this case only the OBS field. In JSON, a tag (operation) is passed at the end indicating what type of operation will be performed, in this case how 2 will be used to update the record.

  1. Insert Record
  2. Update Record
  3. Delete Record