Yusuf5
Tera Expert

Working without updateset becomes sometimes cumbersome. Specially when moving choice set to another distance. I am not sure if there is an easy way of doing this. But, I find this way quite easy to implement. An example would be the state field choices for incident table as follows.

find_real_file.png

When I work in the DEV environment with the new choices without updateset I have to export to excel and generate insert script and run the script in PROD environment but it is just wasting the time.

To get over this, I’ve developed some script and used in UI Context Menus.

find_real_file.pngfind_real_file.png

First of all, we need to create a table with a field which holds the generated script.

Let’s call it u_temporary as follows.

find_real_file.png

Scripts

In order to implement we need 3 scripts.

  1. UI Context Menu script
  2. Script Includes:
    1. Server side: GenerateInsert.js
    2. Client side: GenerateInsertAjax.js
    3. Server side: StringBuilder.js

Implementation

Let’s generate the insert statements for the state fields for incident table.

find_real_file.png

find_real_file.png

If we go to the link we get the result as follows. And run the script in another instance in  Scripts – Background.

find_real_file.png

Scripts are attached.

Comments

  1. It doesn’t escape the “ character so doesn’t work with the field values that have “ character.
  2. You can generate insert statements for any table.
  3. Any comments are welcome.

 

Regards

Yusuf

 

Comments
bishopx
Giga Guru

Why don't you use the "Export XML" feature, am I missing something?

Yusuf5
Tera Expert

I guess Exporting XML is no different than Exporting Excel as long as you manipulate the raw data.

Maybe I am missing something ? That would be great if you shed a light on me.

Thanks

bishopx
Giga Guru

From what I see, you just want to move records from table to the same table on another instance.

This is exactly what "Export XML" is for. This will export payload with selected records data.
On the target instance, you just go to the list of the table a make "Import XML" from hamburger menu, you can also see that on you screenshots.

And that's it.

Yusuf5
Tera Expert

I think this is the menu you are referring to, but couldn't find the import XML menu.

find_real_file.png

And tried the field headers, and there is import but just excel.

find_real_file.png

 

 

bishopx
Giga Guru

You can read more here: Import an XML file

Yusuf5
Tera Expert

Thank you very much it is very helpful.

So, my method is another way of skinning a cat.

OOB is much more easy but don't know if it is customizable.

My method is stronger in  customizable ways, you may say that I reinvent the wheel.

Anyway, let the developers decide which way to use. And it was my pleasure to discuss with you.

Regards

Yusuf

Rajesh Mushke
Mega Sage

Hey yusuf.celik,

 

instead of doing all those things, you can easily Export them right?

 

follow below screen shot:

find_real_file.png

 

Let me know if you need more help..!!

 

Thanks,

Rajashekhar Mushke

Community Leader-18

Yusuf5
Tera Expert

Thanks Rajashekhar,

We already discussed this with @bishopx.

Version history
Last update:
‎04-07-2018 11:45 AM
Updated by: