Record producer on incident table -- need to map caller_id on the form to the caller_is on the incident form

sonita
Giga Guru

I have created a record producer on the incident table. There is field called 'Ask on behalf of this user' on the record producer.

find_real_file.png

if the field is left blank when submitting the form , the 'caller' field on the incident should be filled with the person who is filling the form ( i think it would be gs.getUserID();)--> NOT WORKING

find_real_file.png

BUT , if the filed is not blank and is filled with someone , on the incident form , the caller field should be filled with that person's name. --> this part works

This is my code:

if(producer.bahalf_of_this_user=='')

{

  current.caller = gs.getUserID();

}

else

current.caller_id=producer.behalf_of_this_user;

MY question--> if the filed on record producer is left blank , the caller on the incident is blank as well , but it should show the person's name who actually filled the form.

Any ideas please?

1 ACCEPTED SOLUTION

Uncle Rob
Kilo Patron

Was that a copy / paste?   Because it seems there's some typos.   Here's how I'd write it.



if(producer.behalf_of_this_user){


  current.caller_id = gs.getUserID();


} else {


  current.caller_id=producer.behalf_of_this_user;


}


View solution in original post

3 REPLIES 3

Uncle Rob
Kilo Patron

Was that a copy / paste?   Because it seems there's some typos.   Here's how I'd write it.



if(producer.behalf_of_this_user){


  current.caller_id = gs.getUserID();


} else {


  current.caller_id=producer.behalf_of_this_user;


}


Nice catch


Yes!! that was the problem! must be so tired! nice catch!!! Thank you!