Service Desk Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

getGender() WebApi Problem

Highlighted
kostanga_1
Acclaimed Contributor

getGender() WebApi Problem

when i call getgender funcutions over webapi,iam getting following error message
"java.lang.Long cannot be cast to java.lang.Integer"

I am using sd4.5,SP21
what is wrong?
8 REPLIES
Vasily Kamenev
Honored Contributor

Re: getGender() WebApi Problem

Hi
.getGender() is Integer, beliave you try transfom to Long, use Integer.

Vasily
kostanga_1
Acclaimed Contributor

Re: getGender() WebApi Problem

Hello,

No, getGender() send back object integer (Integer) and We are setting this value to an Integer value like

Integer a=per.getGender();

I think this is a bug and hoping to get a workarround or permanent solution.

Thanks,
Vasily Kamenev
Honored Contributor

Re: getGender() WebApi Problem

Hi
Try use next:
Integer a = (Integer)per.getGender();

Vasily
kostanga_1
Acclaimed Contributor

Re: getGender() WebApi Problem

:) i tried all of them.
Vasily Kamenev
Honored Contributor

Re: getGender() WebApi Problem

Yep, really bug, use one Integer Custom field and copy gender value by rule or by SQL.

Vasily
kostanga_1
Acclaimed Contributor

Re: getGender() WebApi Problem

ok,i know this
but the error is interested in webapi
Vasily Kamenev
Honored Contributor

Re: getGender() WebApi Problem

Yes, in web api code, but to correction need parse server code too - a big job for little task.

Vasily
kostanga_1
Acclaimed Contributor

Re: getGender() WebApi Problem

thanks for answers
//Add this to "OnDomLoad" event