Question

Execute Copy using Client Script

  • 16 April 2024
  • 2 replies
  • 23 views

Badge +6

Dears,

 

Please let us know the function which is used to call copy map in Client scripts.

As I need to create a new task based on old task data.

 

Thanks & regards,

Narsing


2 replies

Userlevel 6
Badge +26

Hi @Narsing Rao 

I am not aware of such a client script function.

You can consider using createInsertRequest() functionality or an XML business rule.

Cheers!

Userlevel 4
Badge +12

Hi @Narsing Rao 

If you are using the web client scripts, then suggesting you to get the perform_copy MPM to execute in your client script (have not tried this one before, but I have been able to call several other MPMs using the web client scripts).

The general MPM for perform_copy mpm looks like this in XML. Therefore, you need to format the xml message accordingly.

<perform_copy>
<parameters>
<key_item />
<key_item />
<column_name />
<column_value />
<table_name />
<copy_map_id />
<copy_from_keys />
<copy_to_keys />
<user_input_values />
<table_name />
<column_name />
<column_value />
<user_input_value />
</parameters>
</perform_copy>

webclient script  

var performExecuteVars = {};
performExecuteVars.column_name = 'task_id';
performExecuteVars.copy_map_id = 'YOUR_MAP_ID';
performExecuteVars.table_name = 'task';
performExecuteVars.copy_from_keys = {task_id:previous_task_id};
performExecuteVars.table_name = 'task';
performExecuteVars.column_name = 'task_id';
var results=executePerform('copy', performExecuteVars);

 

Reply