【发布时间】:2017-04-03 12:15:31
【问题描述】:
我正在尝试通过 Screen API 创建客户邮件设置。但是,我没有成功保存数据。
这是我的代码:
public static class CustomerManager
{
private static Value CreateValue(
string value,
Command linkedCommand)
{
return new Value()
{
Value = value,
LinkedCommand = linkedCommand
};
}
private static Value CreateValueCommit(
string value,
Command linkedCommand)
{
return new Value()
{
Value = value,
LinkedCommand = linkedCommand,
Commit = true
};
}
public static void ManageContact() {
try {
using (var context = WebServiceConnector.InitializeScreenWebService()) {
var customerSchema = context.AR303000GetSchema();
var commands = new List<Command>() {
CreateValueCommit("C00001", customerSchema.CustomerSummary.CustomerID),
CreateValueCommit("INVOICE", customerSchema.MailingSettingsMailings.MailingID),
CreateValue("mail@mail.com", customerSchema.MailingSettingsMailings.EmailAccountEmailAddress),
CreateValueCommit("InvoiceNotification", customerSchema.MailingSettingsMailings.NotificationTemplate),
customerSchema.MailingSettingsRecipients.ServiceCommands.NewRow,
CreateValueCommit("Contact", customerSchema.MailingSettingsRecipients.ContactType),
CreateValueCommit("Doe John, Dr.", customerSchema.MailingSettingsRecipients.ContactID),
customerSchema.Actions.Save,
customerSchema.CustomerSummary.CustomerID,
customerSchema.MailingSettingsMailings.EmailAccountEmailAddress,
customerSchema.MailingSettingsRecipients.ContactID
};
var customer = context.AR303000Submit(commands.ToArray());
context.Logout();
}
}
catch (Exception ex) {
throw ex;
}
}
}
唯一正确保存的值是通知模板。
在调试时,我检查了邮件收件人,该值在我的客户退货对象中。但是客户屏幕上什么都没有:
【问题讨论】: