Posts

Showing posts from March, 2023

generate Auto Number seq while import in Data entity

 Today we have a requirement to generate the number seq automatically while import To acieve this requirement follow the below steps 1) make the nonmadatory on data entity as well staging table filed which you want to auto-generate  2) Write a piece of code on the data entity   public void initValue()     {         if (!this.skipNumberSequenceCheck())         {             NumberSeqRecordFieldHandler::enableNumberSequenceControlForField(                 this, fieldNum(IHSEntAssetMaintenanceWorkOrderTableEntity, WorkOrderID), EntAssetParameters::numRefWorkOrderId());         }                  super();     } =============================================================== Please note If the standard entity have the mandatory  true we cannot change it but we can make the du...

Custom service with mutli line Create a work order with multi line

 To day we have a requirement to create a API (Custom Service) that helps to create a multi-line and accept the parameter  for that below are the approcess we have taken we have condiser the list also  1) create a  header contract class 2) Create a line contract class 3) create a line response class 4) Create a service class 5) Create a response class  6) test class to test the custom service  ==================================================================== 1) Create a header class /// <summary> /// Data contract for Related Work order header /// </summary> [DataContract] Final class IHSRelatedWorkOrderHeaderContract {     EntAssetWorkOrderID     workOrderID;     EntAssetWorkOrderTypeID workOrderType;     Description             workOrderDescription;     EntAssetServiceLevel    workOrderServiceLevel;     EntAssetExpectedStart  ...

Custom service with multi-level JSON request/response

Using data contracts it is possible to build an arbitraty structure of input arguments and return values. For example, we need to update in one request several records and receive a detailed response about success of an operation for each record. As an input we will receive a list of record identifiers with parameters to be changed as an output user can receive a list of operation results for each record. Following steps need to be performed: Create data contracts for input and output and build a needed tree. Create a custom service. Add service to a service group. Build module. Run a request with a RESTful services tool (Postman.) As an example we will take a sales order with sales order lines. Confirmed shupping date and quantity should be updated on each line. Input contract: /// <summary> /// Data contract for sales order Line /// </summary> [DataContract] class ruaSalesOrderLineContract { InventTransId inventTransId; SalesQty ...