JmgJobBundleStartup Class [AX 2012]
Retrieves startup information from a user about jobs that an employee should start working on.
| Method | Description | |
|---|---|---|
| cancelTimeOut | Cancels a previous method call to the setTimeOut method. (Inherited from Object.) |
| equal | Determines whether the specified object is equal to the current one. (Inherited from Object.) |
| getTimeOutTimerHandle | Returns the timer handle for the object. (Inherited from Object.) |
| handle | Retrieves the handle of the class of the object. (Inherited from Object.) |
| new | Creates a new instance of the JmgJobBundleStartup Class. |
| notify | Releases the hold on an object that has called the wait method on this object. (Inherited from Object.) |
| notifyAll | Releases a lock on the object that was issued by the wait method on this object. (Inherited from Object.) |
| objectOnServer | Determines whether the object is on a server. (Inherited from Object.) |
| owner | Returns the instance that owns the object. (Inherited from Object.) |
| run | Runs the relevant startup form based on the type of bundle. |
| setTimeOut | Sets up the scheduled execution of a specified method. (Inherited from Object.) |
| toString | Returns a string that represents the current object. (Inherited from Object.) |
| usageCount | Returns the current number of references, that is, the value of the reference counter, that the object has. (Inherited from Object.) |
| wait | Pauses a process. (Inherited from Object.) |
| xml | Returns an XML string that represents the current object. (Inherited from Object.) |
| ::main | Provides an entry point for the JmgJobBundleStartup class when it is called from a menu item. |
Run this class by using the JmgJobBundleStartup::main method. A startup form is shown based on a JmgJobBundle object. The information given by the user is stored in the JmgJobBundle object. Whether the user canceled the startup form is stored in the Args object, which is supplied to the main method.
The following example shows how to prompt the user for a project category when they create a start registration on a project job. It creates a start registration for the specified employee on project job 10000567, and then prompts the user for the cost category. If the startup form is approved, the entered cost category is displayed.
JmgJobBundle jmgJobBundle;
Args args;
MapIterator mapIterator;
JmgRegistrationParameters regParams;
jmgJobBundle = new JmgJobBundle(jmgWorkerRecId);
jmgJobBundle.addJob(JmgJobTable::find('10000567'));
args = new Args(); args.parmObject(jmgJobBundle);
JmgJobBundleFeedback::main(args);
// Check to see if the user canceled the startup form.
if (args.parmEnum() == NoYes::Yes)
{
info("You canceled the startup form.");
}
else
{
// Display the cost category entered by the user on the jobs to start.
mapIterator = jmgJobBundle.getNewJobsIterator();
while (mapIterator.more())
{
regParams = jmgJobBundle.getStartupParameters(mapIterator.key());
info(strFmt(
"You entered: %1 in cost category for job id: %2",
regParams.costCategory(),
mapIterator.key()));
}
}