Friday, 9 November 2018

Alternative procedure to migrate Maximo configurations - using MXDIFF,runscriptfile and MXAPPLY


Purpose: The purpose of this article is to explain the use of MXDIFF and MXAPPLY in Maximo.  These tools are very handy and you can migrate only the changes i.e. delta to other environments.

Example: You have a requirement to add a field “Require Permit” to work order object and include the field in Work Order application (WOTRACK.xml). And then apply the same to all environments.

Procedure:
Apply the configuration changes to dev
1.    In dev, initially, export wotrack.xml and save it to any folder for ex. C:\temp
2.    Add the field MC_PERMITREQ to WORKORDER object
3.    Add the field “Permit Required” to WOTRACK through application designer (or modify the wotrack.xml directly)
Prepare the migration package
1.    Export the modified version and rename as WOTRACK_MODIFED.xml. Save the modified file to C:\temp
2.    Now, we will create a transactions file which contains only the difference of the xmls.
3.    Open the CMD as administrator
CD to D:\IBM\SMP\maximo\tools\maximo\screen-upgrade
4.    Execute
mxdiff.bat –b”C:\temp\wotrack.xml" -m”C:\temp\wotrack.xml" -t"C:\temp\CHG1024_plusgwo.mxs"
-b : Original file
-m: modified file
-t: Transaction file which will contain the difference
5.    Next, we will create a dbc file to add, modify or delete attributes. Prepare a .dbc as explained in the link https://drive.google.com/file/d/1kIHrIv4wxY4MsVK7mpAiRtIvXAFLSFzR/view?usp=sharing

Apply the package
1.    In the destination environment, Copy the CHG1024.dbc to tools\maximo\en\script
2.    In the above path, MC is a custom folder to copy the customer’s .dbc files
3.    Open CMD as administrator and CD to <maximo_root>\tools\maximo\internal
4.    Execute runscriptfile.bat -f<script> [-c<subdirectory]
runscriptfile.bat –fCHG1024
runscriptfile.bat –fCHG1024_plusgwo_xml
5.    The attributes will be added to the object and wotrack.xml
6.    Turn admin mode on & off for the changes to be effective



Alternatively, use MXAPPLY to apply the xml differences (.mxs)
1.    Open the CMD as administrator
CD to D:\IBM\SMP\maximo\tools\maximo\screen-upgrade
2.    Execute
mxapply.bat -t\\dc2ap871\server1\dmnd0004124_plusgwo.mxs -pmaximo.properties








Monday, 27 August 2018

BMXAA1185E - The debit or credit general Ledger account is not specified



Issue: Works Administrator was reporting Actual Labor transactions in Work Order and for one technician Maximo was displaying the error "BMXAA1185E - The debit or credit general Ledger account is not specified".



Eventually Works Administrator couldn't proceed to report the technician's working hours.


Solution: I had a look at the issue and initially thought the GL account combination was invalid, reading the error message again, I noticed that the GL Account was not setting in either the LATRANS.GLDEBIT/LABTRANS.GLCREDIT. 

Looked at the Location's Internal Labor Account and noticed internal labor account wasn't mentioned. The internal labor cannot be blank as Maximo uses the internal labor control account as the credit account for any internal labor transaction. It is the accrual account for the value of internal labor "issued" to work orders or other activities. Maximo credits this account when you report internal labor use on a work order.

You can define the internal labor account for all the internal labor either in one of the below applications:

Location: 


Charts Of Accounts: This will be the default internal labor account for all GL transactions.

Labor:
















Tuesday, 6 March 2018

Reorder Vendor and Cost logic


Question
How does reorder determine Vendor and Cost?

Answer

How does reorder determine Vendor and Cost?
After determining the quantity of items that will satisfy reorder requirements, the next step for Maximo is to determine the vendor and cost that will be used when PRs (and optionally POs) are created.

Considering Purchase Contracts
In finding a vendor and cost for the reordered item, Maximo must first evaluate the “Consider Contracts” option.



