Вот метод из моего сервиса:
X++:
[SysEntryPointAttribute(true),
AifCollectionTypeAttribute('_salesAgreementId', Types::String, extendedtypestr(SalesAgreementId))]
public ConsumerContract PR_LS_INFO_DATA(SalesAgreementId _salesAgreementId)
{
ConsumerContract contract;
SalesAgreementHeaderAddInform salesAgreementHeaderAddInform;
salesAgreementHeaderAddInform = SalesAgreementHeaderAddInform::findSalesNumberSequence(_salesAgreementId);
contract = new ConsumerContract();
if(!energSalesAgreementHeaderAddInform)
throw error (strFmt("@XXX4415",_salesAgreementId));
else
{
contract.parmSalesAgreementId(salesAgreementHeaderAddInform.SalesNumberSequence);
contract.parmName(salesAgreementHeaderAddInform.name());
contract.parmAddress(salesAgreementHeaderAddInform.addresOtherFormatted());
}
return contract;
}