Hi,
I have to add an info box on the vendor Payment Proposal, before create Payment i need an info box where some static value show with selected invoices Amount (sum of specTrans.Balance01), on the click on Yes in the info box, payment will be created as per standard, but if we click on No button on the info box, it stays as same screen of Proposal.
Can anyone please suggest me that which blog i need to prefer and how can i solve it using x++ in D365fo?
Hope the issue is resolved. Please take time to mark the useful answers as verified. So, others can make use of this thread.
Thanks,
Girish S.
Thank you Girish .
Sam D.
I think restriction of payment proposal when clicking No button cannot be done with existing button.
You need to hide the standard Payment proposal button and create one custom button - On the On Clicked event handler you add the same code as you have written above.
If user clicks Yes go ahead and create payment proposal (Call the logic for payment proposal). If No throw a warning.
Thanks,
Girish S.
Thank you, Girish,
This code really helps me to create an info box.
But I am facing an issue while click on "NO" in info box, It is also creating Payment Proposal instead cancel the Payment and stay at same screen.
str strMsg = "The total amount to Pay" + any2Str(AmountVal);
dialogBtn = Box::yesNo(strMsg, DialogButton::No);
if(dialogBtn == dialogButton::Yes)
{
}
next clicked();
if(dialogBtn == dialogButton::Yes)
{
}
else
{
Info("Cancelled");
}
I need when click on "YES" , It will create Payment Proposal as standard, but when click on "NO" , It will cancel Payment Proposal and stay as same screen to edit amount.
But , what is going on when we click on "NO" it is also creating Payment Proposal.
Just try to pass the total amount to the 2nd parameter on the Box::yesNoCancel method.
DialogButton diagBut; str amountvalue = int2str(25);//pass the total amount value create a label id like "Amount is %1" str strMessage = strfmt("LabeLid", amountValue); str strTitle = "Title"; diagBut = Box::yesNoCancel( strMessage, ialogButton::No, strTitle); if (diagBut == DialogButton::No) { info(“Operation stoped.”); } else if(diagBut == DialogButton::Yes) { Info(“button click code here”); } else { info(“canceled”); }
Thanks,
Girish S.
Thank you, Girish, maybe it will be work, but how can I get sum of total amount for selected invoices and show it on the Info box.
because I didn't get how can i show sum of selected invoices Amount on Box?
Hi Sam,
Refer to the below blog which might help your scenario.
Thanks,
Girish S.
André Arnaud de Cal...
291,996
Super User 2025 Season 1
Martin Dráb
230,853
Most Valuable Professional
nmaenpaa
101,156