Reg: Record producer script

Community Alums
Not applicable

Dear Team, 

 

I have one requirement  in Record producer form we have Catalog item owner field this is reference filed filter with role is catalog item owner , active records and global id is gi  table is sys_user table .... This is working as expected in form i am getting correct user names.

Step 2 : one user is having two user ids with same name different global ids -> one id start with 'gi' and other user id start with 'si'.  in catalog form i am getting 'gi' related user name only so i am selected and submitted ... geeting Demand number.    upto here working as expected .

Step 3 : Demand table (dmn_demand ) i have collaborators field looking like watchlist field , here not displaying what i have selected user name. user name displaying is correct but user id is not related 'gi ' .   i need whatever i selected that user user id related user name only.

Step 4: record producter script  -- i am written like below 

current.collaborators = producer.catalog_item_owner.getDisplayValue();   
 
for more details please find the screen shots,   i tried with glide record in script but its taking finally 'si' user name only   user names or same ... i tried sys_id this is not working.  if any one know very well script please help me. 
 
Thanks & Regards,
Bandi
1 ACCEPTED SOLUTION

Brad Bowman
Kilo Patron
Kilo Patron

Because names are not unique (first name + last name in this case) don't use getDisplayValue().  You know you are selecting the correct user in the Catalog Item Owner variable since you have a reference qualifier to limit the selections to gi.  Since this variable is a reference, and both the reference variable and the list field on the demand table reference the sys_user table, all you need in the producer script is 

current.collaborators = producer.catalog_item_owner;

You could also try mapping the variable to the field with the checkbox on the variable definition, even though these are different types it might still work.

View solution in original post

3 REPLIES 3

Brad Bowman
Kilo Patron
Kilo Patron

Because names are not unique (first name + last name in this case) don't use getDisplayValue().  You know you are selecting the correct user in the Catalog Item Owner variable since you have a reference qualifier to limit the selections to gi.  Since this variable is a reference, and both the reference variable and the list field on the demand table reference the sys_user table, all you need in the producer script is 

current.collaborators = producer.catalog_item_owner;

You could also try mapping the variable to the field with the checkbox on the variable definition, even though these are different types it might still work.

Community Alums
Not applicable

Thank you so much Brad Bowman 😞  its working for me ... i learned from you one new solution 

Thank you So much 

 

Thnaks & Regards,

bandi

You are welcome!