This topic contains 6 replies, has 0 voices, and was last updated by hemang 8 years, 1 month ago.
-
AuthorPosts
-
August 8, 2016 at 2:24 pm #9871
VoltronI have a somewhat complex workflow. Requirements for a change to this workflow require Suitescript. I don’t like straddling solutions, so I intend to reproduce most of the workflow with script (the other parts of the workflow are not needed). Is there any way to view the code that was generated by the workflow engine? I’ve been able to extract such a thing from client-type workflows, but getting into the server-type pieces of a workflow seems more challenging.
This is a cached copy. Click here to see the original post. -
August 8, 2016 at 4:57 pm #9872
david.smithYou can initiate and trigger them with suitescript but not load. I’m not sure if you can do anything with suitetalk or not.
-
August 9, 2016 at 8:24 am #9873
VoltronThanks, David. I think you understand my request, but I think an example will ensure you (and others) get it.
Excerpt of a workflow might look like:
Before Record Submit:
— Set Field Value: Employee = Current User w/ condition: Type: Create
I’d like to see the code this generated that might look like:
function beforeSubmit(){
var context = nlapiGetContext();
if (type == ‘create’) nlapiSetFieldValue(’employee’,context.getUser());
}
Would be amazing if the workflow states and transitions were also represented.
-
August 9, 2016 at 2:00 pm #9874
k_duncI know of no utility in NetSuite that will show you code generated from a Workflow.
Further, I note you said that you don’t like to ‘straddle solutions’, and I get that, but if you have a complex Workflow that clearly is working fine, but now requires some mods., I’d be suggesting the KISS methodology and looking to simply write the code required for your mod., and then have your Workflow call your script. Just sayin’.
Cheers.
-
September 20, 2016 at 3:06 am #9875
chanarbonHi Joshua,
I would suggest you to use the SuiteFlow API, nlapiTriggerWorkflow(), to be specific to have the action triggered to lessen the time consumed to rebuilding the script from scratch.
But yes, as of the moment, there is no direct way to converting workflow to scripts. Basically, every action like have their own SuiteScript function like Send Email function be nlapiSendEmail(). I guess, the naming conventions for the action would be helpful for to you find the SuiteScript function used. I guess the only tricky part is the the transitions but it is rather more on the use of operators, a couple of searches and a couple of get field values and lookup fields to do a workaround on it.
-
October 3, 2016 at 12:02 am #9876
hemangHi Chanarbon
How to make the transition possible through script. like for example, i have added button via suiteflow and if user logs in and clicks button on Bill, it will get approved since its approve button.
now i am adding email capture plugin where in if user approves via email, then the bill should get approved via plugin. how to generate the click event of button via script.
-
October 3, 2016 at 12:08 am #9877
hemangJust found out that nlapiTriggerWorkflow can be used to transition. Thanks.
-
AuthorPosts
You must be logged in to reply to this topic.