i'v created custom workflow for Sales Credit Limit in SalesTable form
but after that when any user create new sales order it's created directly even there's no submit button of my workflow
here my project which i created i'm using ax2012R3
Hi!
Did you setup the workflow ?
yes i did without error
Is it also don't appear on the new SalesOrders which are were created after workflow activating?
thanks for replay
even on new SalesOrders which are were created after workflow activating not appear
Hello mohammed,
Difficult to what what might be missing.
Do you have access to a D365Fo demo environment where such a workflow is available in the standard solution. Maybe you can compare your own design with what is done in D365FO.
Best regards,
Ludwig
Hi Mohammed,
Code in method Table > SalesTable > Method > canSubmitToWorkflow seems to be an issue.
public boolean canSubmitToWorkflow(str _workflowType = '') { AmountMST creditBalance; CustTable custTable; boolean ret; ret = super(_workflowType); if(this.SalesCreditLimitWorkFlowStatuse==SalesCreditLimitWorkFlowStatuse::NotSubmitted) { ret=false; } return ret; }
The line
if(this.SalesCreditLimitWorkFlowStatuse==SalesCreditLimitWorkFlowStatuse::NotSubmitted) { ret=false; }
This is not correct. By default the Status will be Not submitted and if it is not submitted you are returning false. This will mean that workflow submit is not applicable and hence Submit button is not visible.
Try changing the code as shown below:
public boolean canSubmitToWorkflow(str _workflowType = '') { AmountMST creditBalance; CustTable custTable; boolean ret; ret = super(_workflowType); return this.RecId != 0; }
.
thanks for replay Sumit Loya
it's now display and still keep display after press on
but when i clickd on Submit button nothing happens after that message
and i can't see other action like approve or reject
The next issue is in class SalesCreditLimitWFSubmitManager method main. Following section
try { ttsBegin; workflowCorrelationId= Workflow::activateFromWorkflowType(workflowTypeName, recid, note, NoYes::No); salesTable.SalesCreditLimitWorkFlowStatuse=SalesCreditLimitWorkFlowStatuse::Submitted; info("Workflow Submitted"); ttsCommit; }
You have written the code to change status to submitted but have not called update method. Please add a line before info to call salesTable.update().
You can check following link on Workflow Detailed Development. This was written for AX 2009 but basic development principles remain same for both AX 2009 and AX 2012.
You can compare this link and your code to streamline the workflow code..
i'v check link i try to import it but i got some error
i did change as you say adding salesTable.update().
but still there's problem button submit after press still not going
i think the proble from canSubmitToWorkflow method
because still show me submit button
but when i stop my workflow it's show me action button but like this
and when i press there i got this
I suggest you check my link first. There are label issues and looks like you have Cancel menu item applied for all outcome elements. Please check that once.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 683 Most Valuable Professional
André Arnaud de Cal... 563 Super User 2025 Season 2
Sohaib Cheema 398 User Group Leader