Load the logged in User name into a Variable Set

Luis Henrique1
Tera Contributor

Hey guys!

Has anyone done any development with the following requirement:

 

This POST was edited: 

I have 2 RECORD PRODUCERS. In the first RP, the user will answer some questions and submit. The information as we know it will be saved in the destination table that we previously defined.

In the second RECORD PRODUCER, I have some unique fields from it. However, I also have a variable of type reference, which takes the numbers of the records created in the first RP. In other words, I have information about the fields of each record. And according to the number selected by the user, I can populate the fields according to some responses from the first RP.

 

As an example, if in RP1 I fill in a choice field as "Yes", a certain field in RP2 will be filled in with that value and display another field. (This already works through a Script Include - Client Callable and a Client Script that makes the GLIDEAJAX call, when the field changes).

 

The current requirement, in some way, meets what was previously described. In this second RECORD PRODUCER, I have an MRVS created, with a reference type variable for sys_user.

When a certain checkbox type field (in RP1) is marked, I need to fill in this MRVS with the logged in user record. My question is: Can I accomplish this with the same Script Include + Client Script process? Even though it is MRVS, because I did the other cases with variables only.

5 REPLIES 5

johnfeist
Mega Sage
Mega Sage

Hi Luis,

 

If I'm understanding your issue, you have the correct value being inserted On Load.  If that is what need to be there, I'd say that in your On Load as part of the processing, just make that variable read only.  If you can't do that, add an On Change rule that will take care of these two situations:

  • if isLoading is true, apply your On Load logic (having turned off the on load script)
  • if the value is changed have your script replace the value with oldValue

And if you want to be really diligent, include a business rule, before insert, that enforces the requirement about the user.

 

Please let me know if I've missed your issue.

Hope that helps.

:{)

Helpful and Correct tags are appreciated and help others to find information faster

Hi, @johnfeist ! 

 

thanks for your response.

I believe I explained it in a confusing way.

 

I will try to explain the requirement again.

I have 2 RECORD PRODUCERS. In the first RP, the user will answer some questions and submit. The information as we know it will be saved in the destination table that we previously defined.

In the second RECORD PRODUCER, I have some unique fields from it. However, I also have a variable of type reference, which takes the numbers of the records created in the first RP. In other words, I have information about the fields of each record. And according to the number selected by the user, I can populate the fields according to some responses from the first RP.

 

As an example, if in RP1 I fill in a choice field as "Yes", a certain field in RP2 will be filled in with that value and display another field. (This already works through a Script Include - Client Callable and a Client Script that makes the GLIDEAJAX call, when the field changes).

 

The current requirement, in some way, meets what was previously described. In this second RECORD PRODUCER, I have an MRVS created, with a reference type variable for sys_user.

When a certain checkbox type field (in RP1) is marked, I need to fill in this MRVS with the logged in user record. My question is: Can I accomplish this with the same Script Include + Client Script process? Even though it is MRVS, because I did the other cases with variables only.

AnimeshP_96
Tera Guru

Hey @Luis Henrique1 
for the onload script you can use onchange client script 

In this function write the code : g_user.userID(); or if server side use gs.getUserID() and return from script include to client script. 
if (isLoading || newValue === '') {
return;
}


Please accept the solution /mark this response as correct or helpful if it assisted you with your question.




Regards,
Animesh

Hi @AnimeshP_96 

thanks for your response.

I believe I explained it in a confusing way.

 

I will try to explain the requirement again.

I have 2 RECORD PRODUCERS. In the first RP, the user will answer some questions and submit. The information as we know it will be saved in the destination table that we previously defined.

In the second RECORD PRODUCER, I have some unique fields from it. However, I also have a variable of type reference, which takes the numbers of the records created in the first RP. In other words, I have information about the fields of each record. And according to the number selected by the user, I can populate the fields according to some responses from the first RP.

 

As an example, if in RP1 I fill in a choice field as "Yes", a certain field in RP2 will be filled in with that value and display another field. (This already works through a Script Include - Client Callable and a Client Script that makes the GLIDEAJAX call, when the field changes).

 

The current requirement, in some way, meets what was previously described. In this second RECORD PRODUCER, I have an MRVS created, with a reference type variable for sys_user.

When a certain checkbox type field (in RP1) is marked, I need to fill in this MRVS with the logged in user record. My question is: Can I accomplish this with the same Script Include + Client Script process? Even though it is MRVS, because I did the other cases with variables only.