Help with Client Script - clearing/mandatory fields

Rob Sestito
Mega Sage

Hey team,

I seem to be having issues with the ability to do what I want/need.

Currently, we have our Source(contact_type) field that defaults to Phone. However, when a Case is created within the Employee Relations COE, I want to make that field load to --None--, and become mandatory.

Along with that, I want to make Assignment Group in the same COE, mandatory.

Now, I started off by doing a client script, onLoad. When the form loads, set Source to --None-- and set it to mandatory. Within the same client script, I also set Assignment Group to mandatory.

Creating a new Employee Relations Case, that works. After I set what I want, and save record, both fields go back to being empty.

I did start this off with creating a UI Policy instead - but Source already defaults to something, so I need to make that not happen on the Employee Relations COE. And at the same time, Assignment Group becomes mandatory, but then grays right out with the Hover Message I can see - "Mandatory - preloaded with saved data". And I cannot seem to figure out what that means.

Can anyone share a reason why/script to help me accomplish what I need? This seemed really easy to start, but is not catching me off guard and I am not sure where I am going wrong.

Thanks in advance!

-Rob

1 ACCEPTED SOLUTION

Rob Sestito
Mega Sage

Closing post as the Assignment Group being Mandatory is no longer a requirement!

Thanks for the help!

-Rob

View solution in original post

4 REPLIES 4

bryan_strasburg
Mega Guru

Rob-

Only got a minute here, but this may get you in the right direction(s)

It is likely your Source (Contact Type) is a default value set in the dictionary on the HR Case table.  Instead of a client script, consider doing a dictionary override on that default value associated with the Employee Relations COE table.  That should solve the default value.

Do a field watcher on those fields to see what is changing them.  There may be a business rule you aren't aware of.

I think your best end state is a Data Policy that sets the field rules which is configured to also run as a UI Policy.

Bryan!!!

Thanks for the reply bud!

I went and did a dictionary override for the Source(contact_type), and got it work just perfectly! (Thanks for the heads up to use that instead - much easier).

I am trying to do the same (sort of), with assignment_group, but unable to get it to work. I see that the field becomes mandatory, but allows me to move the case forward without letting me know it is mandatory.

With using the Watch Field option on it, I see the following:

find_real_file.png

However, AFTER I enter in a Team, save the record, then take the team out, the field will show that it is still mandatory. If I then attempt to save the record again, it hits me with the Red Message saying the field is mandatory.

Suggestion there?

Thanks,

-Rob

Yeah,

I cannot figure out why I can still move forward on the Case, after making the Override Dictionary for Employee Relations table, Assignment Group Mandatory. It shows the red asterisk, and the field gets the red highlight around it when I save the record and that field is empty. But I can still move on - 

I even tried an onSubmit Client Script next, and took the override away. The field does not show as Mandatory until I submit, but still allows me to move forward. And when the form refreshes, the asterisk goes away. The asterisk only shows up when I click the actual UI action to save record.

-Rob

 

Rob Sestito
Mega Sage

Closing post as the Assignment Group being Mandatory is no longer a requirement!

Thanks for the help!

-Rob