Rules for the XML file structure
Each XML file must be a well formed XML document; one that adheres to all the basic XML syntax rules. In addition, the rules for Optiva import files are shown in these examples.
See Conventions in XSD files to prepare for import.
- Start with the framework for all the data that is
being imported. Declare the XML file.
<?xml version = "1.0" encoding= "utf-8" ?> <fsxml> . . . </fsxml>
- Declare the
Optiva
object type.
- <fsxml> - <FSFORMULA KEYCOLUMNS = "formula_code;version" KEYS ="FS- 0021\0001;3512" . . </FSFORMULA> </fsxml>
- Add the header data within each object tag. This data
matches the fields in the
FsValidationField
table for the object. You do not have to import fields that do not have data.<?xml version = "1.0" encoding= "utf-8" ?> - <fsxml> `- <FSFORMULA KEYCOLUMNS = "formula_code;version" KEYS =FS- 0021\0001;3512" DETAILCODES="HEADER;INGR;ST;BYPROD;DOC;PER;STATUS;LINEEXP;ALTINGR;VIEWS ; DETAILTABLES="FSFORMULA;FSFORMULAINGR;FSFORMULAST;FSFORMULABYPROD;FS <FORMULA_CODE>FS-0021</FORMULA_CODE> <VERSION>0001</VERSION> <DESCRIPTION>PIZZA CHEESE MIX</DESCRIPTION> <UOM_CODE>KG</UOM_CODE> <ITEM_CODE>FS-0021</ITEM_CODE> <YIELD>100</YIELD> <YIELD_PCT>100</YIELD_PCT> <PHANTOM_IND>0</PHANTOM_IND> <FORMULA_ID>3512</FORMULA_ID> <DOC_ID>10552</DOC_ID> <PROCESS_YIELD>100</PROCESS_YIELD> <LAB_BOOK_CODE>012004</LAB_BOOK_CODE> <LAB_BOOK_PAGE>26</LAB_BOOK_PAGE> <OWNER_CODE>FSI</OWNER_CODE> <GROUP_CODE>ADMIN</GROUP_CODE> <OWNER_SECURITY>15</OWNER_SECURITY> <GROUP_SECURITY>7</GROUP_SECURITY> <ROLE_SECURITY>7</ROLE_SECURITY> <STATUS_IND>300</STATUS_IND> <FORMULATOR_CODE>FSI</FORMULATOR_CODE> <PARENT_ID>3511</PARENT_ID> <YIELDCALC_IND>1</YIELDCALC_IND> <ROLLUP_ID>274</ROLLUP_ID> <COMMENTTXT /> <MODIFY_DATE>2004-03-17T13:58:48.5670000-0:500</MODIFY_DATE>
- Add detail data. These detail tags are generally used:
-
<FSDOC>
(Attached Document) -
<FSEMBEDDEDOBJECTS>
(Embedded Objects) -
<FSobjectCONTEXT>
(Context Attribute) -
<FSobjectCUSTOM>
(Extension Fields) -
<FSFORMULAINGR>
(Formula Ingredient) -
<FSobjectMATRIX>
(Extension table) -
<FSobjectPER>
(Permission) -
<FSobjectREF>
(Reference) -
<FSobjectST>
(Set Membership) -
<FSobjectSTATUS>
(Status) -
<FSobjectTPALL>
(Parameters for formula, item, project)
-
Ingredient data
- <FSFORMULAINGR>
<FORMULA_ID>3512</FORMULA_ID>
<LINE_TYPE>0</LINE_TYPE>
<LINE_ID>1</LINE_ID>
<ITEM_CODE>01026</ITEM_CODE>
<QUANTITY>50</QUANTITY>
<UOM_CODE>KG</UOM_CODE>
<ITEM_FORMULA_ID>0</ITEM_FORMULA_ID>
<LINE_BREAK_CODE />
<MATERIAL_PCT>50</MATERIAL_PCT>
<SCALE_IND>0</SCALE_IND>
<SUBFORMULA_IND>0</SUBFORMULA_IND>
<SUBSTITUTE_IND>0</SUBSTITUTE_IND>
<RATIO_LOCK_IND>0</RATIO_LOCK_IND>
<ACTIVE_QUANTITY>0</ACTIVE_QUANTITY>
<RELQTY_PCT>0</RELQTY_PCT>
<DOC_ID>0</DOC_ID>
<SECTION_TYPE>0</SECTION_TYPE>
<ADJUST_IND>0</ADJUST_IND>
<DESCRIPTION>Cheese,mozzarella,whole milk</DESCRIPTION>
<COMPONENT_IND>8</COMPONENT_IND>
<QTY_MASS>50</QTY_MASS>
<QTY_VOL>49.950049950049959</QTY_VOL>
<INSTRUCTION />
<ALIAS_CODE1 />
<STATUS_LABEL>Approved Materials</STATUS_LABEL>
</FSFORMULAINGR>
Parameter data for type 0
and 1
- <FSFORMULATPALL>
<FORMULA_ID>3512</FORMULA_ID>
<LINE_TYPE>0</LINE_TYPE>
<LINE_ID>1</LINE_ID>
<CALC_LEVEL>2</CALC_LEVEL>
<PVALUE>1.001</PVALUE>
<PARAM_CODE>DENSITY</PARAM_CODE>
<FILTERS>;PARAM ROLLUP;PARAM_OTHER;</FILTERS>
<DESCRIPTION>Density</DESCRIPTION>
<UOM_CODE>KG/L</UOM_CODE>
<SRVROW_ID>1</SRVROW_ID>
<LINE_ID_PARAM_x0020_ROLLUP>1</LINE_ID_PARAM_x0020_ROLLUP>
<LINE_ID_PARAM_OTHER>4</LINE_ID_PARAM_OTHER>
<CALC_LEVEL_LABEL>Calculated</CALC_LEVEL_LABEL>
</FSFORMULATPALL>
- <FSFORMULATPALL>
<FORMULA_ID>3512</FORMULA_ID>
<LINE_TYPE>1</LINE_TYPE>
<LINE_ID>2</LINE_ID>
<CALC_LEVEL>0</CALC_LEVEL>
<PARAM_CODE>DAIRYRESTRICTION</PARAM_CODE>
<FILTERS>;PARAM INFO;PARAM_ALLERGENS;</FILTERS>
<DESCRIPTION>Dairy products prohibited?</DESCRIPTION>
<SRVROW_ID>2</SRVROW_ID>
<LINE_ID_PARAM_ALLERGENS>1</LINE_ID_PARAM_ALLERGENS>
<LINE_ID_PARAM_x0020_INFO>8</LINE_ID_PARAM_x0020_INFO>
<CALC_LEVEL_LABEL>Pending</CALC_LEVEL_LABEL>
</FSFORMULATPALL>
Extension field data.
- <FSFORMULA_CUSTOMATTRIB>
<FORMULA_ID>3512</FORMULA_ID>
<ATTRIB_CODE>C_WHEN</ATTRIB_CODE>
<ATTRIB_ORDER>1</ATTRIB_ORDER>
<ATTRIB_VAL>ANY MEAL</ATTRIB_VAL>
<ATTRIB_KEY>@DFLT</ATTRIB_KEY>
<SRVROW_ID>1</SRVROW_ID>
</FSFORMULA_CUSTOMATTRIB>
Set data
- <FSFORMULAST>
<SET_CODE>FOOD</SET_CODE>
<DESCRIPTION>Food Lab Data</DESCRIPTION>
<FORMULA_ID>3512</FORMULA_ID>
<SRVROW_ID>1</SRVROW_ID>
<SET_CODE_LABEL>Food Lab Data</SET_CODE_LABEL>
</FSFORMULAST>
Text notes for function codes
The expected table name for attached notes is FSDOC
.
When you export data, ensure that this table is not renamed for reports with
multiple objects.
- <FSDOC Keys="FS-0021\0001;3512"
<DOC_ID>5898</DOC_ID>
<FUNCTION_CODE>COMMENT</FUNCTION_CODE>
<TEXT_DATA>Store at room temperature</TEXT_DATA>
<ATTCH_CNT>0</ATTCH_CNT>
<ATTCH_TYPE>0</ATTCH_TYPE>
</FSDOC>
Embedded object data
The expected table name for embedded images is FSEMBEDDEDOBJECTS
. When you export data, ensure that this table is not
renamed for reports with multiple objects.
- <FSDOC Keys="FS-0021\0001;3512"
<DOC_ID>5898</DOC_ID>
<FUNCTION_CODE>FRONT</FUNCTION_CODE>
<TEXT_DATA />
<ATTCH_CNT>0</ATTCH_CNT>
<ATTCH_TYPE>0</ATTCH_TYPE>
<BLOB_ID>11002</BLOB_ID>
</FSDOC>
- <FSEMBEDDEDOBJECTS Keys="FS-0021\0001;3512"
<BLOB_ID>11002</BLOB_ID>
<FILE_NAME>pizza.jpg</FILE_NAME>
<DOC_ID>5898</DOC_ID>
<FUNCTION_CODE>FRONT</FUNCTION_CODE>
<THUMBNAIL>/9j/4AAQSkZJRgABAQEAwADAAAD/
2wBDAAgGBgcGBgcGBQgHBwcJCQgKDB
</FSEMBEDDEDOBJECTS>
Attached URLs
The expected table name for attached URLs is FS<SYMBOL>ATTACH
. No changes for table names is required before
you export URLs for multiple objects.
- - <FSFORMULAATTACH>
<DOC_ID>11002</DOC_ID>
<FUNCTION_CODE>CHANGES</FUNCTION_CODE>
<LINE_ID>2</LINE_ID>
<FILE_NAME>http://www.infor.com</FILE_NAME>
<LINK>http://www.infor.com</LINK>
<USER_CODE>FSI</USER_CODE>
<PUBLISH_IND>0</PUBLISH_IND>
<SRVROW_ID>2</SRVROW_ID>
<FUNCTION_CODE_LABEL>CHANGES</FUNCTION_CODE_LABEL>
</FSFORMULAATTACH>
Status data
To import status data, you must complete both of these tasks:
- Import
<STATUS_IND>
to the Status Detail table. Otherwise, the status does not change even if the import succeeds. - Specify the
<OBJECTSYMBOL>
element in<FSFORMULASTATUS>
. Otherwise, the import fails.
- <FSFORMULASTATUS>
<STATUS_IND>300</STATUS_IND>
<FORMULA_ID>3512</FORMULA_ID>
<OBJECTSYMBOL>FORMULA</OBJECTSYMBOL>
<CREATION_DATE>2004-01-26T13:18:06.2200000-05:00</CREATION_DATE>
<CREATED_BY>FSI</CREATED_BY>
<MODIFY_DATE>2004-03-17T13:58:48.5670000-05:00</MODIFY_DATE>
<MODIFY_BY>FSI</MODIFY_BY>
<SRVROW_ID>1</SRVROW_ID>
<STATUS_IND_LABEL>Approved Materials</STATUS_IND_LABEL>
<CREATED_BY_LABEL>Systems</CREATED_BY_LABEL>
</FSFORMULASTATUS>
Security data
- <FSFORMULAPER>
<GROUP_CODE>ADMIN</GROUP_CODE>
<OWNER_CODE>FSI</OWNER_CODE>
<GROUP_SECURITY>7</GROUP_SECURITY>
<OWNER_SECURITY>15</OWNER_SECURITY>
<ROLE_SECURITY>7</ROLE_SECURITY>
<FORMULA_ID>3512</FORMULA_ID>
<SRVROW_ID>1</SRVROW_ID>
<GROUP_CODE_LABEL>Administration Group</GROUP_CODE_LABEL>
<OWNER_CODE_LABEL>Systems</OWNER_CODE_LABEL>
<GROUP_SECURITY_LABEL>Read/Copy/Write</GROUP_SECURITY_LABEL>
<OWNER_SECURITY_LABEL>Read/Copy/Write/Delete</
OWNER_SECURITY_LABEL>
<ROLE_SECURITY_LABEL>Read/Copy/Write</ROLE_SECURITY_LABEL>
</FSFORMULAPER>
Reference data
- <FSFORMULAREF>
<R_OBJECT_TYPE>CUSTOMER</R_OBJECT_TYPE>
<R_OBJECT_KEY>INTERNAL</R_OBJECT_KEY>
<R_OBJECT_IND>0</R_OBJECT_IND>
<R_OBJECT_DESC>Internal Use of Product</R_OBJECT_DESC>
<OBJECT_TYPE>FORMULA</OBJECT_TYPE>
<OBJECT_KEY>3512</OBJECT_KEY>
<OBJECTCODE>INTERNAL</OBJECTCODE>
<FORMULA_ID>3512</FORMULA_ID>
<SRVROW_ID>1</SRVROW_ID>
</FSFORMULAREF>
Context data
- <FSFORMULACONTEXT>
<FORMULA_ID>3512</FORMULA_ID>
<ATTRIB_CODE>C_BRAND</ATTRIB_CODE>
<ATTRIB_VAL>NONE</ATTRIB_VAL>
<DESCRIPTION>No Brand Associated</DESCRIPTION>
<ATTRIB_ORDER>1</ATTRIB_ORDER>
<ATTRIB_KEY>@DFLT</ATTRIB_KEY>
<SRVROW_ID>1</SRVROW_ID>
<ATTRIB_CODE_LABEL>Brand</ATTRIB_CODE_LABEL>
<ATTRIB_VAL_LABEL>No Brand Associated</ATTRIB_VAL_LABEL>
</FSFORMULACONTEXT>
Extension table data (i.e.,data matrix)
- <FSDATAMATRIX Keys="FS-0021\0001;3512"
<TABLE_CODE>COLORS</TABLE_CODE>
<SYMBOL>FORMULA</SYMBOL>
<VIEW_ID>0</VIEW_ID>
<DESCRIPTION>colors</DESCRIPTION>
<ROW_ADD_IND>1</ROW_ADD_IND>
<LOGICAL_DELETE>0</LOGICAL_DELETE>
<OWNER_CODE>FSI</OWNER_CODE>
<GROUP_CODE>ADMIN</GROUP_CODE>
<OWNER_SECURITY>15</OWNER_SECURITY>
<GROUP_SECURITY>15</GROUP_SECURITY>
<ROLE_SECURITY>15</ROLE_SECURITY>
</FSDATAMATRIX>
- <FSFORMULAMATRIX_0 Keys="FS-0021\0001;3512"
<DM_OBJECT_TYPE>FORMULA0</DM_OBJECT_TYPE>
<FIELD1>red</FIELD1>
</FSFORMULAMATRIX_0>
- <FSFORMULAMATRIX_0 Keys="FS-0021\0001;3512"
<DM_OBJECT_TYPE>FORMULA0</DM_OBJECT_TYPE>
<FIELD1>blue</FIELD1>
</FSFORMULAMATRIX_0>