This flag indicates whether the reorder process should seek out Purchase type contracts for determining the pricing and vendor when purchasing the item(s). (Only contracts in APPR status will be considered.)

NOTE: Primary Vendor is considered to be a storeroom’s preferred vendor when running reorder. If the Primary Vendor for an inventory item is flagged as an internal supplier (ie: another storeroom),
Maximo will NOT consider contracts from external vendors, and will always generate PRs against the supplying storeroom. The unit cost will be determined as the issue unit cost of the supplying storeroom.

1. If this flag is checked, then Maximo will first look to see if any purchase contracts exist for the item with the primary vendor.
  • If a contract is found, Maximo will convert the order quantity to the contract. Order Unit as necessary, and use this, quantity, the contract order unit, and the contract cost when creating PRs. The contract and revision number
will also be referenced on the PR. [If more then one contract is found in this scenario, Maximo will use the one with the lowest unit cost]
  • If no contract is found Maximo will proceed to step 2 below.

2. If no contract is found, Maximo will look for any purchase contracts for the item, regardless of vendor.
  • If a contract is found, Maximo will convert the order quantity to the contract痴 Order Unit as necessary, and use the contract vendor, the converted quantity, the contract order unit, and the contract cost when creating PRs.
The contract and revision number will also be referenced on the PR. [If more then one contract is found in this scenario, Maximo will use the one with the lowest unit cost]
  • If still no contract is found, Maximo will use 'standard' rules for finding a vendor and cost which are documented under the next heading 'Finding a non-contract Vendor and Cost'.

Finding a non-contract Vendor and Cost
If a contract cannot be found, or if the user has chosen to not reorder using contract information, Maximo will then attempt to find a vendor and cost based on the following rules:

Organizations and Sites

All 'non-contract' vendor/cost information is stored in the INVVENDOR table. This is viewed in the application as the Vendors table window on the reorder details tab of the Inventory application, or as the Vendors tab in the Item Master application.

INVVENDOR is a catalog of items and vendors, with corresponding manufacturers, model numbers, vendor catalog codes, pricing, and last order details.

The INVVENDOR table permits the SITE field to be optional. This allows users to have 'site-level’ pricing for a given item vendor combination. Additionally, the user can leave the site empty and the item/vendor/cost combination is considered to be at
'organization-level'. For this reason, Maximo processes the cost-finding rules below FIRST based on the site of the storeroom, and if no vendor/cost combination is found, SECOND based on the organization of the storeroom with a null site.

NOTE:
  • The rules below include references to the BidPrice column in the INVVENDOR table. This column was used in earlier versions of Maximo prior to the addition of true contracts functionality. The column remains in the table,
and is not shown on the screen by default. This column will be dropped in a future release.
  • Unless otherwise noted, the fields below are referencing the vendors table window (INVVENDOR table).
  • The rules below make reference to the REORDERPAD table. This table is used to store the data that has been processed by reorder but has not yet been processed into a PR (or PO). It is a ‘staging area’ that allows the
reorder functionality to complete its processing and then turn the finished data into a consolidated set of PRs and POs.


