Is it possible to automatically update the Revenue...
# arm
l
Is it possible to automatically update the Revenue Account in revenue arrangements by changing the Income Account in the item records? We accidentally assigned a wrong Income Account to item records that are already associated with open sales orders or billed sales orders (with invoices). There are also Revenue Arrangements and Revenue Plans generated but no Revenue Recognition JEs yet. Here's what I did: 1. Delete the revenue plans. 2. Update the income account of item records (does not automatically update the revenue account in RAs). 3. Manually change the revenue account in RAs. 4. Update the Revenue Plans. 5. Generate the Rev Rec JEs which show the NEW revenue account. The problem with this is that there are about 4000 RA lines to update. It is not yet possible to update this through CSV or script (correct me if I am wrong). When I tried to delete the RAs, I had to retoggle the item in the SOs (not possible if there is an invoice already) to effect the NEW revenue account.
a
A couple years ago I had performed updates to revenue elements (indirectly) via script. The changes had to be initiated as sublist updates to the Revenue Arrangement record. For my particular use case I was updating Start/End dates from the Sales Order to the invoice and revenue arrangement lines. If I needed I could have run csv imports on my Sales Orders (scripts/workflows enabled) and updated all of the records. You don't necessarily need to go this exact route (starting at SO) if you aren't updating anything on the Sales Order. Perhaps a more direct update the the Revenue Arrangement is appropriate, but you and your team would know best. At the moment I don't really have access to a valid account to test this on, but you or a developer can validate this concept in your sandbox using the browser console. Don't be messing around in production until you validate that you are getting the expected results in sandbox. If it's important enough I would even consider refreshing the sandbox environment to have an accurate representation for the business to review and approve whatever fix is attempted. • If you can do it in the UI then you can typically do it with a script, though I suppose there are plenty of exceptions... • If you cannot do it in the UI, then you probably want to consider another solution anyway Below is a SS 1.0 snippet for setting and getting the first line of an arrangement in the console. Just put replace the bolded internal ID placeholders with the actual internal IDs from your environment.
var rec = nlapiLoadRecord('revenuearrangement',_*REVENUE_ARRANGEMENT_INTERNAL_ID*_);
var count = rec.getLineItemCount('revenueelement');
for(var i=1; i<=count; i++){
rec.selectLineItem('revenueelement', 1);
rec.setCurrentLineItemValue('revenueelement', 'recognitionaccount', _*ACCOUNT_INTERNAL_ID*_);
rec.commitLineItem('revenueelement');
var accountGet = rec.getLineItemValue('revenueelement', 'recognitionaccount', 1);
}
nlapiSubmitRecord(rec)
accountGet
l
Thank you so much! But this one has to be done using the BROWSER CONSOLE, right?
a
Yes, the code snippet can be executed via browser console just to demonstrate/validate the concept. If that works for you, then you would need a developer to create a more refined solution to accomplish your goals. For updating Rev. Arrangements based on saved search criteria, creating a Map/Reduce script might be best.
l
Oh? It's possible to run a map/reduced script on Revenue Arrangements?
a
Yes, it should be possible based on what I have already accomplished - and what the code snippet should demonstrate. However, certain events like JE posting to the plan on an element (line) could alter what is available for modification on the record.
l
I meant map/reduce using a script record not on the console because per NS, it is not possible.
a
Could you share that communication or SuiteAnswer?
l
Enhancement Request No. 488655
a
That enhancement is for working with the revenue element directly via suitescript, which is not possible. You can update the records indirectly (as a sublist/line level) through the Revenue Arrangement record.
l
But in the SuiteScript Records Browser, the Revenue Element is not available in the Revenue Arrangements section. Only the header level info are shown. I hope I'm wrong but this is what I see.
a
If this is something where you can get a developer resource you can have them quickly validate the concept with the code snippet I sent. If not, then it sounds like manually updating ~4000 lines is the only other way it'll get resolved... 🤮