Check on party fields from ftl files

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Check on party fields from ftl files

Shereen
Hi all

I'm new to freemarker and I want to do some checking in the orderinfo.ftl
I want to get the customer for the order then check on certain field in the that customer
In more detailes I've added a field to the party called requirePrepayment now I want in the orderinfo.ftl to know the customer (the bill to party and check on that field.

I think I'll need the orderhelper right?

would anyone suggest some code?

Thanks in advance
Reply | Threaded
Open this post in threaded view
|

Re: Check on party fields from ftl files

BJ Freeman
when you do a view, a groovy file marshals data and passed to ftl and/or
widgets, as defined in the view.
if the screen is a widget the Groovy many be declared in the Actions
section.
if just ftl, as defined in the view, then the groovy file with the same
name is usually in /WEB-INF/actions

=========================
BJ Freeman
Strategic Power Office with Supplier Automation  <http://www.businessesnetwork.com/automation/viewforum.php?f=52>
Specialtymarket.com  <http://www.specialtymarket.com/>
Systems Integrator-- Glad to Assist

Chat  Y! messenger: bjfr33man


Shereen sent the following on 10/27/2010 6:40 AM:

>
> Hi all
>
> I'm new to freemarker and I want to do some checking in the orderinfo.ftl
> I want to get the customer for the order then check on certain field in the
> that customer
> In more detailes I've added a field to the party called requirePrepayment
> now I want in the orderinfo.ftl to know the customer (the bill to party and
> check on that field.
>
> I think I'll need the orderhelper right?
>
> would anyone suggest some code?
>
> Thanks in advance

Reply | Threaded
Open this post in threaded view
|

Re: Check on party fields from ftl files

Shereen
It wil be the first time ever I use the groovy.
But I'll follow your advice and try this but meanwhile I'll try also to do it using the ftl

That's what I've done till now:
<#assign orh = Static["org.ofbiz.order.order.OrderReadHelper"].getHelper(orderHeader)>
            <#assign billToParty = orh.getBillToParty()?if_exists>
            <#assign billToPartyNameResult = dispatcher.runSync("getPartyNameForDate", Static["org.ofbiz.base.util.UtilMisc"].toMap("partyId", billToParty.partyId, "compareDate", orderHeader.orderDate, "userLogin", userLogin))/>

I think that way I'm getting the customer now I want to check on certain field that's how I tried to check it and it gave me exception:

            <#assign reqPrepayment = billToParty.requirePrepayment/>
 the exception is
Error on line 33, column 13 in component://order/webapp/ordermgr/order/orderinfo.ftl billToParty.requirePrepayment is undefined. It cannot be assigned to reqPrepayment at freemarker.core.Assignment.accept(Assignment.java:111)

where else should that field be declared and I'm really so thankful for your help
Reply | Threaded
Open this post in threaded view
|

Re: Check on party fields from ftl files

BJ Freeman
Sorry I use the flow I talked to you about.
so all that is done in the Groovy.
maybe someone else will give you an answer.

=========================
BJ Freeman
Strategic Power Office with Supplier Automation  <http://www.businessesnetwork.com/automation/viewforum.php?f=52>
Specialtymarket.com  <http://www.specialtymarket.com/>
Systems Integrator-- Glad to Assist

Chat  Y! messenger: bjfr33man


Shereen sent the following on 10/27/2010 7:09 AM:

>
> It wil be the first time ever I use the groovy.
> But I'll follow your advice and try this but meanwhile I'll try also to do
> it using the ftl
>
> That's what I've done till now:
> <#assign orh =
> Static["org.ofbiz.order.order.OrderReadHelper"].getHelper(orderHeader)>
>              <#assign billToParty = orh.getBillToParty()?if_exists>
>              <#assign billToPartyNameResult =
> dispatcher.runSync("getPartyNameForDate",
> Static["org.ofbiz.base.util.UtilMisc"].toMap("partyId", billToParty.partyId,
> "compareDate", orderHeader.orderDate, "userLogin", userLogin))/>
>
> I think that way I'm getting the customer now I want to check on certain
> field that's how I tried to check it and it gave me exception:
>
>              <#assign reqPrepayment = billToParty.requirePrepayment/>
>   the exception is
> Error on line 33, column 13 in
> component://order/webapp/ordermgr/order/orderinfo.ftl
> billToParty.requirePrepayment is undefined. It cannot be assigned to
> reqPrepayment at freemarker.core.Assignment.accept(Assignment.java:111)
>
> where else should that field be declared and I'm really so thankful for your
> help

Reply | Threaded
Open this post in threaded view
|

Re: Check on party fields from ftl files

Shereen
I'm thankful for your reply

I'd be grateful for anyone who can help with groovy script just getting the customer and check for a certain field in party entity
nothing more

Thanks in advance
Reply | Threaded
Open this post in threaded view
|

Re: Check on party fields from ftl files

BJ Freeman
take a look at
applications\party\webapp\partymgr\WEB-INF\actions\party

=========================
BJ Freeman
Strategic Power Office with Supplier Automation  <http://www.businessesnetwork.com/automation/viewforum.php?f=52>
Specialtymarket.com  <http://www.specialtymarket.com/>
Systems Integrator-- Glad to Assist

Chat  Y! messenger: bjfr33man


Shereen sent the following on 10/27/2010 7:51 AM:
>
> I'm thankful for your reply
>
> I'd be grateful for anyone who can help with groovy script just getting the
> customer and check for a certain field in party entity
> nothing more
>
> Thanks in advance