Anda di halaman 1dari 5

8/19/2017 party_id from hz_parties |Oracle Community

Oracle.com Downloads Cloud Trials Other Languages Go Directly To Quick Links

THIS DISCUSSION IS ARCHIVED

14 Replies Latest reply on May 17, 2011 9:35 PM by te*441957*as

te*441957*as May 3, 2011 9:38 PM

party_id from hz_parties


This question is Not Answered.

Hi there,

does any one has sql query which can pull party id from hz_parties for an account number? This party id from hz_parties should match customer_id in
fnd_user table.

Thanks in advance.

I have the same question (0)

18334Views Tags: fnd_user, from, hz_parties, party_id, tca

Average User Rating

(0 ratings)

Hussein Sawwan-Oracle May 3, 2011 9:51 PM ( in response to te*441957*as)


1. Re: party_id from hz_parties

Please see these docs.

When Opening The Approval Notication After A Supplier Change - The Error ORA-6512 Apps.Wf_notication Line 5371 ORA-1403 Occurs [ID
435266.1]
Why Does 'Customer' Field in User -> Dene Form gets Populated Automatically when an Application User is created using Employee
Registration Process Link on Login Page .? [ID 847970.1]

Thanks,
Hussein

Actions Like (0)

Sandeep Gandhi, Consultant May 3, 2011 10:15 PM ( in response to te*441957*as)


2. Re: party_id from hz_parties

>
does any one has sql query which can pull party id from hz_parties for an account number?
>

Is this what you mean?

SELECT hca.party_id, hp.party_name


FROM hz_cust_accounts hca, hz_parties hp
WHERE hca.party_id = hp.party_id
AND hca.account_number = '&acct_number'

Sandeep Gandhi
https://community.oracle.com/message/9564189#9564189 1/5
8/19/2017 party_id from hz_parties |Oracle Community
Actions Like (0)

te*441957*as May 4, 2011 3:38 PM ( in response to Sandeep Gandhi, Consultant)


3. Re: party_id from hz_parties

the value returned by below sql does not match what is returned from RequestCtx.getPartyId().

SELECT hca.party_id, hp.party_name


FROM hz_cust_accounts hca, hz_parties hp
WHERE hca.party_id = hp.party_id
AND hca.account_number = '&acct_number'

Actions Like (0)

Hussein Sawwan-Oracle May 4, 2011 3:45 PM ( in response to te*441957*as)


4. Re: party_id from hz_parties

Did you run the query under "Cause" section in the rst doc referenced above?

Thanks,
Hussein

Actions Like (0)

te*441957*as May 4, 2011 4:02 PM ( in response to Hussein Sawwan-Oracle)


5. Re: party_id from hz_parties

there is no cause section in that metalink id.

847970.1

also that note is more R12. We are on 11.5.10.

Actions Like (0)

Hussein Sawwan-Oracle May 4, 2011 4:08 PM ( in response to te*441957*as)


6. Re: party_id from hz_parties

It is 435266.1 -- It should work for 11i and R12

Thanks,
Hussein

Actions Like (0)

te*441957*as May 4, 2011 5:05 PM ( in response to Hussein Sawwan-Oracle)


7. Re: party_id from hz_parties

I ran the following query.

SELECT fu.user_name,hp.party_name, hp.party_id FROM fnd_user fu,hz_parties hp


WHERE hp.party_id = fu.customer_id and fu.user_id = '19379'

it did give me the correct party id.

The problem is: I dont have the user name in my case. its only account number I have.

https://community.oracle.com/message/9564189#9564189 2/5
8/19/2017 party_id from hz_parties |Oracle Community
Any suggestion?

thanks for your help.

Actions Like (0)

Hussein Sawwan-Oracle May 4, 2011 5:58 PM ( in response to te*441957*as)


8. Re: party_id from hz_parties

You mentioned that the query provided by Sandeep did not return the value you were expecting .. so could you please run the following to
verify?

SQL> select * from hz_cust_accounts


where account_number = '<account number>';

SQL> select * from hz_parties


where party_id = '<party_id from query 1>';

Thanks,
Hussein

Actions Like (0)

