thumb_up
thumb_down
link
Copy link
Copied
insert_emoticon
lmatfy
Copied

Syntax of fields in the UpdateConnector

The fields you deliver in the XML must meet various conditions. Several information sources are available for completing the UpdateConnector. The main information source is the XSD schema. The XSD schema determines:

  • The format of the XML that you need to deliver.
  • The field properties of each field, such as field type, maximum length, mandatory or optional, etc.

In Profit, extra validations typically apply. These are checks that were not included in the XSD schema. These are the validations that are also run if you add data manually. These checks are not in the XSD schema, but if an UpdateConnector adds, changes or deletes data, then these checks are in fact performed.

Example:

Field: date of birth.

In the XSD schema, you only see that you must provide a date.

In Profit, however, an extra check applies: a date of birth must always be in the past. We recommend that you first test operations in Profit. This gives you a clear picture of the functionality and the checks.

Contents

Syntax of fields

The section below describes various field types. Any value you provide must be valid for the field type. A date, for example, always has a fixed format. Codes can have a maximum length.

Mandatory and optional fields

All mandatory fields are indicated with an exclamation point.

These fields are mandatory when you run an INSERT (add a new record). Many UpdateConnectors can also be used to change data, in which case only key fields (codes or numbers) are mandatory.

References to other tables (foreign keys)

In Profit, you must select a value from a table for certain fields. You cannot enter values that are not in the table. This also applies in the UpdateConnector: if you provide an illegal value when you run an UpdateConnector, an error message appears.

The reference to the table is after the field. Look in Profit to see the allowed values, for example by adding a new record to a test environment manually. Naturally, it is important to create a new test environment regularly so you can test with current data.

Reference: Verwijzing naar: Profit field <table> => table name

In this example the 'EmId (Medewerker)' field refers to the 'AfasKnEmployee' table. The code that you provide in this field must occur in Profit. The code has a maximum length of 15 characters.

App_Con_Local_Upd_XSD_View.png

Note:

In certain tables, the records have both an internal and an external code. The external code is the code that you use in Profit and is also the code that you must deliver using the UpdateConnector. The internal code is used in the database and is generally not relevant for the use of Profit or the UpdateConnector. In cases of exceptions, this is noted.

Allowed field values

For some fields, the allowed values are indicated. Other values are not allowed.

Reference: Toegestane veldwaarden

The example below comes from a different UpdateConnector, not from 'HrAbsence'.

App_Con_Local_Upd_XSD_View.png

Field type 'Boolean' (Yes/No field)

Allowed values:

  • 1 (Yes/selected/true)
  • 0 (No/not selected/false)

    App_Conn GS UpdateConnector uitvoeren via WebServices - XML

Field type 'String' (Text)

These fields are for names, descriptions, etc. A maximum field length may apply.

App_Conn GS UpdateConnector uitvoeren via WebServices - XML

Field type 'Date' (Date)

Required syntax: yyyy-mm-dd.

Example:

Date: 3 April 2017

Syntax in the XML: 2017-04-03

Field type 'DateTime' (Date and time)

Fields for a date and time, such as the start and end dates of a leave entry.

App_Conn GS UpdateConnector uitvoeren via WebServices - XML

Required syntax: yyyy-mm-ddThh:mm:ss

Example:

Date: 22-10-2017; time 13:40

Syntax in the XML: 2017-10-22T13:40:00

Field type: Time

Required syntax: hh:mm:ss

Example:

Time: half past nine (AM).

Syntax in the XML: 09:30:00

Amounts, quantities, numbers, etc.

Be mindful of the maximum length and check whether decimals are allowed. Special conditions may apply to counters, auto numbering, etc. Certain codes may consist of, for instance, a combination of letters and numbers.

Clear a field

Ensure that the fields in the XML are delivered in the same order as indicated in the definitions.

Set fields to zero or clear them

You can never clear a field or set a field to zero by supplying an empty field in the XML. That is because if a field is empty, the UpdateConnector will not update the field at all.

  • Numerical fields

    You can set a numerical field to zero by delivering the value 0 in the XML.

    Example:

    <PrFc>0</PrFc>

You can only do this for fields which are allowed to have the value zero. They are numerical fields which are not mandatory, but if you complete them, then the value delivered must fall within a particular range. For these fields, you can clear the fields (using the method below for strings) or deliver an allowed value.

  • Strings

    Use the following method to clear a string field (such as a description). You can only clear optional fields.

    xsi:nil="true"

    Example:

    <PrVn xsi:nil="true"/>

    <PrVn xsi:nil="true"></PrVn>

  • Yes/No fields

    These fields (in the interface, these are check boxes) always have a value. You cannot clear them. If you do not deliver this value, Profit assigns the preferred value. The preferred value can vary according to the field.

Reserved characters

Take reserved characters into account in the XML. The main ones are given below.

Note:

This topic is only intended for XML. For JSON, view this topic.

Character

Provide as

<

&lt;

>

&gt;

&

&amp;

'

&apos;

"

&quot;

You can use the following codes to format the contents of a string:

Character

Provide as

newline

&#10;

carriage return

&#13;

Upper-case letters with accents (diacritical marks):

Character

Provide as

À

&#192;

Á

&#193;

Ä

&#196;

Ç

&#199;

È

&#200;

É

&#201;

Ê

