You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Griffin <Gr...@swifttool.com> on 2023/05/04 20:40:53 UTC
Mass email of Statements: no session or request for parseReportOptions.bsh
Greetings and salutations,
Let me start by saying I inherited a very old installation of ofbiz/opentaps
that cannot be updated because of other infrastructure limitations, so my
problem might relate to something that was fixed a decade or more ago.
I am attempting to automate the emailing of statements to all customers with
an outstanding balance. My intention is to write a service and schedule it
to run on the first of each month.
Currently, if I navigate to the Collections Summary in Receivables and
select a customer from the list, I can then click a button to generate a PDF
statement. I can then attach this statement to an email and send it.
However, when I write a service to generate this PDF as an attachment to an
email, I consistently run into an issue where parseReportOptions.bsh cannot
find a "request" or a "session". It is my understanding that these are
supposed to always be in context, however, I consistently get 'void' (not to
be confused with null) for these two items.
I am at a loss as to why, and what I can do to fix it.
Can anyone make any suggestions?
Re: Mass email of Statements: no session or request for parseReportOptions.bsh
Posted by Michael Brohl <mi...@ecomify.de>.
Hi,
you installation must be quite old, beanshell (.bsh) scripts are removed
from OFBiz in around 2016.
From memory you are right that session and request are in place in
beanshell scripts as they are in the newer groovy scripts - but only if
you are in a request/response context. This is not the case if you are
running a scheduled service!
So, guessing blindly without seeing your code, you should check if you
have the right solution design and if the bsh script is usable in your
situation.
hth,
best regards,
Michael Brohl
ecomify GmbH - www.ecomify.de
Am 04.05.23 um 22:40 schrieb Griffin:
> Greetings and salutations,
>
>
>
> Let me start by saying I inherited a very old installation of ofbiz/opentaps
> that cannot be updated because of other infrastructure limitations, so my
> problem might relate to something that was fixed a decade or more ago.
>
>
>
> I am attempting to automate the emailing of statements to all customers with
> an outstanding balance. My intention is to write a service and schedule it
> to run on the first of each month.
>
>
>
> Currently, if I navigate to the Collections Summary in Receivables and
> select a customer from the list, I can then click a button to generate a PDF
> statement. I can then attach this statement to an email and send it.
> However, when I write a service to generate this PDF as an attachment to an
> email, I consistently run into an issue where parseReportOptions.bsh cannot
> find a "request" or a "session". It is my understanding that these are
> supposed to always be in context, however, I consistently get 'void' (not to
> be confused with null) for these two items.
>
>
>
> I am at a loss as to why, and what I can do to fix it.
>
>
>
> Can anyone make any suggestions?
>
>