i haven’t wrote anything else , this is the only line i have added in the run method , here is the complete code :
void run()
{
SalesUpdate recommendedQty;
SysDictEnum salesUpdateEnum = new SysDictEnum(enumnum(SalesUpdate));
BoxFormOnce box;
custtable custtable;
;
super();
salesEditLinesForm.setupSumByControl(sumBy, salesParmUpdate.SpecQty, salesParmUpdate.SumBy);
if (salesParmUpdate.ParmId)
{
element.lock();
if (salesParmUpdate.LateSelection)
{
if (salesParmUpdate.LateSelectionQuery)
salesFormLetter.queryChooseLines(new QueryRun(salesParmUpdate.LateSelectionQuery));
element.initQuery();
}
salesFormLetter.setSalesEditLinesDataSource(salesParmTable_ds);
print_Combo.selection (salesFormLetter.printout());
printFormletter.value (salesFormLetter.printFormLetter());
printCODLabelChoice = (salesFormLetter.printCODLabel());
printCallTagChoice = (salesFormLetter.printFreightSlip());
printShippingLabelChoice = (salesFormLetter.printShippingLabel());
usePrintManagement.value (salesFormLetter.usePrintManagement());
this.setFieldAccess();
reArrangeNow = (salesFormLetter.reArrangeNow());
editLinesChanged = (salesFormLetter.editLinesChanged());
custAccountInQuery = (salesFormLetter.custAccountInQuery());
invoiceAccountInQuery = (salesFormLetter.invoiceAccountInQuery());
element.sumByChanged(true);
if (documentStatus == DocumentStatus::Invoice)
{
if (salesFormLetter.salesTable())
{
if (salesFormLetter.defaultGiroType())
salesParmUpdate.GiroType = PaymentStubInclAll::All;
else
salesParmUpdate.GiroType = salesFormLetter.giroType() + 0;
}
else
{
salesParmUpdate.GiroType = CustFormletterParameters::find().GiroOnInvoice + 0;
}
salesFormLetter.giroType (salesParmUpdate.GiroType + 0);
salesFormLetter.defaultGiroType (salesParmUpdate.GiroType == PaymentStubInclAll::All);
salesParmUpdate_ds.refresh();
}
element.design().caption (salesEditLinesForm.editingCaption());
salesParmUpdate_ds.object(fieldnum(SalesParmUpdate, RespiteDate)).visible(salesEditLinesForm.respiteDate());
salesParmTable_TransDate.label (salesEditLinesForm.transDateCaption());
printFormletter.label (salesEditLinesForm.formLetterCaption());
buttonPrintFormletter.text (salesEditLinesForm.formLetterButtonCaption());
buttonPrintFormletterCopy.text (salesEditLinesForm.formLetterButtonCaptionCopy());
salesParmUpdate_ds.object(fieldnum(SalesParmUpdate, Storno)).visible(salesEditLinesForm.correct());
warehouseManagement.visible (salesEditLinesForm.wmsOrder());
salesParmTable_ds.object(fieldnum(SalesParmTable, FixedDueDate)).visible (salesEditLinesForm.fixedDueDate());
salesParmUpdate_ds.object(fieldnum(SalesParmUpdate, Reserve)).visible (salesEditLinesForm.reserve());
salesParmUpdate_ds.object(fieldnum(SalesParmUpdate, Reserve)).allowEdit (salesEditLinesForm.editReserve());
salesParmUpdate_ds.object(fieldnum(SalesParmUpdate, Reserve)).skip (!salesEditLinesForm.editReserve());
salesParmLine_ds.object(fieldnum(SalesParmLine, Closed)).visible (salesEditLinesForm.close());
salesParmUpdate_ds.object(fieldnum(SalesParmUpdate, CreditRemaining)).visible(salesEditLinesForm.creditRemaining());
salesParmLine_ds.object(fieldnum(SalesParmLine, RemainAfter)).allowEdit (salesEditLinesForm.editRemainAfter());
salesParmLine_ds.object(fieldnum(SalesParmLine, RemainAfter)).skip (!salesEditLinesForm.editRemainAfter());
buttonPaymentSched.visible (salesEditLinesForm.paymentSched());
buttonPaymentSched.enabled (salesFormLetter.salesTable().PaymentSched != ‘’);
buttonSelectJournal.visible (salesEditLinesForm.selectJournalButton());
buttonSelectJournal.enabled (salesParmUpdate.SpecQty == SalesUpdate::PackingSlip);
updateNow.enabled (salesFormLetter.enableUpdateNowField());
print_Combo.enabled (!salesFormLetter.proforma());
salesParmTable_inventSiteId.visible (salesParmUpdate.SplitSite == NoYes::Yes);
choose.visible (salesEditLinesForm.choose());
sumBy.visible (salesEditLinesForm.sumBy());
creditMax.visible (salesEditLinesForm.creditMax());
buttonSalesTotals.visible (salesEditLinesForm.salesTotals());
salesParmTable_ds.allowCreate (salesEditLinesForm.allowCreate_ParmTable() && !salesParmUpdate.LateSelection);
salesParmLine_ds.allowCreate (salesEditLinesForm.allowCreate_ParmLine() && !salesParmUpdate.LateSelection);
salesParmTable_ds.object(fieldnum(SalesParmTable, ProjId)).visible (salesEditLinesForm.projId());
salesParmTable_ds.object(fieldnum(SalesParmTable, CustBankAccountId)).visible (salesEditLinesForm.custBankAccountId());
salesParmTable_ds.object(fieldnum(SalesParmTable, CustBankAccountId)).allowEdit (salesEditLinesForm.custBankAccountIdAllowEdit());
salesParmTable_ds.object(fieldnum(SalesParmTable, CustBankAccountId)).skip (!salesEditLinesForm.custBankAccountIdAllowEdit());
qtyToPickInSalesUnit.visible (salesEditLinesForm.qtyToPickInSalesUnit());
switch (documentStatus)
{
case DocumentStatus::PackingSlip :
groupShipments.visible(salesFormLetter.useShippingStat());
break;
case DocumentStatus::Invoice :
groupShipments.visible(salesFormLetter.useShippingStat());
break;
default :
groupShipments.visible(false);
buttonSalesShippingLine.visible(false);
}
shippingEnabled = buttonSalesShippingLine.visible();
if (salesFormLetter.showQueryForm() && !salesFormLetter.createFromHistory())
buttonSalesShippingLine.enabled(false);
tabSalesParmSubLine.visible(salesEditLinesForm.subLine());
element.unLock();
if (SalesParameters::find().PromptQty && !salesFormLetter.lockSalesUpdateField())
{
recommendedQty = salesFormLetter.recommendedSpecQty();
if(recommendedQty!=specQty.selection())
{
boxFormOnceIsActive = true;
box = BoxFormOnce::construct();
box.parmDialogBoxType(DialogBoxType::YesNoBox);
box.parmDialogButton(DialogButton::Yes);
box.parmTitle("@SYS59372");
box.parmText(strfmt("@SYS102340", salesUpdateEnum.index2Name(specQty.selection()), salesUpdateEnum.index2Name(recommendedQty)));
box.parmOwner(new SysDictClass(classidget(salesEditLinesForm)).name());
if(box.prompt() == DialogButton::Yes)
{
specQty.selection(recommendedQty);
specQty.selectionChange();
}
boxFormOnceIsActive = false;
}
}
}
element.setFieldAccess();
element.specQtyChanged();
editLinesChanged = false;
//modified by Shubham Sharma
//Custtable::find(custtable.smylHexPrefComm);
//custtable = element.args().record();
Box::info(strfmt(“Customer’s preferred method of communication is %1”,custtable.smylHexPrefComm));
}