Hello,
How can I set Approval workflow for PO, Payments and Transfers?
Regards,
Zaka
Hello,
How can I set Approval workflow for PO, Payments and Transfers?
Regards,
Zaka
This is pretty subjective and generic question , still you can refere the following
PO Workflow - http://technet.microsoft.com/en-us/library/hh227472.aspx
AP Payments - http://technet.microsoft.com/en-us/library/gg242526.aspx
AR Payments - http://technet.microsoft.com/en-us/library/gg213694.aspx
Thanks for the reply. It was really helpful. The Purchase Order Workflow has been defined in the system, but it doesn’t allow me to proceed / edit it in any way. Following is the script (which is Greek to me).
private void build()
{
#Admin
#AOT
WorkflowVersionTable versionTable;
WorkflowTypeName templateName;
str domainUser;
UserInfo userInfo;
NumberSeq num;
SysInfoAction_MenuFunction sysInfoAction;
TreeNode treeNode;
SysDictWorkflowType workflowType;
int classId;
num = NumberSeq::newGetNum(SysWorkflowParameters::numRefSequenceId(), false, true);
if (num == null)
{
sysInfoAction = SysInfoAction_MenuFunction::newMenuItem(menuitemDisplayStr(SystemParameters), MenuItemType::Display);
throw error("@SYS108268", ‘’, sysInfoAction);
}
versionTable = element.args().record();
//BP Deviation Documented
select userInfo where userInfo.Id == curUserId();
domainUser = userInfo.NetworkDomain + ‘\’ + userInfo.NetworkAlias;
if (element.args().parmEnumType() == enumNum(WorkflowConfigurationActionType) &&
element.args().parmEnum() == WorkflowConfigurationActionType::New)
{
templateName = element.args().parm();
treeNode = TreeNode::findNode(#WorkflowTypesPath + #AOTDelimiter + templateName);
if (treeNode)
{
workflowType = new SysDictWorkflowType(templateName);
classId = className2Id(workflowType.document());
if(classId == 0)
{
throw error("@SYS108554" + '. ’ + “@SYS113219”);
}
try
{
workflowConfiguration = Microsoft.Dynamics.AX.Framework.Workflow.Model.WorkflowModel::
Create(templateName, curext(), curUserId(), domainUser);
}
catch (Exception::CLRError)
{
throw error("@SYS327400");
}
}
else
{
throw error(strFmt("@SYS106830", templateName));
}
}
else
{
try
{
workflowConfiguration = Microsoft.Dynamics.AX.Framework.Workflow.Model.WorkflowModel::Create(versionTable.ConfigurationId, curext(), domainUser);
}
catch (Exception::CLRError)
{
throw error("@SYS327400");
}
}
}
HI,
In Procurement & Sourcing > go to Parameter > in general tab> Change management > tick mark on Activate change management tick mark.
your work flow will be activated.
Regards,
Ankit SOni
Hi,
You should enable the active change management in procurement parameters.
Thanks
I think it’s not a technical issue.
Regards
Kanagaraj
Thanks but the check mark didn’t help. Even after that, following is the message while creating new or editing existing workflow:
“An unexpected error has occurred while opening the workflow. See the event log on the AOS and contact your system administrator to resolve the issue.”
Regards, Zaka
Check the event log. I think it is most probably the WSDL port connectivity issue. You’ll have to generate full CIL in the application and then try again.
Hi rahim,
Please do kiran suggesstion (Full CIL), it will help you…
Thanks.
Was doing the Full CIL but the connection to server was broken.
The incremental CIL is however given below, if that helps in anyway.
Regards, Zaka
///
/// Generates incremental CIL from X++.
///
///
/// A Boolean value that indicates whether to create XML files by using the types that changed or by
/// using existing XML files.
///
///
/// A Boolean value that indicates whether to start or stop the AOS AppDomain.
///
///
/// A Boolean value that indicates whether to log a message in the Infolog when it is finished.
///
///
/// true if changes were found and the assembly was updated; otherwise, false.
///
///
/// This method invokes the generator to update the X++ assembly with the types that have changed since
/// the last generation.
///
///
/// Propagates the exception if found.
///
[SysEntryPointAttribute(true)]
public static boolean generateIncrementalIL(boolean dumpChanges = true, boolean startBatch = true, boolean logMsg = false)
{
InteropPermission interop;
str xmlPath;
str writePath;
str binPath;
System.Diagnostics.Process process;
System.Diagnostics.ProcessModule module;
str xppAssemblyPath;
boolean changeFound;
System.Exception ex;
str errorMsg;
System.String[] modifiedModules;
System.String AppVersionStr;
System.Version AppVersion;
Microsoft.Dynamics.Ax.Xpp.GeneratorParameters parameters;
System.AppDomain xppILAppDomain;
SysAutoSemaphore autoSemaphore;
;
interop = new InteropPermission(InteropKind::ClrInterop);
interop.assert();
SysCompileIL::validate64Bit();
autoSemaphore = SysCompileIL::validateSingleDeveloper();
try
{
process = System.Diagnostics.Process::GetCurrentProcess();
module = process.get_MainModule();
binPath = System.IO.Path::GetDirectoryName(module.get_FileName());
xmlPath = SysCompileIL::getXmlPath();
writePath =SysCompileIL::getWritePath();
xppAssemblyPath = binPath + ‘\XppIL\’ + #XppDllName;
// Make sure the folder exists
System.IO.Directory::CreateDirectory(xmlPath);
// Delete older xml files if present
if(dumpChanges)
SysCompileIL::deleteDirectory(xmlPath);
}
catch(Exception::CLRError)
{
// BP deviation documented
ex = CLRInterop::getLastException();
ex = ex.get_InnerException();
errorMsg = ex.get_Message();
// BP deviation documented
infolog.add(Exception::Error, errorMsg);
throw Exception::CLRError;
}
// Dump incremental xml files
changeFound = !dumpChanges || SysCompileIL::dumpIncrementalBulk();
if(changeFound)
{
try
{
AppVersionStr = ApplicationVersion::applBuildNo();
AppVersion = new System.Version(AppVersionStr);
xppILAppDomain = xApplication::XppILAppDomain();
parameters = new Microsoft.Dynamics.Ax.Xpp.GeneratorParameters();
parameters.set_AppVersion(AppVersion);
parameters.set_AssemblyName(#XppDllName);
parameters.set_EnableDebugging(true);
parameters.set_EnumFile(xmlPath + ‘\Enums.exml’);
I have run the FULL CIL as well, yet the error message on approaching Workflows is almost same as the one after incremental CIL sent yesterday.
Regards, Zaka
Hi,
Its always useful to post event log message here to understand the root cause of the problem rather than posting the code snippets. Most of the times when this kind of occurs, it would be probably due to application not compiled properly or CIL problem. Doing the full CIL will certainly solve the issue but here in your case it didn’t. Post the event log message here from Event viewer\Application and services logs\Microsoft Dynamics AX Workflow.
Thanks Kiran. Could you please guide me some more on where to find Event viewer\Application and services logs\Microsoft Dynamics AX Workflow.
That is the path in Event viewer to refer the workflow event log. You can open event viewer by inputting eventvwr in windows run prompt and click OK. And then go to the specified path to find out the exception. Take help from developer if needed.
Thanks. Found out the location but not much of help there either. I guess parking the subject for the moment is the only option. Thanks a ton for all the help.