0

enter image description hereIs there way to let the external system know that if an update operation was successful on certain record(s). As per the standard process the update operation in axapta 2012 R3 does not return anything.

Thanks

Aliaksandr Maksimau
  • 2,251
  • 12
  • 21
piku
  • 471
  • 4
  • 12
  • 44

1 Answers1

2

You can modify update method in your service class to return a value. E.g.:

[AifDocumentUpdateAttribute, SysEntryPointAttribute(true)]
public AifEntityKeyList update(AifEntityKeyList _entityKeyList, CustCustomer _custCustomer)
{
    this.updateList(_entityKeyList, _custCustomer);

    return this.getCorrelationEntityKeys();
}
Aliaksandr Maksimau
  • 2,251
  • 12
  • 21
  • Stricly speaking AIF update operations returns void on success and an error on failure. An update should be all or nothing, if it completes it has succeeded, if it fails nothing has been updated. – Jan B. Kjeldsen Jul 05 '17 at 18:57
  • I totally agree. But if in this case the client expects a response on success, I see no reason why we can not return the required value. – Aliaksandr Maksimau Jul 05 '17 at 22:59
  • @JanB.Kjeldsen: I understand your concern but as Mr Aliaksandr said the client actually is expecting a message on there system which is easily achievable in custom services through response contract class. I am trying the same through document services. Although when I try to incorporate the change and update the service I get an error "Service *** is not a valid document". Pls help. – piku Jul 06 '17 at 05:45
  • I have added a screen shot pls chk. – piku Jul 06 '17 at 09:41
  • Even if i try to incorporate the same to `CustCustomerService` class and then update service. I am getting the same problem. – piku Jul 06 '17 at 10:59
  • This is because your method can't pass validation in `AifServiceClassGenerator.checkUpdateMethod()`. The best approach is to rename your method (e.g. `custUpdate`). If it is unacceptable, change the validation logic. – Aliaksandr Maksimau Jul 06 '17 at 15:08