简体   繁体   English

在 x++ 中,如何对我选择的不同客户的数值求和?

[英]In x++, How can I sum the numerical values of the different customers I have chosen?

How can I sum the numerical values of the different customers I have chosen?如何将我选择的不同客户的数值相加?

For example:例如:

e006-M000021 total amount = 1,605.00+1605.00+1605.00+(-96.00)+... e006-M000021 总金额 = 1,605.00+1605.00+1605.00+(-96.00)+...
e006-M000022 total amount = 5,964.85+(-1,075.00)+5.541.60+... e006-M000022 总金额 = 5,964.85+(-1,075.00)+5.541.60+...

在此处输入图像描述

I will use the result as follows;我将使用结果如下;

These records are also in my caller form.这些记录也是我的来电者形式。 After selecting these records, I want the textbox in the new form I opened with the button to be选择这些记录后,我希望用按钮打开的新表单中的文本框是

e006-M000021 total amount = XXX, e006-M000021 总金额 = XXX,
e006-M000022 total amount = XXX. e006-M000022 总金额 = XXX。

Now I can transfer the selected record and the values of the record to the textbox in the called form.现在我可以将选定的记录和记录的值传输到被调用表单中的文本框中。 But I am not able to sum the amounts corresponding to multiple and customer IDs.但我无法汇总与多个客户 ID 对应的金额。

My called form init method code:我调用的表单init方法代码:

    public void init()
    {    
       super();    
       if( element.args() && element.args().dataset() == tableNum(ARCSendSmsCustomerTmp))    
       {    
           Callertmp = element.args().record();    
       }    
       ////username and password are pulled from dealer parameters.    
       ARCDealerSmsParameters = ARCDealerSmsParameters::find();    
       ctrlUsername.text(ARCDealerSmsParameters.DealerUsername);    
       ctrlPassword.text(ARCDealerSmsParameters.DealerPassword);    
       ctrlSmsText.text(strFmt( @'SAYIN %1, %2 tarihi itibari ile toplam %3 TL gecikmiş ödemeniz bulunmaktadır.',Callertmp.CustName,Callertmp.DueDate,Callertmp.CurrencyAmount));    
       ctrlPhoneNumber.text(Callertmp.CustPhone);    
   }

You can do this using the multiselection design pattern .您可以使用多选设计模式来做到这一点。

public void init()
{    
   ARCSendSmsCustomerTmp tmp;
   ARCSendSmsCustomerTmp callertmp = element.args().record();    
   FormDataSource fds = callertmp.datasource();
   Amount amount;
   super();    
   for (tmp = fds.getFirst(1) ? fds.getFirst(1) : fds.cursor(); fds; fds = fds.getNext())
   {
        amount += tmp.CurrencyAmount;
   }    
   ////username and password are pulled from dealer parameters.    
   ARCDealerSmsParameters = ARCDealerSmsParameters::find();    
   ctrlUsername.text(ARCDealerSmsParameters.DealerUsername);    
   ctrlPassword.text(ARCDealerSmsParameters.DealerPassword);    
   ctrlSmsText.text(strFmt("SAYIN %1, %2 tarihi itibari ile toplam %3 TL gecikmiş ödemeniz bulunmaktadır.", Callertmp.CustName, Callertmp.DueDate, amount));    
   ctrlPhoneNumber.text(Callertmp.CustPhone);    
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM