You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Pranay Pandey <pa...@gmail.com> on 2008/04/14 17:49:21 UTC

Unable to create Person after generating PartyId earlier

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

Re: Unable to create Person after generating PartyId earlier

Posted by Ashish Vijaywargiya <vi...@gmail.com>.
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 <bj...@free-man.net> 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 ???
> >
>
>

Re: Unable to create Person after generating PartyId earlier

Posted by BJ Freeman <bj...@free-man.net>.
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 <bj...@free-man.net> 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 ???
>>>
>>
> 
> 


Re: Unable to create Person after generating PartyId earlier

Posted by Ashish Vijaywargiya <vi...@gmail.com>.
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 <bj...@free-man.net> 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

Re: Unable to create Person after generating PartyId earlier

Posted by BJ Freeman <bj...@free-man.net>.
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 ???
> 


Unable to create Person after generating PartyId earlier

Posted by Pranay Pandey <pa...@gmail.com>.
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