As Vanya wrote earlier, you can you use Update document service from menu or
use this job:
static void GenerateParmExist(Args _args)
{
AfDataContainerClassGenerator AfDataContainerClassGenerator = new
AfDataContainerClassGenerator();
Dialog dialog;
DialogField dialogClassName;
AfStronglyTypedDataContainer dataContainer;
AfDataContainerDescriptor dataContainerDescriptor;
SysDictClass dictClass;
str className;
;
dialog = new Dialog("Create parm and exists methods");
dialogClassName = dialog.addField(typeid(ClassName), "Class name");
dialog.run();
if (dialog.closedOk())
{
className = dialogClassName.value();
dictClass = new dictClass(className2Id(className));
dataContainer = dictClass.makeObject();
dataContainerDescriptor = dataContainer.wt().get_Descriptor();
AfDataContainerClassGenerator.parmDataContainerType(dataContainerDescriptor.get_Type());
AfDataContainerClassGenerator.parmDataContainerTypeMacroLibName(dataContainerDescriptor.get_DataSourceName());
AfDataContainerClassGenerator.parmClassName(className);
AfDataContainerClassGenerator.parmBaseClassName(className);
AfDataContainerClassGenerator.generate();
}
}
Also you have to comment to lines of
ClassesAfDataContainerClassGenerator->addCustomCode:
protected void addCustomCode()
{
// this.addDataContainerTypeMacro();
// this.addNewMethod();
this.addDataItemMethods();
}
Next step is to include this automatic BP error fix to BP check routine.
Mykola
Post by Huzaifa Gainthanks , but after getting rid of this best practice error i am stuck wuth
"Data object class CustFreeTextInvoice_CustInvoiceLine is missing method
existsAmountDetails." is there any class to remove this error too
Post by Mykola GalakIt is not really good idea to turn off BP verification for AIF. Even if you
are not using AIF now. Probably in the future one will need this
functionality or customer will use BP verification as solution acceptance
criteria.
In case you are 100% sure that you will never use AIF it is better to
include additional rules to SysBPCheckIgnore macro instead of turning off BP
verification.
Mykola
Post by unknownYou can remove the best practice error either by generating these methods
(see Mykola's code for this OR do it from the Tools\Development
Tools\Application Integration Framework\Update document service)
the other option is to turn off this validation, if you are not using Axd
documents and AIF in your installation.
You can do that from the Best Practice Parameters (open them from
Tools\Options\Best Practices).
Simply remove the check-mark from the Application Integration Framework node
or the sub-node (this is actually what triggers this validation). It has a
description of what the check does, by the way
--
Kashperuk Ivan (Vanya), SDET, Inventory management, Microsoft Dynamics AX
My blog - http://kashperuk.blogspot.com
Download MorphX IT in Russian - http://www.lulu.com/content/723888
Post by Huzaifa GainAX is throwing me this best pratice error , I dont know how to fix it.
The Table.Field does not have a corresponding parm-method on the AxBC-class