jp.aalders
8th November 2005, 15:40
I'm using AFS for creating purchase contracts, for reviewing purposes I want to present the user an overview ( report ) with the contractnumber generated by AFS. As I'm using AFS to insert a new record en the session logic takes care of the new contractnumber I'm not able to determine wat contractnumber is generated. Is there a method to determine the ordernumber currently generated ( after the insert ) has taken place? Normally you stpapi.find option would be used but in this case I don't know the contract number currently generated.

Thanks for your reply in advance! :confused:

mark_h
8th November 2005, 17:11
Not sure I understand - after the insert if the contract number is generated then right after the insert you should be able to do a stpapi.get to get the contract number. I use something like this to track the sequence number on inventory adjusts. This way if things go wrong I can clean it up and not leave an active adjustment. Is there a reason that right after the insert you can not do the get?

jp.aalders
9th November 2005, 16:58
Hi Mark,

Thanks for your response! The goal is to be able to print the contractnumber generated by AFS on a report for information purpose.
Therefore I need the contractnumber but as it is automatically generated by AFS I can't use the stpget command to find. It's a bit like which was first, the chicken or the egg :-))
So to be short, is there a possibillity to read the generated contractnumber after the insert has been executed?

mark_h
9th November 2005, 17:10
What session are we talking about? You should be able to do a get after the insert and return the contract number. BUT this depends on how the sessions function - some sessions do not always populate fields when executed via AFS, or they launch a sub-session which does not give you time to do a get. So far I have been able to work around these issues.

jp.aalders
15th November 2005, 10:02
Hi Mark,

Thanks for the reply again. The session is about tdpur3101m000. In now do a stpapi.get.field on the tdpur300.cono field after the insert an indeed the generated contractnumber is returned, solutions can be simple sometimes :-))
My problem has been fixed with this.

Regards,

John Pieter