Unable to change the color Bill To address in customer form [message #637206] |
Tue, 12 May 2015 15:52 |
|
venki8286
Messages: 29 Registered: May 2015 Location: Hyderabad
|
Junior Member |
|
|
Hi,
Greetings!
Here i have a requirement that need to change color of addresses which is in Bill To but when i do it in the form personalization it is affecting to both Bill To and Ship To Addresses. But, here i need only that the color would affected to Bill To Addresses. And also the Addresses column has too many fields.
Addresses column name is CONCATENATED_ADDRESS, Block name is ADDR and Table name is AR_ADDRESSES_V.
Well i have been done it in the OM -> Customers -> Standard Form.
And i also tried by using custom.pll file but it has also failed. The code is as follows:-
clr_customer_id NUMBER;
CURSOR C6(clr_customer_id number) is
SELECT cas.CUST_ACCT_SITE_ID Address_id ,
arp_addr_pkg.format_address
(loc.address_style,
loc.address1,
loc.address2,
loc.address3,
loc.address4,
loc.city,
loc.county,
loc.state,
loc.province,
loc.postal_code,
terr.territory_short_name
) concatenated_address
FROM ar.hz_cust_site_uses_all csu,
ar.hz_cust_acct_sites_all cas,
ar.hz_cust_accounts hca,
ar.hz_parties hpty,
ar.hz_party_sites party_site,
fnd_territories_vl terr,
hz_locations loc
WHERE csu.cust_acct_site_id = cas.cust_acct_site_id
AND csu.site_use_code = 'BILL_TO'
AND loc.country = terr.territory_code(+)
AND cas.cust_account_id = hca.cust_account_id
AND hca.party_id = hpty.party_id
AND loc.location_id = party_site.location_id
AND cas.party_site_id = party_site.party_site_id
and hca.CUST_ACCOUNT_ID = clr_customer_id --customer_id
and cas.BILL_TO_FLAG = 'P';
cursor C7(clr_customer_id number) is
SELECT distinct cas.CUST_ACCT_SITE_ID Address_id,
arp_addr_pkg.format_address
(loc.address_style,
loc.address1,
loc.address2,
loc.address3,
loc.address4,
loc.city,
loc.county,
loc.state,
loc.province,
loc.postal_code,
terr.territory_short_name
) concatenated_address
FROM ar.hz_cust_site_uses_all csu,
ar.hz_cust_acct_sites_all cas,
ar.hz_cust_accounts hca,
ar.hz_parties hpty,
ar.hz_party_sites party_site,
fnd_territories_vl terr,
hz_locations loc
WHERE csu.cust_acct_site_id = cas.cust_acct_site_id
AND loc.country = terr.territory_code(+)
AND cas.cust_account_id = hca.cust_account_id
AND hca.party_id = hpty.party_id
AND loc.location_id = party_site.location_id
AND cas.party_site_id = party_site.party_site_id
and hca.CUST_ACCOUNT_ID = clr_customer_id; --customer_id
BEGIN
IF form_name='ARXCUDCI' AND block_name ='CUST' THEN
clr_customer_id := NAME_IN ('CUST.CUSTOMER_ID');
IF block_name ='ADDR' and (event_name='WHEN-NEW-BLOCK-INSTANCE') THEN
FOR clr_cur IN c6 (clr_customer_id) LOOP
FOR clr_cur2 IN c7 (clr_customer_id) LOOP
IF clr_cur.address_id = clr_cur2.address_id and clr_cur.concatenated_address = clr_cur2.concatenated_address THEN
set_item_property('ADDR.concatenated_address', FOREGROUND_COLOR, 'r255g0b0');
END IF;
END LOOP;
END LOOP;
END IF;
END IF;
END;
Your participation will be appreciated. Smile Smile
|
|
|
|
|
Re: Unable to change the color Bill To address in customer form [message #637269 is a reply to message #637263] |
Thu, 14 May 2015 02:49 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
If the colour isn't being set there are only 3 options as to why:
1) The set_item_property isn't being run - Craig's suggestion
2) The set_item_property is erroring out
3) It works but is immediately overridden by some other code.
We aren't in a position to tell which, you need to debug your code and work it out.
|
|
|
|
|
|
|
|
|
Re: Unable to change the color Bill To address in customer form [message #637390 is a reply to message #637355] |
Sat, 16 May 2015 09:22 |
|
venki8286
Messages: 29 Registered: May 2015 Location: Hyderabad
|
Junior Member |
|
|
Hi
Red Color is applied to "Bill_To" address by using "set_item_instance_property" by creating visual attributes.
But while applying it is taking too much time.
It is taking time for that particular record only.
I have used like this in "WHEN-VALIDATE-RECORD" Trigger
set_item_instance_property('ADDR.concatenated_address',CURRENT_RECORD,VISUAL_ATTRIBUTE, 'CUSTOM1');
Can u tell me why it is taking much time.
Venki
[Updated on: Sat, 16 May 2015 09:25] Report message to a moderator
|
|
|
|
Re: Unable to change the color Bill To address in customer form [message #637461 is a reply to message #637433] |
Mon, 18 May 2015 10:01 |
|
venki8286
Messages: 29 Registered: May 2015 Location: Hyderabad
|
Junior Member |
|
|
Hi Littlefoot
I have used following code:
BEGIN
IF form_name='ARXCUDCI' AND block_name ='ADDR' THEN
IF event_name ='WHEN-VALIDATE-RECORD' THEN
clr_customer_id := NAME_IN ('ADDR.CUSTOMER_ID');
set_va_property('BILLTO_COLOR', FOREGROUND_COLOR, 'r255g0b0');
FOR clr_cur IN c6 (clr_customer_id) LOOP
IF (NAME_IN(':ADDR.CONCATENATED_ADDRESS') = clr_cur.concatenated_address) AND (NAME_IN(':ADDR.SU_BILL_TO_FLAG')='Y') THEN
--set_va_property('CUSTOM1', FOREGROUND_COLOR, 'r255g0b0');
set_item_instance_property('ADDR.concatenated_address',CURRENT_RECORD,VISUAL_ATTRIBUTE, 'BILLTO_COLOR');
END IF;
END LOOP;
END IF;
END IF;
END;
Venki...
[Updated on: Mon, 18 May 2015 10:01] Report message to a moderator
|
|
|
|
Re: Unable to change the color Bill To address in customer form [message #637468 is a reply to message #637466] |
Mon, 18 May 2015 10:53 |
|
venki8286
Messages: 29 Registered: May 2015 Location: Hyderabad
|
Junior Member |
|
|
Hi Craig,
I am only using C6 Cursor.. not using C7 Cursor. if you see my code
FOR clr_cur IN c6 (clr_customer_id) LOOP
IF (NAME_IN(':ADDR.CONCATENATED_ADDRESS') = clr_cur.concatenated_address) AND (NAME_IN(':ADDR.SU_BILL_TO_FLAG')='Y') THEN
set_item_instance_property('ADDR.concatenated_address',CURRENT_RECORD,VISUAL_ATTRIBUTE, 'BILLTO_COLOR');
END IF;
END LOOP;
in C6 Cursor it returns only 2 records ..
Venki
[Updated on: Mon, 18 May 2015 10:55] Report message to a moderator
|
|
|
|