1. Find a Unit Cost based on Primary Vendor
For a given item/storeroom/site combination, if primary vendor is specified in INVENTORY, Maximo will sort the INVVENDOR table based on the item, primary vendor, and site of the storeroom order by last date in descending order,
use the first record where the last date is non-null. (If no record is found, re-process rule #1 based on the organization of the storeroom. If still no record found move to rule # 2 below)
a. If BidPrice is non-null and > then zero, use BidPrice
b. Otherwise use Last Cost.

When writing records to ‘Reorderpad’:
a. Set the cost from INVVENDOR. (Either BidPrice or Last Cost based on above).
b. Set the order unit from INVVENDOR. If null, set the order unit from INVENTORY.
c. Convert the reorder quantity into the order unit from INVVENDOR. If a conversion between the units does not exist, an error will be written against this item, and it will not be reordered.
d. Set the vendor, manufacturer, model number and catalog code based on the values in the Inventory application, reorder details tab, primary vendor section.

2. Find a Unit Cost based on ANY vendor (with Primary Vendor Specified)
For a given item/storeroom/site combination, IF primary vendor is specified in INVENTORY, Maximo will sort the INVVENDOR table based on the item and site of the storeroom order by last date in descending order,
use the first record where the last date is non-null. (If no record is found, re-process rule #2 based on the organization of the storeroom. If still no record found move to rule # 3 below)
a. If BidPrice is non-null and > then zero, use BidPrice
b. Otherwise use Last Cost.

When writing records to 'Reorderpad':
a. Set the cost from INVVENDOR. (either BidPrice or Last Cost based on above)
b. Set the order unit from INVVENDOR. If null, set the order unit from INVENTORY.
c. Convert the reorder quantity into the order unit from INVVENDOR. If no conversion
exists, error out this item.
d. Set the vendor, manufacturer, model number and catalog code based on the values in
the Inventory application, reorder details tab, primary vendor section.

3. Find a Unit Cost and Vendor based on the 'Default Vendor'
NOTE: The ‘Default Vendor’ is an organization-level default catalog row that is used to source items for direct issue scenarios. The ‘ISDEFAULT’ flag is used to indicate this record is the default vendor for the item in the organization. The
organization can have only one default vendor. In the case of reorder, Maximo will consider the default vendor when it determines price, ONLY if a cost cannot be determined for the primary vendor.

For a given item/storeroom/site combination, if the primary vendor is NULL in INVENTORY, Maximo will perform a select based on the ISDEFAULT flag. Maximo will take the ISDEFAULT record. (If no record is found move to rule # 4 below)
a. If BidPrice is non-null and > then zero, use BidPrice
b. Otherwise use Last Cost.

When writing records to ‘Reorderpad’:
a. Set the cost from INVVENDOR. (Either BidPrice or Last Cost based on above)
b. Set the order unit from INVVENDOR. If null, set the order unit from INVENTORY.
c. Convert the reorder quantity into the order unit from INVVENDOR. If no conversion
exists, error out this item.
d. Set the manufacturer, model number and catalog code based on the values in the
Inventory application, reorder details tab, primary vendor section.

4. Find a Unit Cost based on ANY vendor (Without Primary Vendor Specified)
For a given item/storeroom/site combination, Maximo will sort the INVVENDOR table based on the item and site of the storeroom, order by last date in descending order, use the first record where the last date is non-null. (if no
record found, re-process rule #4 based on the organization of the storeroom. if still no record found, Maximo will write a PR with a null vendor and a unit cost of zero)
a. If BidPrice is non-null and > then zero, use BidPrice
b. Otherwise use Last Cost.

When writing records to ‘Reorderpad’:
a. Set the cost from INVVENDOR. (Either BidPrice or Last Cost based on above)
b. Set the order unit from INVVENDOR. If null, set the order unit from INVENTORY.
c. Convert the reorder quantity into the order unit from INVVENDOR. If no conversion
exists, error out this item.
d. Set the vendor, manufacturer, model number and catalog code based on the values
from INVVENDOR.

Monday, 3 October 2016

PM with route does not generate parent work order

Issue: PM does not generate Parent work orders, but generate child work orders

Solution: Most of the PMs have a route associated with it and has multiple job plans associated with each PM. We noticed the Parent work orders were not created, but the child work orders were created. The Child work order has the parent WO number tagged with it, but if you navigate to the parent wo, the record doesn't exist in the system.

I verified the parent work order from workorder, workview, wostatus objects, but the record doesn't exist in any object.

After enabling logging I noticed the parent work order was created, but the system  is deleting the record from all relevant objects.

So I picked up the PM (The PM has a route with multiple job plans) which was having a problem and tried to generate work orders manually. I noticed that after successfully generating work orders, the system is trying to save the PM and while saving the PM an error is displayed "Record has been updated by another user" and as the PM wasn't successfully saved, the system is trying to delete the work order generated. But to my surprise, system is deleting only the parent PM work order, but not child work order and other relevant activities - This could be a Maximo bug.

Now coming to reason why the PM was not successfully saved: the system is trying to update JPSEQINUSE to 1 (the current value is 0) as there are multiple job plans associated with the PM. We identified the PMs were loaded through MIF and the JPSEQINUSE was set to 0 irrespective of the multiple job plans associated with the PM.


Maximo doesn't display start center after successful log in


Issue: End Users are able to successfully log in into Maximo, but after log in - a white page is displayed.

Solution: Initially I thought  it  was due to insufficient hard disk space, but my assumption was incorrect.

Then one of my colleagues advised to me to try navigating directly to work order application by typing in app=wotrack in the address bar - it opened up the work order application!. From there, I navigate to start center and the start center displayed.

On the start center, my name wasn't displaying and displays as "Welcome,{null}". So I navigate to person application to check if my name was overwritten. To my surprise my personid doesn't exist anymore in the system, whereas my user id still exist in the system. Due to this reason, I was able to log in into Maximo, but couldn't access my start center as the personid doesn't exist.

So I created my personid and since then I have been able to successfully acess start center and navigate to other applications using the Go To menu.

Later we identified the person records were deleted from the system due to the replication configuration.




Tuesday, 28 June 2016

Increase ASSETNUM, PRNUM field length on Screen

Issue: 1. ASSETNUM, PRNUM, PONUM key identifiers are part of muti-part textbox and unable to increase the length on screen.
2. Bold & Underline the label


Solution: Apply the below to increase the length of key identifiers.

Edit C:\ibm\SMP\maximo\applications\maximo\maximouiweb\webmodule\webclient\css\maximo.css OR
C:\ibm\WebSphere\AppServer\profiles\ctgAppSrv01\installedApps\ctgCell01\MAXIMO.ear\maximouiweb.war\webclient\css\maximo.css

add your code as follow:
.gwpart1width { width:150px; font-family: arial, sans serif, verdana; font-size: 11px; }
.gwpart2width { width:400px; font-family: arial, sans serif, verdana; font-size: 11px; }
.gwunderline { text-decoration:underline;}

how to use (modify at Application Designer):
1. set properties first part of multiparttextbox using 'textcss', and second part of multiparttextbox using 'desctextcss'
ex: <multiparttextbox applink="asset" dataattribute="assetnum" descdataattribute="description" id="main_grid8_1" desctextcss="gwpart2width " textcss="gwpart1width "/>
2. set properties labelcss
ex: <multilinetextbox columns="33" dataattribute="GW_ACTUALCAUSE" id="1337075607498" rows="5" labelcss="txtbold gwunderline"/>

Thursday, 26 May 2016

Reports aren't executing properly in Clustered environment

Issue: All Reports were executing properly, but after migrating to a new environment i.e copied database from Prod to dev few reports are executing and few reports gives weird errors. The same issue can happen after Maximo upgrade

Version: Maximo 7.1 or higher

Solution: In a clustered environment, initially, you must generate the request page xml for each individual instance or all JVMs have to be restarted after generation of request pages in one JVM.

Scheduled Reports are not generating


Issue: Scehduled Reports are not generating after Maximo upgrade or migrating Maximo environment.

Version: Maximo 7.5.0 or higher

Solution: Delete jar file of BIRT version from plugin folder

Tuesday, 15 December 2015



WebSphere Installation - Port 80 is Not Available


while installing Maximo/WebSphere, you may encounter an issue with Availability of Port (mostly Port 80).

Resolution:

Generic about checking Port Availability:

To check which all ports are being used, run this on command prompt (in windows):
         netstat -an
Output of above command will show all the ports which are in use.

To check a specific port (e.g. Port 80), run the following command (in windows):
         netstat -an | find "port_number"
         netstat -an | find "80"
If above command returns any output, that means port is in us.
If above command doesn't return any output, Port is Free, and can be used.

Work Around for WebSphere Port 80 Issue:

Go to Administrative Tools in Windows
Open Internet Information Services (IIS) Manager
Expand Server Node (Host Name) on the left panel
Expand Sites
Click on Default Web Site
On right panel, click on Bindings
New window will open with List of Bindings, select http, click on Edit button
Change Port from 80 to 8080, click Ok, click Close
Select Server Node (Host Name) on the left panel again and click on Restart Server from the right panel to restart IIS Server,
No reboot is required.

Now you can proceed with the Installation, error should be resolved.

Reference: http://knowmaximo.blogspot.com.au/2015/10/websphere-installation-port-80-is-not.html

Wednesday, 21 October 2015

Maximo outbound files with Chinese text displays as ??



Issue: Maximo is enabled with 'Chinese' language and majority of the data is entered in Chinese. Maximo is customized to generate outbound text (.txt) files into a folder. Noticed that the Chinese characters are displayed as ?? in the .txt files.

Environment: Maximo 7.5, SQL Server 2008, Windows 2008


Solution: To resolve this issue, the below are configured in the windows environment:
1. Install Chinese fonts ;
2. Uncheck " Hide Fonts" in Font settings. 





Thursday, 1 October 2015

VMWARE Doesn't Shut Down



Nowadays, for many reasons we use VMware and in my case I love using vmware for development ! If my environment corrupt, I just delete the image and use the backup image (off course my development environment). But recently few images doesn't shutdown - shows BLACK screen - even after many hours; I need to force shutdown my computer, but this sometimes corrupt my image.

After spending some time on the internet, the best solution I found is to edit the .vmx file with the below properties: 

1. Shut down the VM before you do anything; if something like a Production server,
you should either backup the entire directory that holds the VM files or take a
snapshot (depends on your product).
2. In the VM's folder, locate the .VMX file
3. Make a copy (backup) of the file (this is important!)
4. Edit the file using notepad (don't use anything like Word) - locate the following
entries in file - if you DO NOT find them, add them to the bottom of the file:
prefvmx.minVmMemPct = "100"
mainMem.useNamedFile = "FALSE"
mainMem.partialLazySave = "FALSE"
mainMem.partialLazyRestore = "FALSE"
5. Save the file and exit notepad
6. Start the VM - let it completely start, log in, then choose normal shutdown - should
now shutdown in a matter of seconds.


I've had no adverse effects with these settings but use at your own risk. 

Monday, 6 April 2015

Unable to login into Maximo


Issue: This morning after I came back from my long weekend, I tried to login into one of  our customers development environment using Maxadmin. Surprisingly, I get a message "Cannot Login into Maximo at this time. Please contact System Administrator". We have no password expiry set up nor reset the maxadmin password.

I checked Maxadmin password from database and don't notice any change in password. I also noticed that when I remote login into development environment or access SQL developer, system was too slow.

First thing, I thought the slowness might be due to insufficient space and my assumption was right, 0 GB available. I started deleting all unwanted files including old log files. Then, I shrink the SQL Server database log files to free more space.

Now, again I tried to login into Maximo.

 Hurray, I was able to login into Maximo !!!

Solution: Free up the disk space. 

Wednesday, 15 October 2014

Save Record on selecting tabs

Purpose: Save the record on selecting a tab ex. Save Work Order on selecting "Plans" Tab.

Solution: Add tabchangeevent="save" for Plans tab as below:

              <tab id="plans" label="Plans" tabchangeevent="save">

Thursday, 24 April 2014

Import Maximo Asset Specifications through MIF



Purpose:  Loading of Asset Specifications

Versions: 7.x. I have not tried the procedure in Maximo 6.x but might work.

Solution:
I am providing two options to load Asset Specifications. Choose the options suitable to you.

Method 1:
1.       Create Object Structure MC_ASSETSPEC as below
a.       Parent: ASSET
b.      CHILD: ASSETSPEC
2.       Copy the Inbound processing class from MXASSET object structure and use the same class for MC_ASSETSPEC object structure.
3.       Create the Enterprise Service and associate with External System.
4.       Import the date using the below template. You will not be able to load the asset along with specification at the same time. You need to load the data in two steps using the same object structure. Create two copies of the same template.
a.       First template will contain the Asset and classification.
b.      Second template will contain Asset, Classification and attributes.

For Ex: First template looks as below:
MCDataLoad,MC_ASSETSPEC,AddChange,EN
ASSETNUM,ASSETATTRID,NUMVALUE,MEASUREUNITID,ALNVALUE,HIERARCHYPATH,SITEID,ORGID
PUMP001,,,,,SECURITY \ EPS,MC,MCORG

Second template looks as below:
MCDataLoad,MC_ASSETSPEC,AddChange,EN
ASSETNUM,SECTION,ASSETATTRID,NUMVALUE,MEASUREUNITID,HIERARCHYPATH,ALNVALUE,SITEID,ORGID,LINEARASSETSPECID
PUMP001,,TEST,,,SECURITY \ EPS,1480,MC,MCORG,0
PUMP001,,TEST-NUMERIC,213,,SECURITY \ EPS,,MC,MCORG,0
PUMP001,,RAM,,,SECURITY \ EPS,512, MC,MCORG,0

Note: In the above templates for HIERARCHYPATH field, I have provided the entire hierarchy. This procedure requires to enter the entire classification hierarchy. Entering just the classification will not work.
In the second template, hierarchy path is optional. Add the hierarchy path i.e. classification if you want add an attribute that does not exist in the classification.

Method 2:
1.       Create Object Structure MC_ASSETSPEC as below
a.       Parent: ASSET
b.      CHILD: ASSETSPEC
2.       Create the Enterprise Service and associate with External System.
3.       In Asset Object , Create a relationship as below
    Name: RWS_ASSET_CLASS_STRUCT
   Child Object: CLASSSTRUCTURE
   Relationship: classificationid=:classtructureid
 In Enterprise Service > Asset Object, create a processing rule as below:





5.       Import the date using the below template. You will not be able to load the asset along with specification at the same time. You need to load the data in two steps using the same object structure. Create two copies of the same template.
a.       First template will contain the Asset and classification.
b.      Second template will contain Asset, Classification and attributes.

For Ex: The first template looks as below:
MCDataLoad,MC_ASSETSPEC,AddChange,EN
ASSETNUM,ASSETATTRID,NUMVALUE,MEASUREUNITID,ALNVALUE,CLASSSTRUCTUREID,SITEID,ORGID
PUMP001,,,,,EPS,MC,MCORG

Note: In classstructureid field, enter the required classification. The processing rule will set the correct Classstructureid for the asset.

For Ex: The second template looks as below:
MCDataLoad,MC_ASSETSPEC,Change,EN
ASSETNUM,SECTION,ASSETATTRID,NUMVALUE,MEASUREUNITID,HIERARCHYPATH,ALNVALUE,SITEID,ORGID,LINEARASSETSPECID
PUMP001,,TEST,,,EPS,1480, MC,MCORG,0
PUMP001,,TEST-NUMERIC,213,,EPS,,MC,MCORG,0
PUMP001,,RAM,,,EPS,512,MC,MCORG,0

Note: In hierarchypath field enter the required classification. Need not enter the full classification hierarchy as in Method 1.
In the second template, hierarchy path is optional. Add the hierarchy path i.e. classification if you want add an attribute that does not exist in the classification.





Thursday, 10 April 2014

Import Maximo Classifications using MXCLASSIFICATION Object Structure


Purpose: This technote will explain the procedure to import Classifications using MXCLASSIFICATION Object Structure.

Issue: Many times, I has problem loading classifications along with its hierarchy in Classifications application using MXCLASSIFICATION object structure. Hence, I tried other alternative ways successfully by creating additional fields + Processing rules and importing the classification along with its hierarchy. With this procedure you will not require any additional fields and make use of the standard MXCLASSIFICATION Object Structure.

Applicable To: All versions of Maximo.

Solution: 
    1. In MXCLASSIFICATION Object Structure, remove the default Inbound     processing class.
    2. In ‘Restrict Attributes’ menu option, In the Source Object List, select   CLASSSTRUCTURE.
    3. Uncheck Restrict checkbox and check Override checkbox for below fields:
a.  Classstructureid
b.  Parent
    4. Select Action > Exclude / Include Fields
    5. In the Source Object List, select CLASSSTRUCTURE
    6. In the Persistant Fields sub-tab, look for HASCHILDREN and UNCHECK the       EXCLUDE checkBox. This will include the field in the schema.
    
    Please note MXCLASSIFICATION Object Structure should support flat file as I am using flat file to import data.

As, I am unable to attach templates with this blog; hence for template, export few classification records from the publish channel using MXCLASSIFICATION object structure and use the same template for importing classifications.

You can use the same template for loading Classstructure, Classusewith & Classspec. In the templates, the value in classstructureid should be the same as classificationid as below. 


Monday, 19 August 2013

Go To menu does not work in Maximo.


Purpose: The purpose of this document is to explain one of the reason 'Go To' menu does not work.

Applicable: To all versions of Maximo.

Issue: I have created an image (to prepare QA server) from Production Server in which Maximo was working well. I changed the Host name in all relevant files and was able to successfully login into Maximo. However, I am unable to select 'Go To' menu including all menu options. Even Start Center page was hanging.

Solution: Frankly speaking, I struggled to fix this issue for 2 days. I thought it might be some javascript issue or some other class issue. I compare all IE settings with production sever and all were the same. So, I couldn't figure out what was the issue.  So, finally I thought of enabling Active X in IE settings even though it wasn't enabled in Production.

I enabled all settings relating to Active X & Scripting in Tools -> Internet Options -> Security -> Internet -> Custom Level.


Monday, 29 July 2013

Migration Manager Fails when Required=1 and Default Value is blank

Purpose: The purpose of this post is to explain one of the reason for which MM package deployment fails.


Issue: I experienced myself when I was migrating database configuration attributes through MM package. MM package failed during deployment and we were getting an error "Required Fields are Blank". Initially, I couldn't find out the root cause but after some struggle, I found out that few fields in Database configuration are "Required=1" and "Default Value" is blank. 


Work Around: Entered some dummy values in "Default Value" and again created the package and was able to successfully deploy the package in Target sever. After successful deployment removed the dummy default values. 

The above procedure will be helpful, if you have few custom fields but this will not help if you have many custom fields.

Hence, I recommended it is very important to plan the migration procedure during planning phase. 


Thursday, 25 July 2013

Delete Workflow History for Inactive Records


Purpose: As years pass by, the database size increases and you would like to delete unwanted records especially workflow history. This document explains you how to delete workflow history.

To delete the workflow history, execute the below scripts:

delete
from wftransaction
where wfid not in
(
  select wfid
  from wfinstance
  where active = 1
)
  and transdate <= (current timestamp - 1 month)
  and memo is null;
commit;

delete
from wfcallstack
where wfid in
(
  select wt.wfid
  from wftransaction wt
    ,wfinstance wi
  where wt.wfid = wi.wfid
    and wi.active = 0
    and transdate <= (current timestamp - 1 month)
    and memo is null
);
commit;

delete
from wfassignment
where wfid in
(
  select wt.wfid
  from wftransaction wt
    ,wfinstance wi
  where wt.wfid = wi.wfid
    and wi.active = 0
    and transdate <= (current timestamp - 1 month)
    and memo is null
);
commit;

delete
from wfinstance
where wfid in
(
  select wfid
  from wftransaction
  where memo is null
    and transdate <= (current timestamp - 1 month)
)
  and active = 0;
commit;

delete
from logintracking
where attemptdate <= (current timestamp - 3 month);
commit;