Multiple RITMs for the same request

Ak Islam
Giga Contributor

Hi Community,

Is there any ways to have multiple multiple RITMs depending on Quantity selected? I need run each RITM workflow individually instead of one workflow for all requested items.

Seems like using Add cart capability, i can add same item multiple times and once cart is placed, it created multiple items and that what I wanted to do, but from the user perspective that could be cumbersome to click the "Add to Cart" button 10 times to add to cart (If user need 10 items)

find_real_file.png

Any help will be much appreciated,

Thanks

Ak

10 REPLIES 10

Community Alums
Not applicable

Hi Lars,



I tried with your code for creating multiple ritm's . However , workflow is not getting attached to the last ritm which is created.



Can you please let me know what would be the reason.



Thanks,


Sangeetha


Hi



Its not an issue that I have experienced so I wouldn't know what could cause this


Hi Sangeetha,



Can you paste the script you are using and the conditions when and from where it is being triggered?



Regards,


Shilpa


Community Alums
Not applicable

Hi Sha,



Attached the script am using. I am calling the script include from the RITM workflow.



Workflow is getting attached , but Show Workflow is not showing on the last RITM. We have approvals on the Request . Is there any way we can create all the RITM's before approval. Currently , one ritm is getting created before first approval and the other ritm's after approval.


Hi Sangeetha,



I am not very clear on the logic you are applying, guessing at any time you want 'updateVariable' to run twice?



I doubt if the below given code is working, as context looks for object and not sys_id of ritm as per my understanding try passing object of ritm instead of grRITM.sys_id...


var grWf = new GlideRecord('wf_context');


  if(!grWf.get('id', grRITM.sys_id)) {  


       


  var wf = new Workflow();


  var wfId = wf.getWorkflowFromName("Access Request PoC Workflow");


  var context = wf.startFlow(wfId, grRITM, 'insert', '');


  if (context != null)  


  current.context = context.sys_id;