Jump to content

Use database direct to update fields?


Gary@ADL

Recommended Posts

Hi Guys - are we able to use the database direct function to change records?

 

we need to change the value of a custom field set during request capture by a request question. i have looked and cant seem to change it in the request itself, so i tried to change it using SQL but im getting an error here, so i wandered if im doing something wrong, or is this a permissions issue? 

i can get the record ok

 

image.png.9c27bdc2494b6cd7b4e90b9a5e14bec0.png

 

but when i try to run the following - UPDATE h_itsm_requests SET h_custom_a = 'P1' WHERE h_itsm_requests.h_pk_reference = 'PM00238151'

 

i get an error executing query

 

image.png.3df342aff3eafa3478849b245628131c.png

 

if i click on the field i want to change, i get an error about no primary key?

 

image.png.c26aa30e3ad140aa82150399a4065e63.png

 


many thanks 

Link to comment
Share on other sites

Hi@Gary@ADL 

Why are you unable to edit this on the request itself? If it is due to the custom field not showing, you should be able to temporarily make h_custom_a visible on the Details section for that particular service, simply by clicking "Design" (as an Admin), adding a custom field e.g. Single Line Text Field, ensuring you select h_custom_a, and clicking "Apply Changes". 


This would then allow you to edit the value of the custom field via the Problem Record itself (rather than trying to do it via SQL which we do not allow). And once changed, you could hide the custom field from view again if you didn't want it visible going forwards. 

image.png

 

Bob

  • Like 1
Link to comment
Share on other sites

Hi Guys - thanks both,

 

@Bob Dickinson this is brilliant and works thank you :)

 

i had figured out if i changed the field from a dropdown to a single line text field it would let me change it within the Questions section of the ticket, but this wasnt updating the backend.  

 

the way you have shown me also updates the backend too, which does exactly what i need it to do,

 

many thanks 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...