I have used get before but didn't know it could take two inputs. This is awesome.
@SteemanCodes2 жыл бұрын
Great, I didn't know about two params, its awesome, Next time will use it. Thanks for sharing Chuck, Lots of love
@vemulakondasubramanyam37472 жыл бұрын
Cool... two parameters nice feature.... can it be improved to have list of columns and list of their values ?
@ChuckTomasi2 жыл бұрын
For the use case of getting specific fields/values, you might want to take a look at GlideQuery.
@samikshasaloni59132 жыл бұрын
Thia video is very useful for me because sometimes I forget to add the query() step.. It will work for if only noy for while.Is it?
@justinjoy17012 жыл бұрын
yes you only get back a single record, so no point in using while.
@aviramran157 Жыл бұрын
Well known but you can't use it to update the record
@ChuckTomasi Жыл бұрын
As the method name implies... "get" to get information. update() is used to update a record. :) Sorry if there was any indication of misrepresenting what this video is about.
@aviramran157 Жыл бұрын
@@ChuckTomasi It's all good! I just wrote it for clarification for others
@vibhamadaan2 жыл бұрын
I've used it in my code.
@vkachineni2 жыл бұрын
Shorten up the code Vs Performance. How is the performance of .get() compared to .query() and .next()? Chuck, What do you prefer?
@OneAndOnlyMe2 жыл бұрын
There should be no difference betwen .get() and .query() as ultimately they will do the same query in the database. .get() is more elegant code as you can do "if (incident.get(id))..." rather than .addQuery() then .query() then .next().
@skillz0r102 жыл бұрын
@@OneAndOnlyMe the fastest way to retrieve a single record is not mentioned here. If you are looking for performance, do a .query() after a .setLimit(1) followed by a if(next()). Run a background script with and without the setLimit(1) and check the difference. Specially in tables with a lot of data
@OneAndOnlyMe2 жыл бұрын
@@skillz0r10 Having the right indexes configured is also a factor.
@fung5768 Жыл бұрын
Hmm, I posted a comment suggesting people not to use the Get method, and it got deleted. Really classic ServiceNow..