RSS

Tag Archives: data

DIXF – How to regenerate target entities

There is time when you add custom fields to staging table and they do not appear in your Target when you promote data from STAGING to TARGET. The reason the new fields do not appear in TARGET because it does not know there are new fields that we need to regenerate field mapping for the target.

There are 2 ways to do this, I’m going to show you both LONG WAY and SHORT WAY

LONG WAY

1. Go to the DIXF area page. Click on Target entities.

image

2. Find the entity in the list.

clip_image001[5]

3. Click on the “Modify target mapping” at the top:

image

4. Click on “Mapping Details”

image

5. Click on “Generate mapping”

clip_image001

6.  Answer “Yes” to prompt

image

7. You should see your new fields in the list

clip_image001[13]

SHORT WAY

Run either one of the 2 jobs below

This jobs run for all entities

static void regenerateDMFTargetMapping(Args _args)
{
    DMFTargetXMLToEntityMap     dmfTargetXMLToEntityMap;
    DMFEntity                   dmfEntity;
 
    // delete all target Mappings
    ttsBegin;
        delete_from dmfTargetXMLToEntityMap;
    ttsCommit;
 
    // Regenerate Target Mapping for all Entities
    while select dmfEntity
    {
        DMFTargetXMLToEntityMap::generateMapping(dmfEntity);
    }
 
    info("All Done!");
}

This one run for  one entity. Make sure to replace your <Entity Name> with your entity

static void regenerateDMFTargetMapping(Args _args)
{
    DMFTargetXMLToEntityMap     dmfTargetXMLToEntityMap;
    DMFEntity                   dmfEntity;
 
    // delete specified target Mapping
    ttsBegin;
        delete_from dmfTargetXMLToEntityMap where dmfTargetXMLToEntityMap.Entity = <EntityName>;
    ttsCommit;
 
    // Regenerate Target Mapping for specified Entity
    while select dmfEntity where dmfEntity.EntityName = <EntityName>
    {
        DMFTargetXMLToEntityMap::generateMapping(dmfEntity);
    }
 
    info("All Done!");
}

ADVANTAGE OF USING JOBS

Sometimes it is not possible to regenerate the target mapping for a particular entity as clicking on “Modify target mapping” generates an error.   This error typically reads along the lines of

“Duplicate assignment found for the following target field <some field name>”

DMFDuplicateAssignment

“Cannot create a record in Target XML (DMFTargetXML)”

image

Run the job will fix these issues.

Advertisements
 
2 Comments

Posted by on August 26, 2014 in Development

 

Tags: , , , , , , ,

Effective way to resolve all weird issues caused by users’ cache

I found these steps below are very effective to clear up weird issues after code/data migration or when users start experiencing wacky behaviors

STEP 1: Run the job below

public server static void FlushAll(Args _args)
{
   Args args;
  
   // Leave the "args" as null will skip the info messages normally shown when using menu items.
   SysFlushAOD::main(args);
   SysFlushData::main(args);
   SysFlushDictionary::main(args);

}

STEP 2: Delete user cache

Method 1:

  1. STOP AOS
  2. Log on to TS where all users use to connect to AX
  3. Search of *.AUC files and delete all these files
  4. Restart AOS

Method 2:

  1. Run this job on TS where all users use to connect to AX.
