You are viewing limited content. For full access, please sign in.

Question

Question

Using a lookuprule return value in a form

asked on July 23, 2020

I have a scenario where my lookup rules returns the username for an employee . But in order to use them in the user task as per forms 10.2 the To field needs to have the username prefixed with "ADS".

 

So if the lookuprule return value is employeeX i need to prefix the return value with "ADS\employeeX "as the username.

How can i do this on the forms using a formula on the field? 

Am trying it on js side but no luck.

 

 

 

0 0

Answer

SELECTED ANSWER
replied on July 24, 2020

I agree with Maher that you should have SQL return it if possible.

However in Forms you can add a single-line field and use the field formulas to prepend the ADS. You can use the below formula, but replace UsernameField with the variable of the field that gets the username from SQL:

="ADS\" & UsernameField

 

1 0
replied on July 24, 2020

Yes am going to create a SP but will have to wait till Monday to get my permission on the DB. Just for a quick try.....

tele_empuser is the field which already has the username from a form lookup. Am just trying to add ADS\ prefixing it. 

 

Tried the below.... not sure if i missed any syntax.... it's not adding the \ADS. Am i missing something? Thanks for your input again!

 

 

0 0
replied on July 24, 2020

Is tele_empuser the variable name? It worked for me.

 

1 0
replied on July 24, 2020

Yes Jim, i did some spacing incorrectly. It worked for me. Thanks for verifying! 

1 0

Replies

replied on July 23, 2020

Hello Rekha,

 

What i suggest, creating a stored procedure that return from the database ADS\employeeX instead of doing it in the form.

It will be simpler and without any additional JS, because if you are doing it your way, you need to use on "lookupcomplete" event in the JS.

Hope it helps.

Maher.

1 0
replied on July 24, 2020

Thanks Maher! Yes will have to wait till Monday to get permission on the db to create a SP . Thanks for the suggestion. 

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.