Even though AX 2012 uses the Microsoft Solver Foundation which is not directly accessible to a developer, all data is stored within AX and can be worked with at will. See the follow overview of the data structure:
Note that most of the data is global, just the PCTemplateComponent table has company specific entries; the table is used for templates – as the name suggests – but also for the item references eg. for Configurator BOM lines.
Simple code snippet to add a document attachment to a record:
static void addDoc( Common common,
if(common && docuTypeId)
docuRef.TypeId = docuTypeId;
docuRef.Name = filename;
docuRef.RefRecId = common.RecId;
docuRef.RefTableId = common.TableId;
docuRef.RefCompanyId = curext();
docuRef.ValueRecId = docuValue.RecId;
DocuValue::writeDocuValue(docuRef,filename); //after ttsCommit to enable catching of file system errors
Simple example for creating a record with systems fields set by code:
protected static server CaseLog createCaseLog(RefRecId _caseDatail, CreatedBy _createdBy, CreatedDateTime _createdDateTime)
if(_createdBy && _caseDatail)
caseLog.CaseRecId = _caseDatail;
caseLog.(fieldNum(CaseLog,CreatedBy)) = _createdBy;
caseLog.(fieldNum(CaseLog,CreatedDateTime)) = _createdDateTime;
The constraint based configuration is saved in relation to the configuration-number (InventDim.ConfigId), however all you see in the On-Hand form is the number.
If you want to see the full configuration that was entered by the user, you can add a simple button to the On-hand form (InventOnhandItem) and override the clicked() method with the following code:
tmpProdTable.InventDimId = InventDim::findOrCreate(inventDim).InventDimId;
tmpProdTable.ItemId = InventSum.ItemId;
executeVariantConfiguration = PCExecuteVariantConfiguration::execute(tmpProdTable, InventSum.ItemId, inventDim.ConfigId);
Open configuration from the on-hand form
Have you ever wondered what the difference is between “No” and “Never” in the “On Hold” options of the Vendor?
The is only one Difference: The “Vendor inactivation” function will ignore vendor marked with “Never”.
Procurement and sourcing>>Periodic>>Vendors>>Vendor inactivation
Starting off with this blog, I had my own ideas how to add the hidden fields to the table browser with a significantly lower development footprint: Private Project_Table Browser_2012.xpo
One hidden field:
Multiple hidden fields:
I found this blog post Comparison Framework Sample: BOM Version comparer.
Mkz creted a BOM version comparer based on the comparison framework tutorial allowing you to see the line by line differences between BOM versions. I made a quick upgrade to AX 2012 and it now compiles without best practice errors.