Set field value in workspace

pallavigaik
Kilo Guru

Hi All,

 

I have created a page variant to create a new record in custom table. In rate type field I want to pre-populate a default value whenever form get loaded.

 

For this requirement I have added [field] set value handler under From loading state changed.

pallavigaik_0-1776404109008.png

 

So, when I preview the configured page, It is showing expected result, like alert is getting printed, field value is getting set to Fixed rate

pallavigaik_1-1776404259542.png     

pallavigaik_2-1776404288938.png

 

 

However when I'm opening URL page, its neither printing alert nor setting field value. Seems events are not getting triggered on URL page.  Why this is happening. Please help me to fix this issue. 

 

Thanks in advance for your support.

 

 

1 ACCEPTED SOLUTION

Hi @lauri457,

Thank you for reverting. Now I got it.

 

Actually I had configured classic onLoad client script, but it was working on form UI not on workspace. Reason of this issue was that I  had select Desktop in UI type. Later I set UI type to All and then it started working on workspace too. 

View solution in original post

8 REPLIES 8

lauri457
Tera Sage

Any reason you are not using an onload client script (this can also handle the infomessage) or a default value?


You can also fill values from the url using the query parm when creating new records just like in classic ui: /now/sow/record/incident/-1/params/query/short_description=helloworld%5Edescription=foobar


lauri457_0-1776407104525.png

 

Hi @lauri457 

Thank you for reverting.

Could you please elaborate it

If you are using a form component, you can just use a default value on the sys_dictionary record. If it needs to be dynamic you can use an onLoad client script or a dynamic default value.

 

The variant is overkill for just what you are describing. 

Hi @lauri457,

Thank you for reverting. Now I got it.

 

Actually I had configured classic onLoad client script, but it was working on form UI not on workspace. Reason of this issue was that I  had select Desktop in UI type. Later I set UI type to All and then it started working on workspace too.