static void openMap(Args _args)
{
LogisticsPostalAddress address;
LogisticsAddressDateEffectiveMap addressMap;
if (_args.record())
{
if (_args.dataset() == tablenum(LogisticsPostalAddress))
{
address = _args.record();
}
else if (SysDictTable::isTableMapped(tablenum(LogisticsAddressDateEffectiveMap), _args.dataset()))
{
addressMap = _args.record();
address = LogisticsPostalAddress::findByLocation(addressMap.Location);
}
if (address)
{
DirPartyPostalAddressView::mapIt(address);
}
}
}
case LogisticsLocationAddressActionButtons::Map :
LogisticsPostalAddressFormHandler::openMap(_args);
break;
class LogisticsEntityPostalAddressFormHandler extends LogisticsEntityLocationFormHandler
{
/// <summary>
/// Called by the menu items form the caller forms not from the Manage Address form.
/// </summary>
/// <param name="_args">
/// The <c>Args</c> object that is passed from the menu item.
/// </param>
/// <param name="_showForm">
/// A Boolean value that specifies whether to show the form.
/// </param>
public static void main(Args _args, boolean _showForm = true)
{
LogisticsEntityPostalAddressFormHandler addressController;
FormRun callerForm;
Object callerObject;
Common callerRecord;
if (_args.parmEnumType() == enumnum(LogisticsLocationAddressActionButtons))
{
callerForm = _args.caller();
if (callerForm && formHasMethod(callerForm, identifierstr(getAddressController)))
{
callerObject = callerForm;
addressController = callerObject.getAddressController();
_args.parmObject(addressController);
}
switch (_args.parmEnum())
{
case LogisticsLocationAddressActionButtons::New :
case LogisticsLocationAddressActionButtons::Edit :
case LogisticsLocationAddressActionButtons::Advanced :
LogisticsEntityPostalAddressFormHandler::openForm(_args, _showForm);
break;
case LogisticsLocationAddressActionButtons::Delete :
addressController.delete();
break;
case LogisticsLocationAddressActionButtons::Deactivate :
callerRecord = addressController.getCallerRecord();
boolean isDefaultAddress = false;
EventHandlerResult result = new EventHandlerResult();
LogisticsEntityPostalAddressFormHandler::getDelegateCaller().checkIsAddressDefault_delegate(callerRecord, addressController.postalAddress(), result);
if (result.result() != null)
{
isDefaultAddress = result.result();
}
if(isDefaultAddress)
{
if (Box::yesNo("@SYS344641", DialogButton::No) == DialogButton::Yes)
{
addressController.deactivate(callerRecord, true);
}
}
else
{
addressController.deactivate(callerRecord);
}
break;
case LogisticsLocationAddressActionButtons::Map :
LogisticsPostalAddressFormHandler::openMap(_args);
break;
}
}
}
}
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,269 Super User 2024 Season 2
Martin Dráb 230,198 Most Valuable Professional
nmaenpaa 101,156