Unable to create Person after generating PartyId earlier

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

Unable to create Person after generating PartyId earlier

Pranay Pandey
Hi,

The scenario is:
I wrote a simple event for creating a party by generating the partyId in it
by <sequenced-id-to-env.
Now i am passing auto generated partyId to "createPerson" service.
But the code snippet from PartyServices.java retruns me the error message.

// if specified partyId starts with a number, return an error
        if (partyId != null && partyId.length() > 0 &&
Character.isDigit(partyId.charAt(0))) {
            return
ServiceUtil.returnError(UtilProperties.getMessage(resource,
"party.id_is_digit", locale));
        }

If this is the case then we can't use this service i.

--
Thanks & Regards
--
Pranay Pandey
Indore, India
Reply | Threaded
Open this post in threaded view
|

Unable to create Person after generating PartyId earlier

Pranay Pandey
Hi,

The scenario is:
I wrote a simple event for creating a party by generating the partyId in it
by <sequenced-id-to-env.
Now i am passing auto generated partyId to "createPerson" service.
But the code snippet from PartyServices.java retruns me the error message.

// if specified partyId starts with a number, return an error
        if (partyId != null && partyId.length() > 0 &&
Character.isDigit(partyId.charAt(0))) {
            return
ServiceUtil.returnError(UtilProperties.getMessage(resource,
"party.id_is_digit", locale));
        }

If this is the case then we can't use this service i.e. "createPerson" in
our custom service while generating partyId earlier and then passing it to
this service.

Thoughts ???

--
Thanks & Regards
--
Pranay Pandey
Indore, India
Reply | Threaded
Open this post in threaded view
|

Re: Unable to create Person after generating PartyId earlier

BJ Freeman
I believe this is so you don't use a number that may have been already
generated. The default ID for ofbiz are numbers.
if your going to use numbers either append a letter to it or allow ofbiz
to assign the ID.


Pranay Pandey sent the following on 4/14/2008 8:53 AM:

> Hi,
>
> The scenario is:
> I wrote a simple event for creating a party by generating the partyId in it
> by <sequenced-id-to-env.
> Now i am passing auto generated partyId to "createPerson" service.
> But the code snippet from PartyServices.java retruns me the error message.
>
> // if specified partyId starts with a number, return an error
>         if (partyId != null && partyId.length() > 0 &&
> Character.isDigit(partyId.charAt(0))) {
>             return
> ServiceUtil.returnError(UtilProperties.getMessage(resource,
> "party.id_is_digit", locale));
>         }
>
> If this is the case then we can't use this service i.e. "createPerson" in
> our custom service while generating partyId earlier and then passing it to
> this service.
>
> Thoughts ???
>

Reply | Threaded
Open this post in threaded view
|

Re: Unable to create Person after generating PartyId earlier

Ashish Vijaywargiya
Thanks BJ for your reply.
I know the details that you wrote in your reply.

I was only concerned to know that should I generate a partyId when I need to
do so or I should directly call "createPerson"  for doing this job for me.

Although I generated the partyId by using <sequenced-id-to-env> and the same
is being done in createPerson service if partyId is not supplied.

On Mon, Apr 14, 2008 at 12:05 PM, BJ Freeman <[hidden email]> wrote:

> I believe this is so you don't use a number that may have been already
> generated. The default ID for ofbiz are numbers.
> if your going to use numbers either append a letter to it or allow ofbiz
> to assign the ID.
>
>
> Pranay Pandey sent the following on 4/14/2008 8:53 AM:
> > Hi,
> >
> > The scenario is:
> > I wrote a simple event for creating a party by generating the partyId in
> it
> > by <sequenced-id-to-env.
> > Now i am passing auto generated partyId to "createPerson" service.
> > But the code snippet from PartyServices.java retruns me the error
> message.
> >
> > // if specified partyId starts with a number, return an error
> >         if (partyId != null && partyId.length() > 0 &&
> > Character.isDigit(partyId.charAt(0))) {
> >             return
> > ServiceUtil.returnError(UtilProperties.getMessage(resource,
> > "party.id_is_digit", locale));
> >         }
> >
> > If this is the case then we can't use this service i.e. "createPerson"
> in
> > our custom service while generating partyId earlier and then passing it
> to
> > this service.
> >
> > Thoughts ???
> >
>
>