te*441957*as May 4, 2011 5:19 PM ( in response to Hussein Sawwan-Oracle)


9. Re: party_id from hz_parties

I really appreciate your help.

I know that I can get the party id from hz_cust_accounts using account number.

select party_id from hz_cust_accounts where account_number = 123456- this query returns party id as 402664.

SELECT fu.user_name,hp.party_name, hp.party_id FROM fnd_user fu,hz_parties hp WHERE hp.party_id = fu.customer_id and fu.user_id =
'19379' - this query returns party id as 474835.

why they both are not matching and how can I resolve this issue?

thanks

Actions Like (0)

Hussein Sawwan-Oracle May 4, 2011 5:58 PM ( in response to te*441957*as)


10. Re: party_id from hz_parties

What does this query return?

SQL> select fu.user_name, hp.party_name, hp.party_id


from fnd_user fu, hz_parties hp
where hp.party_id = fu.customer_id
and hp.party_id= '402664';

Thanks,
Hussein

Actions Like (0)

https://community.oracle.com/message/9564189#9564189 3/5
8/19/2017 party_id from hz_parties |Oracle Community

te*441957*as May 5, 2011 6:28 PM ( in response to Hussein Sawwan-Oracle)


11. Re: party_id from hz_parties

that sql does not return any rows. I suspect there is something wrong with data.

do you have any suggestions?

Thanks.

Edited by: te**** on May 5, 2011 11:27 AM

Actions Like (0)

Hussein Sawwan-Oracle May 5, 2011 6:41 PM ( in response to te*441957*as)


12. Re: party_id from hz_parties

do you have any suggestions?

No sorry -- Have you logged a SR?

Thanks,
Hussein

Actions Like (0)

rkgoud May 5, 2011 7:56 PM ( in response to te*441957*as)


13. Re: party_id from hz_parties

Before going to database tables, rst check the things on the Users screen from System Admin Responsibility.

Is the person attached to user? then,


fnd_user.person_party_id = hz_parties.party_id.
fnd_user.emplyee_id = HR Employee ID

Is the customer attached to the user, then


fnd_user.customer_id = hz_parties.party_id (these are relationship parties or contact persons of customer organization, you will not nd any
accounts for this party_id in hz_cust_accounts, you have to go thru the relationship to see the organization and get accounts for that
organization party)
fnd_user.employee_id becomes NULL

What is your case?

-- IF PARTY RELATIONSHIP IS ATTACHED TO THE FND_USER

select customer_id from fnd_user


where user_name = 'ABC'; -- 504436

select party_id, party_name, party_type from hz_parties


where party_id = 504436;

-- If the above party type is PARTY_RELATIONSHIP


select object_id from hz_relationships
where party_id = 504436
and object_type = 'ORGANIZATION'; -- 467118

select party_id, party_name, party_type from hz_parties


where party_id = 467118;

select account_number from hz_cust_accounts


where party_id = 467118;

https://community.oracle.com/message/9564189#9564189 4/5
8/19/2017 party_id from hz_parties |Oracle Community

-- IF PERSON PARTY IS ATTACHED TO THE FND_USER, not EMPLOYEE

select customer_id from fnd_user


where user_name = 'ABC'; -- 504435

select party_id, party_name, party_type from hz_parties


where party_id = 504435;

-- If the above party type is PERSON


select object_id from hz_relationships
where subject_id = 504435
and object_type = 'ORGANIZATION'; -- 467118

select party_id, party_name, party_type from hz_parties


where party_id = 467118;

select account_number from hz_cust_accounts


where party_id = 467118;

Edited by: RK on May 5, 2011 12:54 PM

Actions Like (0)

te*441957*as May 17, 2011 9:35 PM ( in response to te*441957*as)


14. Re: party_id from hz_parties

the requestCtx was returning wrong value because of cookies were missing.
Issue is resolved.

Actions Like (0)

Oracle Technology Network

Powered by

About OTN FAQ Communities Other Languages Oracle.com

Site Map Legal Notices Terms of Use Privacy Cookie Preferences

https://community.oracle.com/message/9564189#9564189 5/5

Anda mungkin juga menyukai