Populate location (reference filed) on selecting sales order (List collector) in record producer

Aakanksha S B
Tera Contributor

Hi All,

I have to create a record producer where I need to auto populate location fields(reference type) on selecting the sales order which is type list collector from the ast_contract table .

I have tried using below configuration for table: cmn_location

Reference qualifier: javascript: 'location='+ current.variables.contract
Variable attributes:ref_qual_elements=contract
But its not working. Any suggestion on this is greatly appreciated. 
 
Regards,
Aakanksha B
1 ACCEPTED SOLUTION

Brad Bowman
Kilo Patron
Kilo Patron

The first problem with this is that a reference field/variable holds only one value, while a list collector can contain many, so when the second sales order (ast_contract) record is selected, what are you expecting to happen to the reference variable?  Another issue is that reference qualifiers limit the available records in a referenced table, they do not auto populate a field.  To do this you would need an onChange Catalog Client Script when the list collector variable changes.  This script would use GlideAjax to call a Script Include to query the selected record(s) and return some data related to them.  This is where the first problem comes into play.

 

If what you're trying to do is limit the records of a reference variable by a field that's related to records that are selected in a List Collector, then that would be possible calling a Script Include in the reference qualifier, passing in the contract variable.

View solution in original post

3 REPLIES 3

Brad Bowman
Kilo Patron
Kilo Patron

The first problem with this is that a reference field/variable holds only one value, while a list collector can contain many, so when the second sales order (ast_contract) record is selected, what are you expecting to happen to the reference variable?  Another issue is that reference qualifiers limit the available records in a referenced table, they do not auto populate a field.  To do this you would need an onChange Catalog Client Script when the list collector variable changes.  This script would use GlideAjax to call a Script Include to query the selected record(s) and return some data related to them.  This is where the first problem comes into play.

 

If what you're trying to do is limit the records of a reference variable by a field that's related to records that are selected in a List Collector, then that would be possible calling a Script Include in the reference qualifier, passing in the contract variable.

Hi Brad,

Thank you I tired with Script Include and onChange Catalog Client Script and it worked.

 

Cheers!!

Good to hear!