--
Thanks & Regards
Ashish Vijaywargiya
+919893479711
Reply | Threaded
Open this post in threaded view
|

Re: Unable to create Person after generating PartyId earlier

Ashish Vijaywargiya
In reply to this post by BJ Freeman
Oops I was working on Ashish's Laptop.
Forgot to open my email id.

Pranay.

On Mon, Apr 14, 2008 at 12:05 PM, BJ Freeman <[hidden email]> wrote:

> I believe this is so you don't use a number that may have been already
> generated. The default ID for ofbiz are numbers.
> if your going to use numbers either append a letter to it or allow ofbiz
> to assign the ID.
>
>
> Pranay Pandey sent the following on 4/14/2008 8:53 AM:
> > Hi,
> >
> > The scenario is:
> > I wrote a simple event for creating a party by generating the partyId in
> it
> > by <sequenced-id-to-env.
> > Now i am passing auto generated partyId to "createPerson" service.
> > But the code snippet from PartyServices.java retruns me the error
> message.
> >
> > // if specified partyId starts with a number, return an error
> >         if (partyId != null && partyId.length() > 0 &&
> > Character.isDigit(partyId.charAt(0))) {
> >             return
> > ServiceUtil.returnError(UtilProperties.getMessage(resource,
> > "party.id_is_digit", locale));
> >         }
> >
> > If this is the case then we can't use this service i.e. "createPerson"
> in
> > our custom service while generating partyId earlier and then passing it
> to
> > this service.
> >
> > Thoughts ???
> >
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Unable to create Person after generating PartyId earlier

BJ Freeman
In reply to this post by Ashish Vijaywargiya
unless you have some compelling reason, I suggest just create a person.
Now if you have a compelling reason then in your same call, just add the
calls in create a person and set the roll.
the second way you can determine what roll you want the ID to have.

Ashish Vijaywargiya sent the following on 4/14/2008 9:16 AM:

> Thanks BJ for your reply.
> I know the details that you wrote in your reply.
>
> I was only concerned to know that should I generate a partyId when I need to
> do so or I should directly call "createPerson"  for doing this job for me.
>
> Although I generated the partyId by using <sequenced-id-to-env> and the same
> is being done in createPerson service if partyId is not supplied.
>
> On Mon, Apr 14, 2008 at 12:05 PM, BJ Freeman <[hidden email]> wrote:
>
>> I believe this is so you don't use a number that may have been already
>> generated. The default ID for ofbiz are numbers.
>> if your going to use numbers either append a letter to it or allow ofbiz
>> to assign the ID.
>>
>>
>> Pranay Pandey sent the following on 4/14/2008 8:53 AM:
>>> Hi,
>>>
>>> The scenario is:
>>> I wrote a simple event for creating a party by generating the partyId in
>> it
>>> by <sequenced-id-to-env.
>>> Now i am passing auto generated partyId to "createPerson" service.
>>> But the code snippet from PartyServices.java retruns me the error
>> message.
>>> // if specified partyId starts with a number, return an error
>>>         if (partyId != null && partyId.length() > 0 &&
>>> Character.isDigit(partyId.charAt(0))) {
>>>             return
>>> ServiceUtil.returnError(UtilProperties.getMessage(resource,
>>> "party.id_is_digit", locale));
>>>         }
>>>
>>> If this is the case then we can't use this service i.e. "createPerson"
>> in
>>> our custom service while generating partyId earlier and then passing it
>> to
>>> this service.
>>>
>>> Thoughts ???
>>>
>>
>
>