Using JavaScript to Perform an Inquiry on a Form upon Initialization

 6 Replies
 0 Subscribed to this topic
 12 Subscribed to this forum
Sort:
Author
Messages
pklupa
Basic Member Send Private Message
Posts: 5
Basic Member
Hi Everyone, I have created a custom form using the CASE tool with two key fields - company and employee. The company is always 0001 and I can get the employee from the user profile: var vEmployee = portalWnd.oUserProfile.getAttribute("employee") I am setting up this form so that when a user logs into the form, the company and the user's employee number are pre-populated in the key fields. I have made these fields output-only, so the user cannot perform an inquiry or update any other user's data. My question is this - how can I have this form perform an inquiry upon initialization (OnInit) using the pre-populated the key fields so all of the rest of the fields on the screen are populated without the user having to hit the inquire button? Thank you for your help!
David Williams
Veteran Member Send Private Message
Posts: 1127
Veteran Member
Include the command: lawformDoFunction("I") That will peform the inquire.
David Williams
KK - Infor
Veteran Member Send Private Message
Posts: 61
Veteran Member
Or, Select Inquire under 'Initial Form action' in Custom (form properties)
David Williams
Veteran Member Send Private Message
Posts: 1127
Veteran Member
KK - I thought of that too but I wasn't sure if that occured before or after the On Init script. Have you done this before?
David Williams
David Williams
Veteran Member Send Private Message
Posts: 1127
Veteran Member
Also, if you take the Inquire option off from the allowed functions, can you use it as the form initial action?
David Williams
pklupa
Basic Member Send Private Message
Posts: 5
Basic Member
Hi David & KK - thank you both very much for your help. The info on David's first reply (lawformDoFunction("I")) did the trick. Thank you! Patrick Klupa
KK - Infor
Veteran Member Send Private Message
Posts: 61
Veteran Member
David, #1 - It works! #2 - Yes, this will also work.