If i am running the Back ground script i can see the incident record why i can see this record only

kranthi2
Tera Expert

Hi,

If i am running the Back ground script i can see the incident record why i can see this record only.

any specific reason why i am able to see 

INC0010001

 Please find the attached SS for the same please help me out the clear explanation on the same.

1.png

1 ACCEPTED SOLUTION

Hi @kranthi2  , Sorry got you question wrong this is something reply  for the same 

As you have used If condition it will exit the loop with the First ever satisfactory condition, That means "INC0010001" is the first record in the loop which satisfies the query condition and terminates the loop.

 

Please find below image for the same:

 

EswarChappa_0-1692259894084.png

 

 

Thanks & Regards,

Eswar Chappa

Mark my answer correct and Helpful if this helps you 😀

View solution in original post

10 REPLIES 10

Aman Kumar S
Kilo Patron

Hi @kranthi2 

Because you are using if for iterating through the query result, change if to while, it will give you all the results.

Also, instead of incGR.number, use inGR.getValue("number") and similarly for short description

Best Regards
Aman Kumar

Hi @Aman Kumar S 

Thanks for the quick response.

yes i have used the while but still i am having a question there are many incidents are there why it is showing 

INC0010001

Instead of it will some other right. i mean any kind of business logic is present at the script level 2.png

Here my question is why it is not displaying INC0010012/INC0010021/INC0000015/---and so on why it is INC0010001 only.  

Hi @kranthi2 ,

You did not change this:

Also, instead of incGR.number, use inGR.getValue("number") and similarly for short description.

 

When you use dot walk, it returns an object which is used in JavaScript by Reference. Therefore your record always includes a reference to the same object. so use getValue() instead.

 

Best Regards
Aman Kumar

Hi @kranthi2  as you have used If condition it will exit the loop with the First ever satisfactory condition, That means "INC0010001" is the first record in the loop which satisfies the query condition and terminates the loop.

 

Thanks & Regards,

Eswar Chappa

Mark my answer correct and Helpful if this helps you 😀