How to use setValue into a Table.

danielgarc__a
Giga Contributor

Hello everyone!
I have a problem trying to load into an attribute of a table.

I have one table, that has some attributes, and in the "New" form, I want to use a business rule to put a value into a field, so I tried a lot of ways to write the Script that do that, and fill something into that field but I don't know how to do it.

Someone knows how I can make to introduce a value into the field?

Thank you for your time!

7 REPLIES 7

rahulpandey
Kilo Sage

Could you please elaborate the issue and, what are you trying to achieve?


arpitt
Tera Expert

Hi Daniel,



Please elaborate more on your request.



Regards,


Arpit Taneja


danielgarc__a
Giga Contributor

Sorry guys, i'm starting with Service Now.



The problem is:


I have 1 table, and when I click in new, the form appear to create a new object in that table. I want a script that puts inside a field something, because my table is for incidents tickets, and I want that everytime that you click in new, the labe "Number of incident" change, and its read only field.



For example, if I click in new, the form appears, and has a field description that the user fills it, and a read only field which is a number (Incident number) and is automatically filled, so everytime you click in create new, that number increases.



So I want to make an script that is changing and filling the value of that field.



I hope is more clearly now.



Thank you for your time.


Hi Daniel,



Write a Before insert BR , fetch the number field covert it into string then increment by one then covert it back to integer and then set that new value in the respective field you want.



Anyways the auto increment of number is automatically done by SN using number padding function.



Regards,


Arpit Taneja