V3_Production_AddProdPostExecByName (Post)
- Last UpdatedNov 06, 2025
- 3 minute read
| Post | V3_Production_AddProdPostExecByName |
Resource Path:/api/v3/Production/PostExec
| Name | Description |
|---|---|
| trans_id | Used to supply the ID of the transaction if the call is taking part in a transaction. |
The request body is of type Mes.WebApi.Models.V3.Prod.Production.
Required. The identifying properties for the job and the updated property information for the item production.
The response body is of type Mes.WebApi.Models.V3.Prod.Production.
OKThe following Production model properties are required.
- To identify the entity where the job is running: ent_name and, if using sites, site_name.
- To identify the job: wo_id, oper_id, and seq_no.
- To specify the production count: qty_prod.
- To specify when the production occurred: created_at_utc.
When an Existing Record Is Updated or a New Record Is Added
The Production model includes a set of properties that can act as effective primary keys to identify an existing production record in the database. These effective primary key properties are:
- The shift start time, based on the created_at_utc value supplied.
- wo_id (cannot be null)
- oper_id (cannot be null)
- seq_no (cannot be null)
- item_id (cannot be null)
- lot_no (can be null, but the existing record’s value must also be null)
- sublot_no (can be null, but the existing record’s value must also be null)
- reas_cd (cannot be null)
- user_id (cannot be null)
- to_ent_id (can be null, but the existing record’s value must also be null)
- event_id (can be null, but the existing record’s value must also be null)
- genealogy_id (can be null, but the existing record’s value must also be null)
- segment_requirement_id (can be null, but the existing record’s value must also be null)
- segment_response_id (can be null, but the existing record’s value must also be null)
Whether an existing record in the Item_Prod table is updated or a new record is added is determined as follows:
- If a record already exists for the effective primary key values supplied (or defaulted), then the quantity provided by this endpoint will be added to the existing record in the Item_Prods table. In this case, the other non-defaulted dependent parameters (to_ent_name, etc.) for the entire record (i.e., including previous quantities) will be changed to those specified by this call.
- If a record with the supplied effective primary key values does not exist, or the Maintain distinct good production records or Maintain distinct reject production records system attribute (attr_id = 362 and 309, respectively) is true, then a new record is created.
Other Behaviors
Other behaviors of this method include the following:
- When determining the job record to use, the job start time that immediately precedes the created_at_utc time will be used and the associated shift information will be retrieved.
- If the specified job is not found to be running during the provided time, an error is returned.
- If any of the lot, container, reason code, or entity values change, then these changes are written to the Job_Bom table and used as the defaults for future transactions where the defaults are to be applied.
- If the update_inv flag is set for this produced item in the Job_Bom table, then the qty_left field in the Item_Inv table will be increased by the produced qty_prod.
- If the backflush flag is set for any of the BOM items in the Job_Bom table for this job, then a consumption transaction will be generated to consume the materials at standard rates. Similarly, if the update_inv flag is set for any of these BOM items, then inventory adjustment transactions will also be applied automatically.