while select InvoicedNow from PSAProjProposalProj
join projProposalJourds
where PSAProjProposalProj.ProjProposalId ==projProposalJourds.ProposalId
{
if( PSAProjProposalProj.InvoicedNow <= 0)
{
}
}
[ExtensionOf(formControlstr(ProjInvoiceProposalDetail,ProjFormLetter_Invoice))]
final class DTInvoicepropCreditnt_Extension
{
public void clicked()
{
FormButtonControl formButtonControl = any2Object(this) as FormButtonControl;
FormDataSource formDatasource = formButtonControl.formRun().dataSource(tableStr(ProjProposalJour));
ProjProposalJour projProposalJourds = formDatasource.cursor();
FormControl formControl = formButtonControl;
FormRun formRun = formControl.formRun();
FormStringControl ReasonCode = formRun.design().controlName(formControlStr(ProjInvoiceProposalDetail, Reason_M_editReasonCode )) as FormStringControl ;
PSAProjProposalProj pSAProjProposalProj;
ProjParameters projParameters;
select firstonly projParameters;
while select InvoicedNow from PSAProjProposalProj
join projProposalJourds
where PSAProjProposalProj.ProjProposalId ==projProposalJourds.ProposalId
{
if( PSAProjProposalProj.InvoicedNow <= 0)
{
//formDatasource.object(methodStr(ProjProposalJour,editReasonCode)).mandatory(projParameters.DTReasonCodeMandatory);
//formDatasource.object(fieldNum(ProjProposalJour, PaymMode)).mandatory(projParameters.DTOriginalInvoiceMandatory);
if(projParameters.DTOriginalInvoiceMandatory == NoYes::Yes && projProposalJourds.PaymMode == '')
{
throw error("The method of payment field is mandatory. Cannot proceed further.");
}
if(projParameters.DTReasonCodeMandatory == NoYes::Yes && ReasonCode == null)
{
throw error("The Reason Code field is mandatory. Cannot proceed further.");
}
}
}
next clicked();
}
}
controlName(formControlStr(ProjInvoiceProposalDetail, Reason_M_editReasonCode ))
[ExtensionOf(formControlstr(ProjInvoiceProposalDetail,ProjFormLetter_Invoice))]
final class DTInvoicepropCreditnt_Extension
{
public void clicked()
{
FormButtonControl formButtonControl = any2Object(this) as FormButtonControl;
FormDataSource formDatasource = formButtonControl.formRun().dataSource(tableStr(ProjProposalJour));
ProjProposalJour projProposalJourds = formDatasource.cursor();
ProjParameters projParameters;
select firstonly projParameters;
formDatasource.object(methodStr(ProjProposalJour,editReasonCode)).mandatory(projParameters.DTReasonCodeMandatory);
formDatasource.object(fieldNum(ProjProposalJour, PaymMode)).mandatory(projParameters.DTOriginalInvoiceMandatory);
if(projParameters.DTOriginalInvoiceMandatory == NoYes::Yes && projProposalJourds.PaymMode == '')
{
throw error("The method of payment field is mandatory. Cannot proceed further.");
}
if(projParameters.DTReasonCodeMandatory == NoYes::Yes && projProposalJourds.ReasonCode == '')
{
throw error("The Reason Code field is mandatory. Cannot proceed further.");
}
next clicked();
}
}
[ExtensionOf(formControlstr(ProjInvoiceProposalDetail,ProjFormLetter_Invoice))]
final class DTInvoicepropCreditnt_Extension
{
public void clicked()
{
FormButtonControl formButtonControl = any2Object(this) as FormButtonControl;
FormDataSource formDatasource = formButtonControl.formRun().dataSource(tableStr(ProjProposalJour));
ProjProposalJour projProposalJourds = formDatasource.cursor();
ProjParameters projParameters = ProjParameters::find();
//purchTable.reread();
formDatasource.object(fieldNum(ProjProposalJour, ReasonCode)).mandatory(projParameters.DTOriginalInvoiceMandatoryReasonCode);
formDatasource.object(fieldNum(ProjProposalJour, PaymMode)).mandatory(projParameters.DTOriginalInvoiceMandatory);
if(projParameters.DTOriginalInvoiceMandatory && projProposalJourds.PaymentMethod == '')
{
throw error("The method of payment field is mandatory. Cannot proceed further.");
}
if(projParameters.DTOriginalInvoiceMandatoryReasonCode && projProposalJourds.ReasonCode == '')
{
throw error("The Reason Code field is mandatory. Cannot proceed further.");
}
next clicked();
}
}
[ExtensionOf(formControlstr(ProjInvoiceProposalDetail,ProjFormLetter_Invoice))]
final class DTInvoicepropCreditnt_Extension
{
public void clicked()
{
FormButtonControl formButtonControl = any2Object(this) as FormButtonControl;
FormDataSource formDatasource = formButtonControl.formRun().dataSource(tableStr(ProjProposalJour));
ProjProposalJour projProposalJourds = formDatasource.cursor();
ProjParameters projParameters;
//purchTable.reread();
if(projParameters.DTOriginalInvoiceMandatory == NoYes::Yes)
{
projProposalJourds.object(fieldNum(ProjProposalJour, PaymMode)).mandatory(true);
throw error("The method of payment field is mandatory. Cannot proceed further.");
}
if(projParameters.DTOriginalInvoiceMandatory == NoYes::Yes)
{
projProposalJourds.object(fieldNum(ProjProposalJour, PaymMode)).mandatory(true);
throw error("The Reason Code field is mandatory. Cannot proceed further.");
}
next clicked();
}
}
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,151 Super User 2024 Season 2
Martin Dráb 229,993 Most Valuable Professional
nmaenpaa 101,156