if g_form.isNewRecord set assignment group

DIVI1
Tera Expert

I need to declare value of assignment group in 'Problem' Table. 

And here is a problem, cause I just want to declare assignment group only for new records, while updating change of the assignment group should be possible.

That's how my client script look like :

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
   if (isLoading || newValue === '') {
      return;
   }
 if(g_form.isNewRecord()){
   g_form.setValue('assignment_group', '6ae3f5b21b479850bf327bb5464bcb45');
}
}

After when I'm trying to create a Problem I've got message below assignment group field:

DIVI1_0-1695814923200.png

 

1 ACCEPTED SOLUTION

Saurav11
Kilo Patron
Kilo Patron

Hello,

 

I would suggest you to use a Business rule. create a before insert business rule and use the below code:-

 

current.setValue('assignment_group', '6ae3f5b21b479850bf327bb5464bcb45');

 

Please mark my answer as correct based on Impact.

View solution in original post

14 REPLIES 14

Saurav11
Kilo Patron
Kilo Patron

Hello,

 

I would suggest you to use a Business rule. create a before insert business rule and use the below code:-

 

current.setValue('assignment_group', '6ae3f5b21b479850bf327bb5464bcb45');

 

Please mark my answer as correct based on Impact.

It's working Thanks!

Peter Bodelier
Giga Sage

Hi @DIVI1,

 

If it is always a static value as you are now using in your script, you could just define a default value in the dictionary override for problem of the assigment group field.


Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

I used to BR to resolve the problem, but yes it's static value but only for new records