We are introducing some custom code in salesLine table’s insert method. However, we want to execute this code only when the sales lines are being inserted using the AX rich client and not when we are using other methods such as AIF.
Is there a way to figure out the calling process inside the salesLine table’s insert method?
The first part was done before my time. So, the salesLine.insert() has already been modified. I don’t have a choice now of removing the code from salesLine.insert(). All I’m trying to do is the second part. Any suggestions?
If I were to design it from scratch, I probably would create a class that does the explosion and insertion. I would then invoke that class from different clients. I don’t have that choice. I’m back to my original question.
If you’re not allowed to do necessary changes, you’ll have to tell them that the logic can’t be implemented unless the situation changes.
You can’t ever rely on the type of client. Today the action is done only from GUI, but tomorrow it may be done by a batch, through Excel add-in, by a web service… You would also end up with extremely fragile code, expensive to maintain. You may be unable to upgrade it to AX 7. And so on and so on.
Don’t help to build another failed implementation. It would be bad both for the customer and for your reputation.