Home / Educational Content / PeopleSoft / Yes / No Message Box

Yes / No Message Box

Supplier OB
Cory Flowers, Quest Guest Blogger | Blog content sourced from Ps_App_Development

So this question came up last week, can we create a Yes / No message box within the Supplier On-Boarding process to add additional User Id’s or navigate back to the sign on page? As it turns out, with some testing and placing the PeopleCode in the correct location, I was able to do just that.

First thing’s first, I had to create the User Id and press submit. Once I did that, I wanted the message box to pop up and prompt the supplier if they would like to create another User Id for their company.

Supplier%2BOb.png

This is a custom page created to allow existing Suppliers within our system to create a User Id and log into the supplier portal. Once I select the Submit button, the message box prompts the user if they would like to create another user.

Yes_No.png0

Here is the PeopleCode, and how it processes upon the selection of the Supplier.

So in this first section, you are trapping the &Answer the supplier selects.

Local Any &Answer;

&Answer = MessageBox(%MsgStyle_YesNo, “”, 0, 0, “Would you like to create another Supplier ID for your company?”);

In this section, you are going to evaluate the &Answer and process the information accordingly. The &Answer will be either 6 or 7. If the answer is 6, it will equal Yes. If the answer is 7, the answer will equal No.

If &Answer = “7” Then

/* Insert the role that allows user access to the portal*/;

SQLExec(“INSERT INTO PSROLEUSER (ROLEUSER, ROLENAME, DYNAMIC_SW) VALUES(:1, ‘ROLE_NAME’, ‘Y’)”, &OPRID);

/* Get the database you are logged into. */;

&DB_ID = Upper(&DB_ID);

/* Evaluate the database and send the user to the correct log in location. */;
/* You will need to create URL definitions for this section. */;

Evaluate &DB_ID
When = “Production”
&URL_ID = GetURL(URL.Production);
%Response.RedirectURL(&URL_ID);;
When = “Fix”
&URL_ID = GetURL(URL.Fix);
%Response.RedirectURL(&URL_ID);
When = “Test”
&URL_ID = GetURL(URL.Test);
%Response.RedirectURL(&URL_ID);;
When = “Development”
&URL_ID = GetURL(URL.Development);
%Response.RedirectURL(&URL_ID);
End-Evaluate;

Else

/* Insert the role that allows user access to the portal*/;

SQLExec(“INSERT INTO PSROLEUSER (ROLEUSER, ROLENAME, DYNAMIC_SW) VALUES(:1, ‘ROLE_NAME’, ‘Y’)”, &OPRID);

/* Clear all fields to allow the user to create additional User Id’s for their company */;

SUP_OB_USR_REG.OPRID = ” “;
SUP_OB_USR_REG.SUP_OB_OPERPSWD = ” “;
SUP_OB_GRP_WRK.SOB_PSWD = ” “;
SUP_OB_USR_REG.DESCR = ” “;
SUP_USR_REG2.HINT_QUESTION = ” “;
SUP_USR_REG2.HINT_RESPONSE = ” “;
SUP_OB_USR_REG.EMAILID = ” “;
AUC_BID_REG_ITM.AGREE_TO_TERMS = “N”;

End-If;

 

Yes / No Message Box