rekha123
27th October 2020, 16:47
Hello All,
I have a strange problem while updating the Purchase order header with a new delivery date in Baan4c4
I am attaching the part of the code which I am using it does not give any error however the field does not get updated.
Also note that this session to update the delivery date is called in the Special of the session Maintain Purchase Order.Is it because the Maintain Purchase Order session is already open ?


function update.delivery.date.afs()
{
domain tcmcs.str10 ddat.2


stpapi.put.field( "tdpur4101m000", "tdpur040.orno", str$(orno.f) )
ret = stpapi.find( "tdpur4101m000" , error )
stpapi.change.view( "tdpur4101m000" )
stpapi.put.field( "tdpur4101m000", "tdpur040.orno", str$(orno.f) )
ret = stpapi.find( "tdpur4101m000" , error )
stpapi.put.field("tdpur4101m000","tdpur040.ddat",str$(ddat.1))
stpapi.get.field("tdpur4101m000","tdpur040.ddat",ddat.2)
ret = stpapi.update("tdpur4101m000",0,afs.err.msg)
stpapi.save("tdpur4101m000", afs.err.msg)
stpapi.recover("tdpur4101m000",afs.err.msg)
if not isspace(afs.err.msg) then
message("%s",afs.err.msg)
endif

stpapi.end.session("tdpur4101m000",afs.err.msg)
}

mark_h
28th October 2020, 14:53
Not sure I get this - but if you are already in the session make sure you can manually change the date. I don't recall when it stops allowing you to update the header. If you can do manually then create a quick separate session to run. This should answer the question if it already being up causes an issue.

rekha123
12th November 2020, 17:29
Hi
The reason why Delivery date updation session is provided in the Special Menu of Purchase order header is selective few should have access to update the delivery date.At the same time it should not be a direct table updation as it can override the standard checks on the field

My updation happens successfully for cases where the delivery date field is enabled but where the field is disabled we are not able to do it and moreover one more problem faced is though I export the field tdpur040.ddat through the customised session it does not show on the Main session without clicking refresh.
But in PO lines if I export the delivery date field it directly reflects in the main session without having to click refresh . Any idea why ?

mark_h
12th November 2020, 23:21
Can you run debug - watch what happens for the PO Lines session and then run for the customized session. It might help you see the difference and what you need to do with calling the custom session.

I can't speak for a customized session, but if you have the code and such then you can run it in debug and make sure it does the same thing as manually. For our custom sessions I would use something like if APIMODE then do something special.

rekha123
27th November 2020, 16:43
Since we do not have the source code for the standard PO header as well as lines it is not possible for me to check what is different in debug
I do an export ( fieldname) in the after.program of both the PO header customised session and the PO line customised session after which the control goes back to the standard PO header and PO line session respectively but the line level field gets reflected correctly with the field value we have modified in the customised session without clicking refresh
However in case of header the field value changes only after we click a manual refresh.

mark_h
30th November 2020, 03:41
Some how or other you need to get the standard session to refresh the screen. You can look at the source extender options - like what ~Vamsi has posted. Without source code I can't think of another option right now.