Home » Developer & Programmer » Forms » Unable to change the color Bill To address in customer form
Unable to change the color Bill To address in customer form [message #637206] Tue, 12 May 2015 15:52 Go to next message
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 #637253 is a reply to message #637206] Wed, 13 May 2015 09:19 Go to previous messageGo to next message
CraigB
Messages: 386
Registered: August 2014
Location: Utah, USA
Senior Member
Quote:
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;

IF this code is not working, clearly your condition is not evaluating to TRUE. Check your logic and make sure your comparison is correct.

Craig...
Re: Unable to change the color Bill To address in customer form [message #637263 is a reply to message #637253] Wed, 13 May 2015 15:03 Go to previous messageGo to next message
venki8286
Messages: 29
Registered: May 2015
Location: Hyderabad
Junior Member
Hi Craig,

I have checked the data which is coming from both cursors, and validating to true.
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 Go to previous messageGo to next message
cookiemonster
Messages: 13917
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 #637298 is a reply to message #637269] Thu, 14 May 2015 08:42 Go to previous messageGo to next message
CraigB
Messages: 386
Registered: August 2014
Location: Utah, USA
Senior Member
Question? The item you are setting the FORGROUND_COLOR on - is it in a multi-record block? If so, you need to use the SET_ITEM_INSTANCE_PROPERTY() built-in instead of SET_ITEM_INSTANCE.

Craig...
Re: Unable to change the color Bill To address in customer form [message #637299 is a reply to message #637298] Thu, 14 May 2015 08:47 Go to previous messageGo to next message
venki8286
Messages: 29
Registered: May 2015
Location: Hyderabad
Junior Member
Yes Craig. It is multi record block. i have are tried by giving set_item_instance_property(), but it is not working.
and i have also tried like this also
set_va_property(cur_itm, FOREGROUND_COLOR, 'r255g0b0');
app_record.highlight(cur_itm);
but not working.

venki
Re: Unable to change the color Bill To address in customer form [message #637301 is a reply to message #637299] Thu, 14 May 2015 09:06 Go to previous messageGo to next message
CraigB
Messages: 386
Registered: August 2014
Location: Utah, USA
Senior Member
Quote:
but it is not working.

What does this mean? Can you describe how it is not working? Are you getting an error message?

If you use SET_ITEM_PROPERTY() on a multi-record block, you will change the property for ALL instances of that ITEM. Can you show us the code you used when you were using the SET_ITEM_INSTANCE_PROPERTY?

Craig...
Re: Unable to change the color Bill To address in customer form [message #637304 is a reply to message #637301] Thu, 14 May 2015 10:08 Go to previous messageGo to next message
venki8286
Messages: 29
Registered: May 2015
Location: Hyderabad
Junior Member
Craig,

I have used

fnd_message.set_string('Customer Address');
fnd_message.show;
set_item_instance_property('ADDR.concatenated_address',CURRENT_RECORD, FOREGROUND_COLOR, 'r255g0b0');

I can't see any changes in customer form by using set_item_instance_property & set_item_property.

I am trying to debug the code by adding custom messages.

fnd_message.set_string('Customer Address');
fnd_message.show;

no error messages are displaying in customer form and even though custom messages are also not displaying.

venki
Re: Unable to change the color Bill To address in customer form [message #637305 is a reply to message #637304] Thu, 14 May 2015 10:27 Go to previous messageGo to next message
cookiemonster
Messages: 13917
Registered: September 2008
Location: Rainy Manchester
Senior Member
If the messages aren't appearing then the obvious conclusion is that the code is not being run.
So you have to put a message after the BEGIN, each IF and the FORs. See where it gets up to.
Re: Unable to change the color Bill To address in customer form [message #637355 is a reply to message #637305] Fri, 15 May 2015 08:55 Go to previous messageGo to next message
venki8286
Messages: 29
Registered: May 2015
Location: Hyderabad
Junior Member
Hi Cookie/CraigB

I have kept Custom Messages between two blocks like below

BEGIN
IF form_name='ARXCUDCI' AND block_name ='CUST' THEN
clr_customer_id := NAME_IN ('CUST.CUSTOMER_ID');

fnd_message.set_string('Customer Block');
fnd_message.show;

IF block_name ='ADDR' and (event_name='WHEN-VALIDATE-RECORD') THEN

fnd_message.set_string('Address Block');
fnd_message.show;

FOR clr_cur IN c6 (clr_customer_id) LOOP

fnd_message.set_string('Address ID from Cursor1');
fnd_message.show;

FOR clr_cur2 IN c7 (clr_customer_id) LOOP

fnd_message.set_string('Address ID from Cursor2');
fnd_message.show;
IF clr_cur.address_id = clr_cur2.address_id and clr_cur.concatenated_address = clr_cur2.concatenated_address THEN
set_item_instance_property('ADDR.concatenated_address', FOREGROUND_COLOR, 'r255g0b0');
END IF;
END LOOP;
END LOOP;
END IF;
END IF;
END;

but the custom messages are not populating on form.. so i am unable to find out where it is getting stuck.. Can u help me where i am doing wrong.

Venki
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 Go to previous messageGo to next message
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 #637433 is a reply to message #637390] Sun, 17 May 2015 15:06 Go to previous messageGo to next message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Are you saying that SET_ITEM_INSTANCE_PROPERTY takes a long time? Is there anything else in that WHEN-VALIDATE-RECORD (WVR) trigger? If so, what? Could you post the whole code?

Besides, are you sure that WVR is the trigger that consumes all that time? Are there any other triggers which might be causing that?
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 Go to previous messageGo to next message
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 #637466 is a reply to message #637461] Mon, 18 May 2015 10:44 Go to previous messageGo to next message
CraigB
Messages: 386
Registered: August 2014
Location: Utah, USA
Senior Member
Quote:
Can u tell me why it is taking much time.

My first thought is it appears slow because you are LOOPing through every record returned by the C6 and C7 Cursors where it equals 'clr_customer_id'. Do the C6 & C7 cursors return a single row or multiple rows? If a single row - why use a loop/nested loop - just fetch the values and close the cursors.

Craig...
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 Go to previous messageGo to next message
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

Re: Unable to change the color Bill To address in customer form [message #637495 is a reply to message #637468] Mon, 18 May 2015 15:05 Go to previous message
venki8286
Messages: 29
Registered: May 2015
Location: Hyderabad
Junior Member
Hi All

Thanks for all your help..

I got solution.. Now Red Color is coming to Bill_to Address in Customer Form.
I have just changed visual attribute Name from CUSTOM1 to DATA_SPECIAL which is already having foreground color red.

venki..

[Updated on: Mon, 18 May 2015 15:05]

Report message to a moderator

Previous Topic: How to Restrict user to close window in forms 10g
Next Topic: How to Install Forms 10g on Windows Xp Sp-3
Goto Forum:
  


Current Time: Fri Mar 29 05:02:17 CDT 2024