Sage MAS 90 and 200 Sage MAS 500 blogs Product Feedback Support Training
Reply
unidentified user
Watson_Holyfield
Posts: 2
Registered: 08-26-2011
0

Removing records from IM_PriceCode table

Does anyone have a way to delete large quanities of records from the IM_PriceCode table?  Previously imported both Record Type 1 and Record Type 2 data into this table.  Now need to delete selected records.  For example; imported Record Type 1 Customer Price Level Code "D" for a large groups of Item Codes.  Now need to get rid of Customer Price Level Code "D" for all of those items.  The only solution I can think of is to extract the IM_PriceCode table to Excel, remove the selected records, reinitialize the IM_PriceCode table and then import the remaining records back into the table.  This will potentially be a recurring event, so I am not sure that my solution is practical.

 

Thanks for any ideas.

Watson

Super Contributor
DFeller
Posts: 2,943
Registered: 10-28-2008
0

Re: Removing records from IM_PriceCode table

Regular Contributor
Broadfoot
Posts: 120
Registered: 10-29-2008
0

Re: Removing records from IM_PriceCode table

I would agree with Dawn.   BOI is well worth a look.

 

We have a client that has maintained Customer pricing parameters in Access since Import Master/Report Master/Unix days.  The  updates from Access to MAS 200 were handled by exporting the non-customer price records, re-initializing the file, Importing the non-customer price records and then importing the customer price records generated by Access.  It took most of the night to handle 500K records.

 

When we moved them to 4.4 we changed to directly edting (Add, Delete and Change) the price code file with BOI and have shortened the whole process to just a few minutes.

 

John Broadfoot

Thanks,
John Broadfoot
Administrator
ebjelovs
Posts: 371
Registered: 10-16-2008
0

Re: Removing records from IM_PriceCode table

Watson!

Welcome to the Sage MAS Community Forum and back into our world of fun!  For what it is worth, I agree that Dawn and John are onto something here with their BOI suggestion.  Glad to see you are back in action!!

Erika Jelovsek
Sr. Product Manager
Sage 100 ERP
Sage 300 ERP
Sage 500 ERP
Sage ERP X3
Moderator
SRYork
Posts: 125
Registered: 11-06-2009
0

Re: Removing records from IM_PriceCode table

I don't want to sound too out of it, but what is BOI?  I've been around awhile and that acronym doesn't mean anything to me.  Would someone please educate me?

:smileymad:

 

GatorGal
Sage MAS Partner
JimPetrie
Posts: 239
Registered: 11-06-2008

Re: Removing records from IM_PriceCode table

@GatorGal, BOI = "Business Object Interface".

 

@Everybody else, if you decide to reinitialize IM_PriceCode you'll get an error 11 everywhere that references that file (including when you try to run a V/I job against it) until you go in IM -> Setup -> Price Code Maintenance and manually re-define a "STD" price level.

unidentified user
Watson_Holyfield
Posts: 2
Registered: 08-26-2011
0

Re: Removing records from IM_PriceCode table

Thanks everyone for this information.  I will pursue the BOI solution.

 

And thanks, Jim for the information on the reinitialization of the IM_PriceCode table.  In all the years I have worked with MAS90, I was not aware of this situation with that table.

 

Watson

Switcher
SPyle
Posts: 977
Registered: 11-03-2008
0

Re: Removing records from IM_PriceCode table

Jim,

 

Great tip.  I, too, was trying to clean up the price code file, but the import kept bombing and I didn't know why.  Another problem then became more urgent and I never pursued a solution. 

 

Now, where's that round tuit....

Steve
Regular Contributor
viperbri
Posts: 84
Registered: 11-03-2008
0

Re: Removing records from IM_PriceCode table

Hi all,

Could anyone point me in the right direction on the BOI code to remove the records from the IM_PriceCode table?  I have a customer of mine who wants to do the same (we also use an Access app to maintain their pricing).  I have perused the BOI documentation and can't seem to find the right code to get it to work.

 

Thanks,

Sage MAS Partner
judah
Posts: 7
Registered: 05-11-2010
0

Re: Removing records from IM_PriceCode table

For removing pricing records, these are just the important bits and pieces, written in VB.net

 

Get the price business object

oPrice = oScript.NewObject("IM_PriceCode_bus", oSS)

Step through the pricing records

oPrice.nMoveNext()

Get the key of the current pricing record

stKey = oPrice.sGetKeyPadded()
stKey = stKey.Replace(Chr(0), " ")  'Replace null characters with spaces 

Use your logic to see if stKey tells you that this is a record that needs to be deleted

 

Delete the record.  I have my own Log function to track errors, and am counting up the number of records deleted for a summary email when done.

'Remove the record
If oPrice.nDelete() <> 1 Then
  Log("nDelete " & stKey & oPrice.sLastErrorMsg, frm, 1)
Else
  inRecordsDeleted += 1
End If