Calling a different class method in AIF service

Team ,

I created a AIF service for ex. AxVendtable and whiever consumes will call create Method , So obviuosly it will hit insert methid of vendttable . But I need to use a another class method which does some functions when inserting a vendor.

I cannot do that in Insert method oF Vendttable because this should be used only for AIF , not when creating UI, or loading vendor via. Excel

Else , We can somehow tell that to call this method when executed through server ,but how .

Please help

The best place probably is prepareForSaveExtended() method of the document class. If you implement your saving logic and return false (in your particular case), the framework won’t try to save the record.

The best place obviously depends on what logic you’re adding.

thanks Martin. one more . Why i dont see dosave() method in my AXVendor AIF . but i do see in Axsalesline . Because dosave has all the validations in there like validatewrite , validatefields , init methods etc.

You don’t see it in AxVendTable class because it’s not overridden there, therefore it uses the default implementation from AxInternalBase class.