Monday, November 15, 2010

Customer Interface Does Not Populate Late Charges Fields From Profile Class

At our site, when we import customers using customer interface, we encountered this issue. At present Oracle offers only a work around. The work around is to use TCA APIs to update customer profile of affected customer. The similar issue is applicable to Profile amounts too. So we did the following

1. Find customers that are affected by this bug
2. Use following code to update customer's profile


.......
.......
FOR l_profiles IN c_profiles
LOOP
l_prof_rec.cust_account_profile_id := l_profiles.cust_account_profile_id;
l_prof_rec.profile_class_id := l_profiles.profile_class_id;
l_obj_version := l_profiles.object_version_number;

HZ_CUSTOMER_PROFILE_V2PUB.update_customer_profile
( p_init_msg_list => FND_API.G_TRUE
, p_customer_profile_rec => l_prof_rec
, p_object_version_number => l_obj_version
, x_return_status => l_ret_status
, x_msg_count => l_msg_count
, x_msg_data => l_msg_data
) ;
IF l_ret_status <> FND_API.G_RET_STS_SUCCESS
THEN
l_errors := 1;
IF l_msg_count >= 1
THEN
FOR l_count IN 1..l_msg_count
LOOP
fnd_msg_pub.get(l_count, 'F', l_msg_data, l_msg_index);
write_msg('Error While Updating Profile, cust_account_profile_id = ' ||l_profiles.cust_account_profile_id
|| ', Error: '
|| l_msg_data
) ;
END LOOP;
ELSE
write_msg('Undocumented error from Update customer Profile API is: '
|| l_ret_status
|| ' MSG COUNT IS '
|| l_msg_count
|| ' MESSAGE IS '
|| l_msg_data
);
END IF;
END IF; -- END RETURN NOT SUCCESS
END LOOP;
.......
.......




The procedure HZ_CUSTOMER_PROFILE_V2PUB.update_customer_profile calls do_update_customer_profile and that in turn calls HZ_CUSTOMER_PROFILES_PKG.update_row. This procedure checks if profile_class_id is passed or not. If profile class id is passed and a particular profile attribute in HZ_CUSTOMER_PROFILE_V2PUB.CUSTOMER_PROFILE_REC_TYPE is NULL then it is replaced with the value from HZ_PROFILE_CLASSES.



Similar fix is needed for customer Profile amounts too. Code similar to given below could be used for fixing profile amounts.



.......
.......
FOR l_prof_amts IN c_prof_amts
LOOP
l_prof_amt_rec.cust_acct_profile_amt_id := l_prof_amts.cust_acct_profile_amt_id;
l_prof_amt_rec.min_fc_balance_overdue_type := 'AMOUNT';
l_prof_amt_rec.min_fc_invoice_overdue_type := 'AMOUNT';
l_prof_amt_rec.interest_type := 'FIXED_RATE';
l_prof_amt_rec.interest_rate := l_prof_amts.interest_rate;
l_prof_amt_rec.min_fc_balance_amount := l_prof_amts.min_fc_balance_amount;
l_prof_amt_rec.min_fc_invoice_amount := l_prof_amts.min_fc_invoice_amount;
l_obj_version := l_prof_amts.object_version_number;

HZ_CUSTOMER_PROFILE_V2PUB.update_cust_profile_amt
( p_init_msg_list => FND_API.G_TRUE
, p_cust_profile_amt_rec => l_prof_amt_rec
, p_object_version_number => l_obj_version
, x_return_status => l_ret_status
, x_msg_count => l_msg_count
, x_msg_data => l_msg_data
) ;
IF l_ret_status <> FND_API.G_RET_STS_SUCCESS
THEN
l_errors := 1;
IF l_msg_count >= 1
THEN
FOR l_count IN 1..l_msg_count
LOOP
fnd_msg_pub.get(l_count, 'F', l_msg_data, l_msg_index);
write_msg('Error While Updating Profile, cust_acct_profile_amt_id = ' ||l_prof_amts.cust_acct_profile_amt_id
|| ', Profile class:' || l_prof_amts.name
|| ', Error: '
|| l_msg_data
) ;
END LOOP;
ELSE
write_msg('Undocumented error from Update customer Profile API is: '
|| l_ret_status
|| ' MSG COUNT IS '
|| l_msg_count
|| ' MESSAGE IS '
|| l_msg_data
);
END IF;
END IF; -- END RETURN NOT SUCCESS
END LOOP;
.......
.......




Oracle has created an enhancement bug for this issue. Bug number is 6790949.

No comments:

Post a Comment