Skip to main content

HI,

I have a server side code that integrates the SmartObjects data (these datas are saved from the smartform once submitted) to the Microsoft Dynamics GP Account Payable using their API. This piece of code works perfectly fine but I have a small issue here from the users perspective. Since this server side code runs only when a form is submitted (in Default Activity), user never know if there is an error . I want to run this code in the default activity code behind so that any error message can be displayed on the smartform as message popup box. Can you please let me know the best way of handling this situation. I am using K2 blackpearl with VS 2010 as IDE and K2 designer for smartform.

Thanks.

Activities can't run until the Workflow is started.  I mean, it makes sense, right?  The SmartForm is just the front facing UI.  Until the rule that starts the workflow runs no activities/events can run.  You'll either have to run code in the SmartForm or do some validation in it.


Hi Victoria,

Thank you for your response. Is there a way to run the code in the Smartform itself. I can embed that code  (currently running in server side) into the code behind of the smartform and check the boolean status (true or false) and display the message to the user on the messagebox. Can you give me some hints. Thanks.


It is possible to put code in a SmartForm, yes, but I only know that you can and not necessarily how to do it.  Here are a few things I found in Google that may help, and perhaps someone more knowledgeable can chime in :)

 

Extending K2 SmartForms - K2.com mPDF]
https://help.k2.com/files/7836

 

How to call jQuery or JavaScript code in a K2 SmartForm

http://blog.velocity-it.com/2014/10/07/how-to-call-jquery-or-javascript-code-in-a-k2-smartform/

 

 

BUILDING K2 SMARTFORM CONTROL – PART 1

http://codecodecode.ninja/2015/09/building-k2-smartform-control/

 

K2 SMARTFORMS CONTROL CUSTOM PROPERTY
http://codecodecode.ninja/2015/07/k2-smartforms-control-custom-property/

 

Building Custom Controls with K2 Smartforms Sample Codes

http://www.k2.com/partners/webinar-%20%20series/building_custom_controls_codes


Reply