how to fetch records from two entities

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

how to fetch records from two entities

hdv
hi

I want to fetch records such as productId, imageurl etcfrom product entity using some condition and now i want to fetch price for those productids which i got from product entity.so how can i do that??
shud i do coding in groovy or in xml file?which one is better?
Reply | Threaded
Open this post in threaded view
|

Re: how to fetch records from two entities

S K Pradeep kumar
Hi,
What ever ur doing either groovy or xml. create one view entity so u can
access them very easily.

With regards,
S K Pradeep kumar,
9980609494


On Tue, Aug 10, 2010 at 12:03 PM, hdv <[hidden email]> wrote:

>
> hi
>
> I want to fetch records such as productId, imageurl etcfrom product entity
> using some condition and now i want to fetch price for those productids
> which i got from product entity.so how can i do that??
> shud i do coding in groovy or in xml file?which one is better?
> --
> View this message in context:
> http://ofbiz.135035.n4.nabble.com/how-to-fetch-records-from-two-entities-tp2319358p2319358.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: how to fetch records from two entities

Patrick-4
In reply to this post by hdv
You could create a static function in Java and call it from the FTL file.

This is an example of a static call from an FTL file
<#assign defaultGogleMapKey =
Static["org.ofbiz.base.util.UtilProperties"].getPropertyValue("general.properties",
defaultUrl)>

You could also do it in Groovy

The code is like this

GenericDelegator delegator = GenericDelegator.getGenericDelegator("default")

List result = delegator.findByAnd("Product",
UtilMisc.toMap("productId", "10000"));
for(int i =0; i < result.size(); i++)
{
GenericValue product = (GenericValue)(result.get(i));
String imageurl = product.getString("imageurl");
}

Groovy is a good way to do it.

On Tue, Aug 10, 2010 at 1:33 AM, hdv <[hidden email]> wrote:

>
> hi
>
> I want to fetch records such as productId, imageurl etcfrom product entity
> using some condition and now i want to fetch price for those productids
> which i got from product entity.so how can i do that??
> shud i do coding in groovy or in xml file?which one is better?
> --
> View this message in context: http://ofbiz.135035.n4.nabble.com/how-to-fetch-records-from-two-entities-tp2319358p2319358.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: how to fetch records from two entities

Ravindra Mandre-2
Hi,
You can also do this in xml using entity condition , and get related tags .


Ravi