static void ClearAucFileForUsers(Args _args)
{
    System.Array    files;
    int             fileCount;
    int             i;
    str             nextFile;
    str             path = "C:\\Users";
    str             Finalpath;
    str             pattern = "*.auc";
    container       listOfFiles;
    int             DirCount;
   
   
    System.Array    Directories;
    int             j;
    str             nextDir;
    container       listOfDir;
   
    FileIOPermission    dirPermission, filePermission;
    InteropPermission   interopPermission;
    Set                 permissionSet;
   
    new InteropPermission(InteropKind::ClrInterop).assert();
    listOfDir = conNull();
    listOfFiles     = connull();
   
    Directories = System.IO.Directory::GetDirectories(path);
    if(Directories)
    {
        DirCount = Directories.get_Length();
       
        for(j=0; j < DirCount; j++)
        {
            nextDir    = Directories.GetValue(j);
            Finalpath = nextDir + "\\AppData\\Local";
            listOfDir += Finalpath;
        }       
    }
    j=0;
    DirCount = conLen(listOfDir);
    while( j < conLen(listOfDir))
    {
        j++;
        Finalpath = conPeek(listOfDir,j);
        try           
        {
            files           = System.IO.Directory::GetFiles(Finalpath, pattern);
        }
        catch
        {
            continue;   
        }
        if (files)
        {
            fileCount =    files.get_Length();
           
            for(i=0; i < fileCount; i++)
            {
                nextFile    = files.GetValue(i);
                System.IO.File::Delete(nextFile);       
                info(nextFile);
            }
        }
    }
   
    CodeAccessPermission::revertAssert();
}
  1. Stop and Restart AOS

STEP 3: Delete SysLastValue

static void DeleteAllLastValue(Args _args)
{
    SysLastValue syslastValue;   
   
     ttsBegin;
     delete_from syslastValue;
     ttsCommit;   
}
 
 

Tags: , , , , ,

Software update checklist – Data Upgrade Issue

After installing a hotfix, I could not pass software update checklist. “Launch Data Upgrade” keeps giving me an error


The dependency cannot be resolved because script ReleaseUpdateDB60_TaxIntegration_CN.updateExternalInvoice_CN was never added. (ReleaseUpdateDB60_TaxIntegration_CN.updateTaxProfilePort_CN)

Error loading upgrade scripts

image

CURRENT BUILD:

image

ISSUE:

After struggling too much time, I finally found out the root cause of the issue. The hotfix that Microsoft gave me introduced a new bug that the data upgrade cockpit form could not be opened.

updateTaxProfilePort_CN script has dependency on updateExternalInvoice_CN.

When I compared this class with other builds (before and after of this current version), this class ReleaseUpdateDB60_TaxIntegration_CN does not have such dependency on the script.

SOLUTION:

1. On the ReleaseUpdateDB60_TaxIntegration_CN Class method updateTaxProfilePort_CN, I  remove the dependency method attribute and then re-compile and do an incremental generation.

clip_image002

2.  After that, I update the ReleaseUpdateMinorScripts table and set the finished column to 0 for ReleaseUpdateDB60_TaxIntegration_CN and updateExternalInvoice_CN.

RESULT:

clip_image002[1]

 
Leave a comment

Posted by on January 14, 2014 in Installation and Configuration

 

Tags: , , , ,

How to flush AOS cache form code

Flush the AOS cache from code

Under Menu items > Action, duplicate all these 3 menu item actions and three menu action items that can be used to flush system data, the AOD, and dictionary
1. SysFlushAOD
2. SysFlushData
3. SysFlushDictionary

Duplicate these 3 menu action items and give them a new name

image

These three are running on “Called From” which when we run it on client side, it will clear client cache. We need to be able to clear AOD, sys data and dictionary and cause a refresh, therefore, we need to change it to “Server”

Go to RunOn property and change it from “Run-On” to “Server”

image

Now, start run each menu action item one by one.

static void DevClearCache(Args _args)
{
#define.FlushAOD(“DevSysFlushAOD”)                  // replace with your own menuitem name
#define.FlushData(“DevSysFlushData”)                // replace with your own menuitem name
#define.FlushDictionary(“DevSysFlushDictionary”)    // replace with your own menuitem name
Args args = new Args();
MenuFunction mf;

// Flush AOD
mf = new MenuFunction(menuitemActionStr(#FlushAOD), MenuItemType::Action);
mf.run(args);

// Flush Data
mf = new MenuFunction(menuitemActionStr(#FlushData), MenuItemType::Action);
mf.run(args);
info(“Data has been refreshed”);

// Flush Dictionary
mf = new MenuFunction(menuitemActionStr(#FlushDictionary), MenuItemType::Action);
mf.run(args);
}

You can download the entire project here.

 
2 Comments

Posted by on December 11, 2013 in Development

 

Tags: , , , , , ,

 
%d bloggers like this: