- create new class
class newclass
{
}
public static void main(Args _args)
{
#Task
FormDataSource fds;
FormRun formrun=_args.caller();
Str Postion;
fds = _args.record().dataSource();
{
#Task
FormDataSource fds;
FormRun formrun=_args.caller();
Str Postion;
fds = _args.record().dataSource();
try
{
ttsBegin;
for (smmActivities = fds.getFirst(true) ? fds.getFirst(true) : fds.cursor(); smmActivities; smmActivities = fds.getNext())
{
smmActivitiesUpdate = smmActivities::find(smmActivities.ActivityNumber, true);
if(smmactivitiesUpdate.EnumYesnoField == NoYes::Yes)// check if field is already yes then throw warning
{
ttsAbort;
ret = false;
throw warning("already yes");
}
else
{
Position = smmActivitiesUpdate.ActivityNumber;
smmactivitiesUpdate.EnumYesnoField =NoYes::Yes;
smmactivitiesUpdate.update();
}
}
ttsCommit;
ret = true;
if(formrun)
{
formrun.task(#taskF5);
fds.findRecord(smmActivities::find(Position));
}
}
catch
{
ret = false;
}
{
ttsBegin;
for (smmActivities = fds.getFirst(true) ? fds.getFirst(true) : fds.cursor(); smmActivities; smmActivities = fds.getNext())
{
smmActivitiesUpdate = smmActivities::find(smmActivities.ActivityNumber, true);
if(smmactivitiesUpdate.EnumYesnoField == NoYes::Yes)// check if field is already yes then throw warning
{
ttsAbort;
ret = false;
throw warning("already yes");
}
else
{
Position = smmActivitiesUpdate.ActivityNumber;
smmactivitiesUpdate.EnumYesnoField =NoYes::Yes;
smmactivitiesUpdate.update();
}
}
ttsCommit;
ret = true;
if(formrun)
{
formrun.task(#taskF5);
fds.findRecord(smmActivities::find(Position));
}
}
catch
{
ret = false;
}
- Add action menu item to form
- set data source to smmActivities
No comments:
Post a Comment