If the Customer Synchronization between Counterpoint and Magento is being used and you need to map a customer profile code to a Magento Customer group then the following standard trigger on the Customer Table (AR_CUST) needs to be modified to track changes to customer profile codes.


Trigger on Customer Table: TR_AR_CUST_UPD_ECOMM

The following sections of this trigger need to have the code in red added. In this example we are looking to track changes to the Customer Profile Code 1 field


Note: Please make a backup of this trigger before making any changes

**********************************************

  if not(
      Update(IS_ECOMM_CUST) or
      Update(CUST_TYP) or
      Update(ALLOW_AR_CHRG) or
      Update(CR_LIM) or
      Update(NO_CR_LIM) or
      Update(BAL) or
      Update(UNPSTD_BAL) or
      Update(ORD_BAL) or
      Update(LWY_BAL) or
      Update(CATEG_COD) or
    Update(PROF_COD_1) or
      Update(TAX_COD) or
      Update(DISC_PCT) or
      Update(ECOMM_AFFIL_COD) or
      Update(NAM) or
      Update(FST_NAM) or
      Update(LST_NAM) or
      Update(ADRS_1) or
      Update(ADRS_2) or
      Update(CITY) or
      Update(STATE) or
      Update(ZIP_COD) or
      Update(CNTRY) or
      Update(CONTCT_1) or
      Update(PHONE_1) or
      Update(FAX_1) or
      Update(EMAIL_ADRS_1) or
      Update(COMMNT) or
      Update(SHIP_VIA_COD) or
      Update(CR_CARD_NO_1) or
      Update(CR_CARD_NO_1_ENC) or
      Update(CR_CARD_EXP_DAT_1)
  )
    return

**********************

when
            ( deleted.IS_ECOMM_CUST = 'N' and inserted.IS_ECOMM_CUST = 'Y' ) or
            dbo.fnValuesDiffer(deleted.CATEG_COD, inserted.CATEG_COD)='Y' or
        dbo.fnValuesDiffer(deleted.PROF_COD_1, inserted.PROF_COD_1)='Y' or
            dbo.fnValuesDiffer(deleted.TAX_COD, inserted.TAX_COD)='Y' or
            dbo.fnValuesDiffer(deleted.DISC_PCT, inserted.DISC_PCT)='Y' or
            dbo.fnValuesDiffer(deleted.ECOMM_AFFIL_COD, inserted.ECOMM_AFFIL_COD)='Y' or
            dbo.fnValuesDiffer(deleted.NAM, inserted.NAM)='Y' or
            dbo.fnValuesDiffer(deleted.FST_NAM, inserted.FST_NAM)='Y' or
            dbo.fnValuesDiffer(deleted.LST_NAM, inserted.LST_NAM)='Y' or
            dbo.fnValuesDiffer(deleted.ADRS_1, inserted.ADRS_1)='Y' or
            dbo.fnValuesDiffer(deleted.ADRS_2, inserted.ADRS_2)='Y' or
            dbo.fnValuesDiffer(deleted.CITY, inserted.CITY)='Y' or
            dbo.fnValuesDiffer(deleted.STATE, inserted.STATE)='Y' or
            dbo.fnValuesDiffer(deleted.ZIP_COD, inserted.ZIP_COD)='Y' or
            dbo.fnValuesDiffer(deleted.CNTRY, inserted.CNTRY)='Y' or
            dbo.fnValuesDiffer(deleted.CONTCT_1, inserted.CONTCT_1)='Y' or
            dbo.fnValuesDiffer(deleted.PHONE_1, inserted.PHONE_1)='Y' or
            dbo.fnValuesDiffer(deleted.FAX_1, inserted.FAX_1)='Y' or
            dbo.fnValuesDiffer(deleted.EMAIL_ADRS_1, inserted.EMAIL_ADRS_1)='Y' or
            dbo.fnValuesDiffer(deleted.COMMNT, inserted.COMMNT)='Y' or
            dbo.fnValuesDiffer(deleted.SHIP_VIA_COD, inserted.SHIP_VIA_COD)='Y' or
            dbo.fnValuesDiffer(deleted.CR_CARD_NO_1, inserted.CR_CARD_NO_1)='Y' or
            dbo.fnValuesDiffer(deleted.CR_CARD_NO_1_ENC, inserted.CR_CARD_NO_1_ENC)='Y' or
            dbo.fnValuesDiffer(deleted.CR_CARD_EXP_DAT_1, inserted.CR_CARD_EXP_DAT_1)='Y'
          then 'Y'