Is it possible to run mforms automation from XtendM3 extensions?
You can create an IPS API (where you can do the same as 'MForms' would accomplish) and then call that from XTendM3.
Hi @Rene, can you share the XtendM3 code for calling an IPS API? Many thanks
It should be something like the below example:
//Call IPS API from XTendM3 private void callIPSAPI(){ double DTRQT = TRQT.toString().toDouble() int inTRQT = DTRQT as Integer logger.debug("Quantity is :"+inTRQT) def endpoint = "/M3/ips/service/MMS100_myIPSUpdate" def headers = ["Accept": "application/xml", "Content-Type": "application/xml"] def queryParameters = (Map)null def formParameters ='''<?xml version="1.0" encoding="UTF-8" standalone="no"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="">schemas.xmlsoap.org/.../" xmlns:add="">schemas.infor.com/.../AddROLine"xmlns:cred="">lawson.com/.../credentials"> <SOAP-ENV:Header> <cred:lws> </cred:lws> </SOAP-ENV:Header> <SOAP-ENV:Body> <add:AddROLine> <add:MMS100> <add:OrderNumber>''' + iTRNR.toString().trim() + '''</add:OrderNumber> <add:MMS101> <add:ItemNumber>''' + ITNO.toString().trim() + '''</add:ItemNumber> <!--Optional:--> <add:Status-BalanceID>''' + MGLINE_STAS.toString() + '''</add:Status-BalanceID> <!--Optional:--> <add:TransactionReason>''' + MGLINE_RSCD.toString() + '''</add:TransactionReason> <!--Optional:--> <add:TransactionQuantity-BasicUM>''' + inTRQT + '''</add:TransactionQuantity-BasicUM> </add:MMS101> </add:MMS100> </add:AddROLine> </SOAP-ENV:Body></SOAP-ENV:Envelope>'''
IonResponse response = ion.post(endpoint, headers, queryParameters, formParameters)
if (response.getError()) { logger.debug("Failed calling IPS API AddROLine, detailed error message: ${response.getErrorMessage()}") mi.error("Failed calling ION API AddROLine, detailed error message: ${response.getErrorMessage()}") return } if (response.getStatusCode() != 200) { logger.debug("Expected status 200 but got ${response.getStatusCode()} instead") mi.error("Expected status 200 but got ${response.getStatusCode()} instead") return if(response.getStatusCode() == 500 && !ionAPIFailed) { ionAPIFailed = true crtReplacementOrderLine() } else { mi.error("Expected status 200 but got ${response.getStatusCode()} instead") return } } String content = response.getContent() def xml = content newOrderNumber = utility.call("XMLParser", "getXMLTagValue", xml, "add:OrderNumber") orderLineNumber = utility.call("XMLParser", "getXMLTagValue", xml, "add:OrderLineNumber") logger.debug("Content of crtReplacement line is:"+content +"Order is:"+newOrderNumber+",Line number is:"+orderLineNumber) }
Hi Rene, very interesting xtend indeed.
do you think we would a way to triggers the classical mforms automation (I mean without using IFS) like we could do in the ISO scripting tool ?
Hi Jerome, The Mforms automation feature is not available in XtendM3. As mentioned by Rene IPS(Interactive programing services) is good approach instead of Mforms. IPS is available as IONAPI so you don't need to put it in XtendM3. It can be directly invoked from any other applications just like other APIs.
Except from MEC/IEC which does not support IPS (yet)