Empower Help

Search:

Display Legacy Contents

IndexBookmarkPrint

Home > Materials > Advanced Topics > Import Export Data > Empower API > Using The API To Post Data > Materials

Materials


1. Materials  can be created or modified through the API using the function calls


CreateOrModifyMaterial(material As MaterialData)


This function takes a single argument of data type MaterialData and returns the Material Name if created with a success message.


The following data types and whether they are mandatory or not are used


MaterialData

MaterialName As String (Mandatory)
MaterialGroup As String (Mandatory)
MaterialUnitOfMeasure As String (Mandatory)
MaterialStatus As String (Mandatory)
MaterialCode As String (Mandatory)

As a result the request body should be based on the following

<soapenv:Body>
      <web:CreateOrModifyMaterial>
         <web:material>
            <web:MaterialName>MATERIAL NAME</web:MaterialName>
            <web:MaterialGroup>MATERIAL GROUP NAME</web:MaterialGroup>
            <web:MaterialUnitOfMeasure>MATERIAL UNIT OF MEASURE</web:MaterialUnitOfMeasure>
            <web:MaterialStatus>MATERIAL STATUS - Current</web:MaterialStatus>
            <web:MaterialCode>MATERIAL CODE</web:MaterialCode>
         </web:material>
      </web:CreateOrModifyMaterial>
   </soapenv:Body>


2. Provide Material for a Job


A Material can be provided to a Job through the API using the function call

ProvideMaterialForJob(BomData As NewBom)

The following data types are used

BomData

JobOurReference (mandatory)
MaterialName (mandatory)
MaterialCode (non mandatory)
MaterialUnitOfMeasure (non mandatory)
MatQtyToProvide (mandatory)
MatQtyToReceive (non mandatory)
MatQtyToOrder (non mandatory)

   
As a result the request body should be based on the following

<soapenv:Body>

      <web:ProvideMaterialForJob>

         <web:bom>

            <web:JobOurReference>JOB OUR REFERENCE</web:JobOurReference>

            <web:MaterialName>MATERIAL NAME</web:MaterialName>

            <web:MaterialCode>MATERIAL CODE</web:MaterialCode>

            <web:MaterialUnitOfMeasure>UNIT OF MEASURE</web:MaterialUnitOfMeasure>

            <web:MatQtyToProvide>QUANTITY TO PROVIDE</web:MatQtyToProvide>

            <web:MatQtyToReceive>QUANTITY TO RECEIVE</web:MatQtyToReceive>

            <web:MatQtyToOrder>QUANTITY TO ORDER</web:MatQtyToOrder>

         </web:bom>

      </web:ProvideMaterialForJob>

   </soapenv:Body>


The following example may aid in understanding

<soapenv:Body>

      <web:ProvideMaterialForJob>

         <web:bom>

            <web:JobOurReference>Job1234</web:JobOurReference>

            <web:MaterialName>Liquid Laminate</web:MaterialName>

            <web:MaterialCode>12345</web:MaterialCode>

            <web:MaterialUnitOfMeasure>Each</web:MaterialUnitOfMeasure>

            <web:MatQtyToProvide>10</web:MatQtyToProvide>

            <web:MatQtyToReceive>5</web:MatQtyToReceive>

            <web:MatQtyToOrder>2</web:MatQtyToOrder>

         </web:bom>

      </web:ProvideMaterialForJob>

   </soapenv:Body>





For more information see

Example Code
WDSL Schema



 

See also

Setting Up Materials



 



 



See also