Service Desk Practitioners Forum
cancel

Modifing an existing record from the command line

Highlighted
michaelt_2
Contributor.

Modifing an existing record from the command line

Hi,
I would like to use either sd_dataform sd_event to open an existing Service Call (using the ID) and modify some fields. I've read throught the forums and still cant seem to work it out. Is such a thing possible with sd_dataform? I've sucessfully used sd_dataform to create a new Service Call but when i try to use it to open an existing Service Call and change the information field with :
sd_dataform "Service Call" ID=123 +"Information=Test"
it just brings up a new service call, looks like its searching for the ID and the information attributes.
I've tried with sd_event but have not gotten anywhere, my sd_event.ini is set up so i guess what i need is someone to complete this command :
sd_event -f sd_event.ini -v ... ..
say as an example, to open a Service Call with ID=123 where i wish to change Information to "Test"

Any help appreciated, thanks,
Michael
4 REPLIES
Mark O'Loughlin
Acclaimed Contributor.

Re: Modifing an existing record from the command line

Hi,

use -listalways with the sd-dataform command

sd_dataform.bat "Service Call" -ListAlways ID=123 +"Information=Test

e.g.
sd_dataform.bat -ListAlways "Description[Contains]WordA WordB"
Ruth Porter
Acclaimed Contributor.

Re: Modifing an existing record from the command line

Hi Michael,

The advice on which to use is:

Use sd_dataform when you want the user to interact with action

but

Use sd_event when you want to it all with no user interaction or involvement.

When using sd_event it will create a new record unless the attribute you have specified as the unique key matches an existing record. So typically your import mapping that you use in sd_event, might have ID set as the unique key and possibly have amapping of inf fo Information. Then your sd_event would look something like:

sd_event -f sd_event.ini -v ID=call_number "inf=this is a test"

Try by hand and then if you want to put it in a DB rule try
ID=[ID] "inf=[field which holds the text]"

Hope this helps

Ruth
http://www.teamultra.net
michaelt_2
Contributor.

Re: Modifing an existing record from the command line

Mark :
I tried :
sd_dataform.bat "Service Call" -ListAlways ID=123 +"Information=Test
and am presented with the search results box containing no entry, if i do:
sd_dataform.bat "Service Call" -ListAlways ID=123
I am presented with the search box contain the Service Call with ID of 123.
The Information field does not currently contain the test "Test", I wish to change it to text. It still seems to be searching for for a service call with ID=123 and Information=Test
-Michael
michaelt_2
Contributor.

Re: Modifing an existing record from the command line

Ruth :
Sounds like your suggestion with the import mapping is what i was looking for, I'll try that in the morning and see how I go.
Thanks, Michael