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
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
Check this...
Hi Guys,
Please go through the below link, I have provided solution for the same with out any overlayering.
community.dynamics.com/.../288826
Thanks,
Satish Kakileti.
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 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.
sarah guan,
You can not achieve this without overlayering until now. Maybe MS provides some way in future releases.
Hi Sarah,
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.
Thanks,
Satish K.
Error message: The next method cannot be invoked in method 'canSubmitToWorkflow' because it's not a chain of Command method.
Hi Satish,
please have a look at error below, need I overlay this method in table?
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.
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.
André Arnaud de Cal... 291,391 Super User 2024 Season 2
Martin Dráb 230,445 Most Valuable Professional
nmaenpaa 101,156