| Santosh.'s profileDynamics AxPhotosBlogLists | Help |
|
September 18 Talking about Adding extra elements to XML string in AIFHi, I recently found a very good article from Sumit Loya's Blog on AxD "How extra elements can be added to the XML string in AIF".
Thanks a lot Sumit for this wonderful article Quote Adding extra elements to XML string in AIF September 11 How to perform Inbound & Outbound without AIF setup
Hi......For sending/receiving any XML the Dynamics AIF Framework is used. There is an alternate way of doing the same operation without AIF setup. Please find the below examples for all the actions.
Example: Read static void VendorOutbound(Args _args) { AxdVendTable axdVendTable; AifEntityKey entityKey = new AifEntityKey(); AifPropertyBag aifPropertyBag; VendTable vendTable; XmlDocument xmlDocument = new XmlDocument(); ;
select firstonly vendTable; entityKey.parmKeyDataMap(SysDictTable::getKeyData(vendTable)); axdVendTable = AxdBase::newClassId(classnum(AxdVendTable)); xmlDocument.loadXml(axdVendTable.read(entityKey, null, new AifEndpointActionPolicyInfo(), new AifConstraintList(), aifPropertyBag)); xmlDocument.save('c:\\AxdServiceOrder_Out1.xml'); }
Example: Create static void createInboundProjectHourJournal(Args _args) {
AxdProjectHourJournal axdProjetcHourJournal; XmlDocument xmlDocument; AifEndPointActionPolicyInfo endPointAction = new AifEndPointActionPolicyInfo(); AifConstraintList aifConstraint = new AifConstraintList(); AifDocumentXml xmlDoc; ;
xmlDocument = new xmlDocument(); xmlDocument.load("c:\\ProjectHourCreate.xml"); axdProjetcHourJournal = AxdBase::newClassId(ClassNum(AxdProjectHourJournal)); xmlDoc = xmlDocument.toString(); axdProjetcHourJournal.create(xmlDoc, endPointAction, aifConstraint); }
Example: CreateList static void createListInboundServiceOrder_Item(Args _args) {
AxdServiceOrder axdServiceOrder; XmlDocument xmlDocument; AifEndPointActionPolicyInfo endPointAction = new AifEndPointActionPolicyInfo(); AifConstraintListCollection aifConstraint = new AifConstraintListCollection(); AifDocumentXml xmlDoc; ;
xmlDocument = new xmlDocument(); xmlDocument.load("c:\\AxdServiceOrderCreate.xml"); axdServiceOrder = AxdBase::newClassId(ClassNum(AxdServiceOrder)); xmlDoc = xmlDocument.toString(); axdServiceOrder.createlist(xmlDoc, endPointAction, aifConstraint); }
Example: Update
static void updateInboundServiceOrder_Item(Args _args) {
AxdServiceOrder axdServiceOrder; XmlDocument xmlDocument; AifEndPointActionPolicyInfo endPointAction = new AifEndPointActionPolicyInfo(); AifConstraintListCollection aifConstraintC = new AifConstraintListCollection(); AifConstraintList aifConstraint = new AifConstraintList(); AifDocumentXml xmlDoc; AifEntityKey entityKey; ;
xmlDocument = new xmlDocument(); xmlDocument.load("c:\\axdServiceOrderInventDim.xml"); axdServiceOrder = AxdBase::newClassId(ClassNum(AxdServiceOrder)); xmlDoc = xmlDocument.toString(); axdServiceOrder.update(entityKey, xmlDoc, endPointAction, aifConstraint); }
Example: Delete
static void deleteServiceOrder(Args _args) { AxdServiceOrder axdServiceOrder; AifEntityKey entityKey = new AifEntityKey(); AifEntityKeyList entityKeyList = new AifEntityKeyList(); AifPropertyBag aifPropertyBag; SMAServiceOrderTable sMAServiceOrderTable; XmlDocument xmlDocument = new XmlDocument(); ;
select firstonly sMAServiceOrderTable where sMAServiceOrderTable.ServiceOrderId == '0000083_SO'; entityKey.parmKeyDataMap(SysDictTable::getKeyData(sMAServiceOrderTable)); axdServiceOrder = AxdBase::newClassId(classnum(axdServiceOrder)); entityKeyList.addEntityKey(entityKey); axdServiceOrder.deleteList(entityKeyList , new AifEndpointActionPolicyInfo(), new AifConstraintListCollection()); }
Hope this piece of information was useful...
September 05 AIF Error: The parameter schema could not be found for EndpointId
The above error message will be observed in Queue Manager whenever an outbound action is performed. [Pre-requisites: AIF is configured properly for a File System Adapter]
The above error message is because is “Data policies is not configure for the specified action/service in the Endpoint Action Policies form. So once Action policy is configure for an outbound service make sure that at least once you click Data policies so that particular ClassName, Document Name & Action gets updated in “AifEndpointActionParameterSchema” form(As shown below) . Now try performing an outbound action and this time you will not observed the error J J J September 02 AIF Tit bits
v v v v |
|
|