Create an account code - Intergraph Smart Materials - Help - Hexagon

Intergraph Smart Materials Web API Help (10.6)

ft:locale
en-US
Product
Intergraph Smart Materials
Subproduct
Web API
Search by Category
Help
Smart Materials/Smart Reference Data Version
10.6

This API creates the account code in the given project of Smart Materials. You can create account codes by using existing account code structure details or without it also.

Required Privilege: API_ACCOUNT_CODE

Headers

Header Name

Description

Required

Values

Authorization

Access token

Required

Bearer <access_token>

Content-Type

Request type format

Required

application/JSON

Body

POST https://{host}/Smat/V1/Projects(‘:project’)/Disciplines(‘:discipline’)/Nls(‘:language’)/AccountCodes

Specify the values for the project, discipline, and language in the URL. The project, discipline, and language together, define the project environment where the account code details are created.

Know about the importance of the element Fields 1 to 7 in Account Code

Mapping of columns

The structure type of an element determines whether and which field is mapped to which column based in Account Code Structure Details.
Column mapping occurs in ascending order (based on Order Seq) and structure type Separator is not considered.

  • Let us take an example here:


    "Field1": "ACC",

    "Field2": "CODES",

    "Field3": "AUTO",

    "Field4": "DUMMY1",

    "Field5": "DUMM2",

    "Field6": null,

    "Field7": null,

  • In this case, Field1 will get mapped with the First OrderSeq defined in Account Code Structure Details for which Structure Type can be Property, Node, ot Tag. Remember, it is not necessary that Order Seq should start with 1, it can start from 3 also, however from there ascending order is considered by the application.

  • In similar pattern, Field2 to Field7 will be mapped with the respective columns and type Separator will be ignored.

JobNumber generation


The Job number generation is based on data values assigned to the property of the structure type. In this case, we consider all the structure type.

  • Field1-Field7 are mandatory, if the OrderSeq with which they get mapped have field Required set to Yes.

  • The length of value in Field1-Field7 is determined based on the Length column defined in Account Code Structure Details.

    • If the length of the value is less than the defined Length and the fixed indicator is set, then the remaining length is padded with the filler character.

    • If the length of the value is more than the defined Length then the length of value will be truncated accordingly.

For Example:-

Structure

Fixed

Filler Character

Short Desc

Desc

NIK_TEST1

Yes

*

OrderSeq

Structure Type

Property

Hint Text

Node Type

Separator Text

Required

Length

3

Property

ABC

Yes

3

4

Separator

SEP

Yes

-

5

Node

DEF

Yes

4

6

Tag

GHI

Yes

3

  • In the above example, for mapping only OrderSeq 3, 5 and 6 will be be considered.So, first Field1 will be mapped to OrderSeq 3, Field2 to OrderSeq 5 and Field 3 to OrderSeq 6. Since only 3 OrderSeq are available for mapping, if the user provides any data to other fields it will be ignored.

  • As all the Structure details are set to Yes for Required, hence all Field 1-7 will be mandatory and fixed length will be applied. OrderSeq 5 value will be then taken by application as DEF*.

  • For job number, data associated with property is considered and all structure types will be considered. Now, consider, the following scenario:

    • Property Name as ABC has value as NAME, SEP will remain as separator text dont have any other associated data, DEF has value as 456789, and GHI has ORANGE. Then the job number will be "NAMSEP4567ORA".

Element

Description

Type

Required

Notes

JobNumber

Unique name of the account code within the login project.

  • This field is mandatory if, JobStructureCode is null.

  • If JobNumber is null, then based on JobStructureCode and Field1-7, JobNumber is auto-generated.

  • If both JobNumber and JobStructureCode are given then the JobNumber given by the user is considered.

String

Mandatory/Optional

Maximum allowed length is 70.

JobStructureCode

Unique name of the structure used for creating the account code.

This field is mandatory if JobNumber is null.

String

Mandatory/Optional

Maximum allowed length is 10

Field1-7

These fields defines the name of JobNumber, when JobNumber is not provided by user.

String

Mandatory/
Optional

Maximum allowed length is 100.

PlannedBudget

Refers to the planned budget that is given while creating the account code.

Integer

Optional

CurrencyCode

Unique name of the currency used for budget.

String

Mandatory

Maximum allowed length is 10.

ShortDesc

Short description of the account code.

String

Optional

Maximum allowed length is 20.

Description

Description of the account code

String

Optional

Maximum allowed length is 60.

Sample Body

POST https://{host}/Smat/V1/Projects('RS')/Disciplines('PIPING')/NLS('ENGLISH')/AccountCodes

{

"JobNumber": null,

"JobStructureCode": "NIK_TEST1",

"Field1": "ACC",

"Field2": "CODES",

"Field3": "AUTO",

"Field4": "DUMMY1",

"Field5": "DUMM2",

"Field6": null,

"Field7": null,

"PlannedBudget": 70,

"CurrencyCode": "€",

"ShortDesc": "Creating Account Code",

"Description": null

}

Success Response

Status Code: 201 Created

{

"@odata.context": "https://localhost:7101/smat/v1/$metadata#Projects('RS')/Disciplines('PIPING')/Nls('English')/AccountCodes/$entity",

"JobId": 10006850218,

"ProjId": "RS",

"JobNumber": "ACC**CODEASDEAUTO567",

"JobStructureCode": "NIK_TEST1",

"JsId": 10000001886,

"Field1": "ACC**",

"Field2": "CODE",

"Field3": "AUTO",

"Field4": null,

"Field5": null,

"Field6": null,

"Field7": null,

"RevisedBudget": 70,

"PlannedBudget": 70,

"UnitId": 500391,

"CurrencyCode": "€",

"ShortDesc": "Creating Account Code",

"Description": "Creating Account Code"

}

Element

Description

Type

JobId

Unique ID of the account code.

Integer

JsId

Unique ID of the account code structure details.

Integer

RevisedBudget

Refers to the revised budget having same value as Original Budget while creating the account code.

Integer

UnitId

Unique ID of the currency used for the budget.

Integer