Sample Scenario 7: Adding Information to a Record
In this scenario, you want to notify a credit manager that a new customer is added and ask the credit manager to determine what is the credit limit for that customer. So, you must send a notification that prompts the credit manager for a response and then uses the data from that response to add data to the pending new customer record and commit the changes to the database.
For this scenario:
- Use the same global constant (CreditMgr) the you used for previous scenarios.
- Use the IdoOnItemInsert framework event.
To accomplish this scenario:
When creating this event handler, keep these points in mind:
- Because the variables are listed on the Variables tab and the question and response buttons are on the Response tab of the message, you should design your message body to include brief but detailed instructions for responding to the request. Do not assume the recipient knows or remembers.
- Because you did not specify variable access rules to address property variables other than the CreditLimit variable, all the variable property values associated with the Customers form are displayed and writable. That means that the credit manager, if desired, can change any variable data before saving and posting the data to the database by clicking . To make other variables non-writable, you must set the variable access for each individually.
- The fact that the prompt message is sent to a single recipient means that only one vote is required for a quorum. Once the credit manager posts the response, the vote is final and the database is updated. If there are multiple recipients associated with the CreditMgr global constant, then you also need to set voting rules to determine how the responses are handled. In this case, it is not necessary, because the system assumes a Plurality voting rule, and with only one recipient, that means that the first to respond is the one whose data is committed.
- If the credit manager never votes, the record is never committed to the database, but remains adjourned indefinitely.
- The QUESTION parameter has a limit of 80 characters.