&#202;

Ë

&#203;

Ï

&#207;

Ö

&#214;

Ü

&#220;

Lower-case letters with accents (diacritical marks):

Character

Provide as

à

&#224;

á

&#225;

ä

&#228;

ç

&#231;

è

&#232;

é

&#233;

ê

&#234;

ë

&#235;

ï

&#239;

ö

&#246;

ü

&#252;

Return code when using INSERT

When creating a new data element using the below UpdateConnectors, the response includes the code of the new data.

Name

Connector

Fields

Applicants

HrApplicant

Applicant (EmId)

Applicants SSS

HrCreateApplicant

This UpdateConnector will deliver a response, but the number isn't correct.

Article

FbItemArticle

Item code (ItCd)

Cost estimate

KnQuotation

Cost estimate number

Counter/direct invoices

FbDirectInvoice

Invoice number (Liln)

Order number (OrNu)

Course event

KnCourseEvent

Event ID (Id)

Delivery notes

FbDeliveryNote

Delivery note number (OrNu)

Employee evaluations

HrJudgement

Employee (EmId)

Sequence number (JuSn)

Financial contracts

FiContract

Contract number (CoNu)

Contract sequence number (SeNo)

Dossier items

KnSubject

Dossier item number (SbId)

Employee parameters

HrVarVal

Parameter (VaId)

Sequence number (SeNo)

Employer Cost Carrier

HrCostCarrier

Employer (CmId)

Cost carrier (CcId)

Employer Cost Center

HrCostCentre

Employer (CmId)

Cost center (CrId)

Employer jobs

KnOrgEmrFun

Employer (CmId)

Job ID (FuId)

Expense claims

PtDeclaration

Claim number (DcCo)

Dossier item number (SbId)

The response only contains the dossier item numer if the claim goes into a workflow ( <ApprovWorkflow> contains the value 1)

Financial contract

FiContract

Contract number (CoNu)

Contract sequence number (SeNo)

Financial entries

FiEntries

Administration number (UnId)

Entry number (EnNo)

Invoice numer (InID)

Fixed assets (Profit 20)

FiFixedAssets

Asset code (SeNo)

Forecasts

CmForecast

Sequence number (SqNo)

Intercompany receipt on delivery slip

FbDelNoteReceived

Receipt number (OrNu)

Invoice terms (Profit 20)

FbInstalment

Project number (PrId)

Term number (Inst)

Illness

HrIllness

HrIllnessGUID

HrIllnessInSite

AbId (Identity)

When using HrIllnessGUID, the GUID will also be reported.

Leave corrections

HrAbsCorrection

Employee(EmId)

Line number (Id)

Leave entries

HrAbsence

Line number (Id)

Leave entries InSite

HrAbsenceInSite

Line number (Id)

Purchase quotations

FbPurchQuotation

Quotation number (OrNu)

Purchase contact

KnPurchaseRelationOrg

KnPurchaseRelationPer

 

Creditor number (CrId)

Creditor number (CrId)

Purchase orders

FbPurch

Order number (OrNu)

Obligations

FiCommitment

Administration number (UnId)

Obligation number (SeNo)

Organisations

KnOrganisation

Number (BcCo)

Organisation/person (internal) (BcId)

Persons

KnPerson

Number (BcCo)

Organisation/person (internal) (BcId)

Production orders

FbAssemblyPrep

Order number (OrNu)

Projects

PtProject

Project number (PrId)

Purchase relation (organisation)

KnPurchaseRelationOrg

Creditor number (CrId)

Organisation number

Purchase relation

(person)

KnPurchaseRelationPer

Creditor number (CrId)

Person number

Reservations

FiReservation

Administration number (UnId)

Reservation number (SeNo)

Sales contact

KnSalesRelationOrg

KnSalesRelationPer

Debtor number (DbId)

Debtor number (DbId)

Sales quotations

FbSalesQuotation

Quotation number (OrNu)

Sales order

FbSales

Order number (OrNu)

Sales relationship (organisation)

KnSalesRelationOrg

Debtor number (DbId)

Organisation number

Sales relationship (person)

KnSalesRelationPer

Debtor number (DbId)

Person number

Subscriptions

FbSubscription

Administration number (UnId)

SeNo

Social agency (Belgium)

HrTimeRegSocSec

Line number (Id)

Transferslips

FbWarTransferOut

Transferslip number (OrNu)

Wage entries

HrCompMut

Line number (Id)

Wage entries based on a GUID

HrCompMutGUID

Line number (Id)

Ware house move preparations

FbWarTransferPrep

Ware house move number (OrNu)

Example of a response with one code:

<?xml version="1.0"?>

<results><FbDirectInvoice><OrNu>70000183</OrNu></FbDirectInvoice></results>

Example of a response with multiple codes:

<?xml version="1.0"?>

<results><FbDeliveryNote><OrNu>70000156</OrNu></FbDeliveryNote></results>

<?xml version="1.0"?>

<results><FbDeliveryNote><OrNu>70000182</OrNu></FbDeliveryNote></results>

Directly to

  1. Build and test an UpdateConnector
  2. Get started in AFAS Online
  3. Syntax of fields in the UpdateConnector
  4. Deliver custom fields using the UpdateConnector
  5. Descriptions of UpdateConnectors

Process

Connectors

Work area

app