Announcements
Hi All guys,
I want to enable table workflow, but I don't know how to extend the canSubmitToWorkflow method in my extension class, who has this experience to share with me? thanks.
*This post is locked for comments
same question, How do i extend canSubmitToWorkflow method in form, I try to add this method to my extension class, It seems as if added method is unuseful.
Hi Sarah,
This can be achieved through COC,
I hope following code would help you,
[ExtensionOf(tableStr(<YourTableName>))]
final class <YourTableName>_Extension
{
public boolean canSubmitToWorkflow()
boolean ret;
ret = next canSubmitToWorkflow();
if(this.recID && (this.WorkflowState == WorkflowState::notSubmitted))
ret = true;
}
return ret;
Thanks,
Satish K.
Hi Satish,
please have a look at error below, need I overlay this method in table?
Error message: The next method cannot be invoked in method 'canSubmitToWorkflow' because it's not a chain of Command method.
I want to mention one thing here,
We can use COC only for the table methods which are already overridden. If the method, CanSubmitToWorkflow is not overridden, we have to customize the table and proceed with over-layering this method.
sarah guan,
You can not achieve this without overlayering until now. Maybe MS provides some way in future releases.
Hi all guys,
I extends form method
[FormDataSourceEventHandler(formDataSourceStr(MyForm, ProjInvoiceTable), FormDataSourceEventType::Initialized)]
public static void ProjInvoiceTable_OnInitialized(FormDataSource sender, FormDataSourceEventArgs e)
sender.formRun().design().workflowEnabled(true);
sender.formRun().design().workflowDatasource(formDataSourceStr(MyForm, ProjInvoiceTable));
sender.formRun().design().workflowType("workFlowType");
I open form after building, an error message always pop up saying 'Object reference not set to an instance of an object' when I set property workflowEnabled to true. same error displayed if I override the form to modify this property, I really don't know how to give value to this property for now, who have this solution to share with me? my verison is PU12.
As we all knows that in D365 there is limitation to create workflow on existing table because in Extension we couldn't write canSubmitWorkflow method, You have to over-layer the table and than override the canSubmitWorkflow Method....
But there is an alternate way I found to avoid over layering on systems table.
d365technext.blogspot.com/.../avoid-over-layering-in-development-of.html
community.dynamics.com/.../avoid-over-layering-in-development-of-workflows-on-existing-form
Please mark this Answer as suggested if above blog is use full for you.
Thank you
Sheikh Sohail Hussain
Hi Guys,
Please go through the below link, I have provided solution for the same with out any overlayering.
community.dynamics.com/.../288826
Satish Kakileti.
Check this...
community.dynamics.com/.../844485
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.
Congratulations to our community stars!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.