Solved

Set default values using Client scripts

  • 26 January 2023
  • 1 reply
  • 169 views

Userlevel 5
Badge +13

Hi experts,

There is an requirement as below.

 

In request screen, we can have multiple part needs. Once we create a new row in Part needs tab, we need to add some default values (Ex- Promised Date/Quantity) to the newly added row based on the first part_need row values.

 

As an example, in this screenshot, first part need sequence = 46. So when user adding new row by using New button, the values from sequence - 46 should be fetched and set as default values in the newly created row.

 

 

I have already fetched the values from the first part need row by using client script sql.

 

But when I try to use the getDataTableSelectedRows and setValueOnListDataRow, it seems these methods are not triggering the newly added row. Instead this method will trigger the first row since that is the one already selected as the default.

 

Any feedback or work around for this.

 

Thanks,

Hasara

icon

Best answer by nimesha.kalinga 26 January 2023, 11:06

View original

1 reply

Badge +4

Hi @Hasara Dinu,

 

Since your requirement is always fetching the data from the 1st row,

Can you try using the SelectionChanged action event along with the getDataTableSelectedRows("part_need") function

 

 

You might have to add some constraints into the client script .as it runs on other events as well.

 

Reply