New table/column in publication breaks replication

Hi, 
SQL 2008R2 
I added a control table to a database that is being replicated to a different server.  The tabled called [__Updated] has one column called [DateUpdated] of type datetime2.  I manually created the table in the subscriber, added the new table/column
to the list of articles and ran the replication. 
It falls over with the error shown below, any ideas? 
2015-02-24 16:23:34.32 [95%] Generating schema scripts for article 'AAA'
2015-02-24 16:23:34.32 [95%] Generating schema scripts for article '__Updated'
2015-02-24 16:23:34.33 [95%] The replication agent had encountered an exception.
2015-02-24 16:23:34.33 Source: Unknown
2015-02-24 16:23:34.33 Exception Type: Microsoft.SqlServer.Management.Smo.FailedOperationException
2015-02-24 16:23:34.33 Exception Message: Script failed for Table 'dbo.__Updated'.
2015-02-24 16:23:34.33 Message Code: Not Applicable
2015-02-24 16:23:34.33
Exact version is: 
SELECT @@VERSION
Microsoft SQL Server 2008 R2 (SP2) - 10.50.4000.0 (X64)
Jun 28 2012 08:36:30
Copyright (c) Microsoft Corporation
Standard Edition (64-bit) on Windows NT 6.2 <X64> (Build 9200: ) (Hypervisor)

Replication is considered to be a mature technology which means there are little changes. Oracle publishing is gone and updateable subcriptions are gone. Other than that it is the same.
looking for a book on SQL Server 2008 Administration?
http://www.amazon.com/Microsoft-Server-2008-Management-Administration/dp/067233044X looking for a book on SQL Server 2008 Full-Text Search?
http://www.amazon.com/Pro-Full-Text-Search-Server-2008/dp/1430215941

Similar Messages

  • New table in replicated setup

    Hi,
    Im having two datastores A and B. Whole datastore is replicated in two-way replication scheme.
    My question is what are the steps to be taken if Im adding a new table to this setup.
    After adding the new table in both the datastores, replication is not happening for the new table.
    Do I need to do a duplicate operation on one of the card after creating a new table in the other?
    Regards
    Pratheej

    Hi Pratheej,
    Please confirm my understanding that you are using legacy replication (CREATE REPLICATION as opposed to CREATE ACTIVE STANDBY PAIR). For legacy datastore level replication, when you create a new table in a replicated datastroe it is created as 'EXCLUDED" (i.e. as if it had existed at the time you created the replication scheme but you had explicitly EXCLUDED it. Hence to get that table into replication you need to 'ALTER TREPLICATION ... INCLUDE ...'.
    If you are adding multiple tables you can do them all in one 'hit' so in steps 5 and 7 you would do all the tables at the same time hence only one duplicate is needed regardless of the number of tables being added.
    If you were to use ACTIVE STANDBY PAIR replication then you could do this much more easily using DDL Replication.
    Chris

  • Best approach to publish new table or new column on existing table on MDW?

    Hi,
    I'm refering to Olite R3 without any patches. I don't use Java API, I use MDW.
    if I have a new table or a new column on a existing table, what's the best approach to publish it?
    I'm asking this because I've trying lots of approaches and the only solution was, step-by-step:
    1) On MDW, drop the publication item
    2) Add again the publication item
    3) Associate the publication item to the publication
    4) Save everything
    5) File / Deploy (if I don't do it, it does not work)
    6) Tools/Package... (that's where it's a problem: if I don't remove the app and create it again it does not work!)
    7) on the client side, I perform a msync with "force refresh"
    That's the only way I found to publish new items for sure. Any other action does not push the new table or new column to the client's embbeded DB.
    Any comments?
    Regards,
    Maurício Américo Vernaschi.

    I do not use MDW, rather a mix of java and the final publish step you use, but
    Adding new PIs should be easy, just add them and re-publish (no need to drop anything)
    for changes, if you just have new columns and the sql statement is 'select * from' then you should just need to make the changes in the base schema objects, and run the publish with no changes and the updates should be picked up. If selecting specific columns, then update and re-publish.
    When using MDW at the end you can save the application as a jar file, and then use this jar file to publish in the mobile manager - this is the best wayto publish.
    Have a look at this jar file in winzip, and you will find it contains a web.xml file. This is the xml definition of the publication items, and for simple changes it is possible to just edit this file and republish via the mobile manager

  • Reinitializing only new tables in transactional replication

    Hi,
    I have to add  one new table to an  existing replication. I created  table and added that table to the replication as well.Now I want to reinitialize only the new table rather than all the tables. Please anybody help

    Publication properties immediate_sync and allow_anonymous need to be set to
    false in order to only generate a snapshot for the newly added article(s).
    I can add a new article and generate a snapshot for only the newly added article by executing the following:
    USE TestDB1
    GO
    --Set allow_anonymous to false
    EXEC sp_changepublication
    @publication = 'TestTranPub1',
    @property = N'allow_anonymous',
    @value = 'false';
    GO
    --Set immediate_sync to false
    EXEC sp_changepublication
    @publication = 'TestTranPub1',
    @property = N'immediate_sync',
    @value = 'false';
    GO
    --Add new article
    EXEC sp_addarticle
    @publication = 'TestTranPub1',
    @article = 'TestTable',
    @source_object = 'TestTable',
    @force_invalidate_snapshot = 1;
    GO
    --Add subscription to newly added article
    EXEC sp_addsubscription
    @publication = 'TestTranPub1',
    @article = 'TestTable',
    @subscriber = 'PACIFIC\SQL2012',
    @destination_db = 'TestDB2',
    @reserved = 'Internal';
    GO
    --Generate a new snapshot for only the newly added article
    EXEC sp_startpublication_snapshot
    @publication = 'TestTranPub1';
    GO
    Brandon Williams (blog |
    linkedin)

  • Trigger how to get new and old value for nested table column?

    Hi,
    I have created a nested table based on the following details:
    CREATE TYPE typ_item AS OBJECT --create object
    (prodid NUMBER(5),
    price NUMBER(7,2) )
    CREATE TYPE typ_item_nst -- define nested table type
    AS TABLE OF typ_item
    CREATE TABLE pOrder ( -- create database table
    ordid NUMBER(5),
    supplier NUMBER(5),
    requester NUMBER(4),
    ordered DATE,
    items typ_item_nst)
    NESTED TABLE items STORE AS item_stor_tab
    INSERT INTO pOrder
    VALUES (800, 80, 8000, sysdate,
    typ_item_nst (typ_item (88, 888)));
    Now I would like to create a trigger on table pOrder for after insert or update or delete
    and I would like to track the new and old value for the columns inside nested table.
    Can anybody direct me how to do it?
    I would like to know the sytax for it like:
    declare
    x number;
    begin
    x := :new.nestedtablecolumn;--how to get the new and old value from nested table columns
    end;
    Hope my question is clear.
    Thanks,
    Lavan

    Hi,
    Try like this:
    CREATE OR REPLACE TRIGGER PORDER_I
    BEFORE INSERT
    ON PORDER
    REFERENCING OLD AS old NEW AS new
    FOR EACH ROW
    DECLARE
      items_new typ_item_nst;
      ordid_NEW NUMBER;
    BEGIN
    FOR i IN :new.items.FIRST .. :new.items.LAST LOOP -- For first to last element
      DBMS_OUTPUT.PUT_LINE(':new.items(' || I || ').prodid: ' || :new.items(I).prodid );
      DBMS_OUTPUT.PUT_LINE(':new.items(' || I || ').price:  ' || :new.items(I).price );
    END LOOP;
    END;Regards,
    Peter

  • How to retrive new logical column based on flag values in table.

    Hi,
    i have two tables in rpd
    1.file table contains the coulmns------->date,file_count,record_count,cldm_stg,cmsa_stg,archive_stg
    2.rejection table columns---------> are same as above
    both have same common columns.my requirement is publish a dashboard like:
    date | land_files count |alnd_recordscount| target_files count|target_records count|Rejection filecount|rejection record count
    These report ineed retrive from those two tables.based on flag values.taget countcomes when all stg values set to ='y'
    i.e(cldm_stg='y' and cmsa_stg='y'and archive_stg='y') if not then it will be in rejection file.
    Please give solution how to achive my output.
    nQSError: 14026] Unable to navigate requested expression: Target_record:[DAggr(FILE_CONTROL.Target_record by [ FILE_CONTROL.FILE_NAME, REJECTED_FILES.FILE_NAME, REJECTED_FILES.NO_OF_ROWS, File_landing.NO_OF_ROWS, File_landing.FILE_LOAD_DATE] SB FILE_CONTROL)]. Please fix the metadata consistency warnings. (HY000)
    Edited by: user8767586 on Jan 12, 2010 4:29 AM

    Tanks for ypur reply .only two tables are there named as above.i taken file_control as a fact table.
    and i create one new tablecalled target in bmm layer taking logical source as file_control(fact table). and iset the where clause for the new table.and i create a new measure called target_file and target_records.in where clause my query is like
    dwbidb."".AUDIT_PROD.FILE_CONTROL.ARCHIVE_STATUS = 'Y' AND dwbidb."".AUDIT_PROD.FILE_CONTROL.CMSA_STATUS = 'Y' AND dwbidb."".AUDIT_PROD.FILE_CONTROL.LND_STATUS = 'Y' AND dwbidb."".AUDIT_PROD.FILE_CONTROL.SCRIPT_STATUS = 'Y' AND dwbidb."".AUDIT_PROD.FILE_CONTROL.STG_STATUS = 'Y'
    please tell me if this is right way to achive mt report. and tell me difference between fragmentation and whereclause.for my requrement i ahve to follow which method either fragmentation or whereclause.and in rpd there are no errors and warnings.but in answers i get a follwing error
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 14026] Unable to navigate requested expression: TARGET_FILECOUNT:[DAggr(TARGET.TARGET_FILECOUNT by [ TARGET.FILE_NAME] SB TARGET)]. Please fix the metadata consistency warnings. (HY000)
    SQL Issued: SELECT TARGET.FILE_LOAD_DATE saw_0, TARGET.TARGET_FILECOUNT saw_1, TARGET.TARGET_FILECOUNT saw_2 FROM AUDIT_PROD ORDER BY saw_0.
    Please tell me to achive my report.
    Regards
    Edited by: user8767586 on Jan 12, 2010 5:21 AM
    Edited by: user8767586 on Jan 12, 2010 5:21 AM
    Edited by: user8767586 on Jan 12, 2010 5:24 AM

  • My request shows a diff Fact table when new Dim columns added to OOB report

    Hi,
    I am facing this strange problem with the out-of-box BMM metadata mapping and report:
    The "Dim_W_GL_ACCOUNT_D" is joined to "Fact_W_GL_OTHER_F" and "Fact_W_GL_BALANCE_F" facts. Both these fact tables have a inner join to "Dim_W_GL_ACCOUNT_D". The change I have made in th BMM is - I added 2 new logical dimensions DimA and DimB and joined these to the above 2 fact tables.
    The O-O-Box "GL Account Balance" Report works fine which has 3 logical columns (GL Account Number, Financial Statement Item, GL Account Category) from the "Dim_W_GL_ACCOUNT_D" and 1 Fact column "Closing Amount" which points to the "Fact_W_GL_BALANCE_F"."BALANCE_GLOBAL1_AMT" fact.
    When I add 1 logical column each from my 2 new Dims I created, the report output shows the Fact column "Closing Amount" as $0.0. Upon investigating the log, the query shows it is using the "Fact_W_GL_OTHER_F" instead of "Fact_W_GL_BALANCE_F" fact which has the "Closing Amount" column. I am not sure how. When I drop the logical column "GL Account Number" and keep my 2 new logical columns in the request, the "Closing Amount" is shown correctly. I also saw there is a Dim Hierarchy for "GL Accounts" --- the "GL Account Number" is on a lower level than the "Financial Statement Item" and "GL Account Category" columns from the same logical dimension table which are 1 level higher.
    How do I make the request pull data at the "GL Account Number" level and still have the query fetch data from "Fact_W_GL_BALANCE_F"."BALANCE_GLOBAL1_AMT" (Closing Amount) with my 2 new logical columns included?
    Any help is appreciated. Thanks a bunch.

    I was able to fix the problem.

  • How to add new tables in Streams for Schema level replication ( 10.2.0.3 )

    Hi,
    I am in process of setting up Oracle Streams schema level replication on version 10.2.0.3. I am able to setup replication for one table properly. Now I want to add 10 more new tables for schema level replication. Few questions regarding this
    1. If I create new tables in source, shall I have to create tables in target database manually or I have to do export STREAMS_INSTANTIATION=Y
    2. Can you tell me metalink note id to read more on this topic ?
    thanks & regards
    parag

    The same capture and apply process can be used to replicate other tables. Following steps should suffice your need:
    Say table NEW is the new table to be added with owner SANTU
    downstr_cap is the capture process which is already running
    downstr_apply is the apply process which is already there
    1. Now stop the apply process
    2. Stop the capture process
    3. Add the new table in the capture process using +ve rule
    BEGIN
    DBMS_STREAMS_ADM.ADD_TABLE_RULES
    table_name      => 'SANTU.NEW',
    streams_type    => 'capture',
    streams_name    => 'downstr_cap',
    queue_name      => 'strmadmin.DOWNSTREAM_Q',
    include_dml     => true,
    include_ddl     => true,
    source_database =>  ' Name of the source database ',
    inclusion_rule  => true
    END;
    4. Take export of the new table with "OBJECT_CONSISTENT=Y" option
    5. Import the table at destination with "STREAMS_INSTANTIATION=Y' option
    6. Start the apply process
    7. Start the capture process

  • How to find the new tables and columns in a schema

    hi..good morning to all...
    I have a schema ABC which owns some objects.
    Now some days before I have made another schema XYZ which was a replica of ABC schema.
    between these days some new tables, new columns in the existing tables(with or without default value), comments on the columns are being added in the new schema i.e XYZ schema.
    Now I have to find the extra things which are present in the new schema. I need to find the new tables, new columns in hte existing tables, their default values and descriptions of those.
    Can u plss help me how can I find it?
    I am guessing that I have to write a SQL query with a minus clause but I am not able to write it and also dont know where should I execute it.
    plss help. thanks in advance.

    And moreover, when I am executing the query to get the desired result, then it is throwing "illegal use of long datatype" error and pointing to the b.data_default area of my query..
    select a.table_name, a.column_name, b.data_default, a.comments from all_col_comments a, dba_tab_columns b
    where a.TABLE_NAME=b.TABLE_NAME
    and a.OWNER=b.OWNER
    and a.OWNER=XYZ
    minus
    select c.table_name, c.column_name, d.data_default, c.comments from all_col_comments c, dba_tab_columns d
    where c.TABLE_NAME=d.TABLE_NAME
    and c.OWNER=d.OWNER
    and c.OWNER='ABC'
    order by 1, 2;
    plss help...

  • Store BP and Item properties in Rows of new table in parallel to columns

    Hi Product Development Team,
    At present SAP B1 stores BP and Item properties as 64 columns in respective master table.
    As the main purpose of property feature is for Reporting and Analysis, Analysis Report developers faces difficulties in preparing analysis report based on properties in the present structure of prperties in column.
    I suggest to introduce additional new table (each for Business Partners and Items properties) which contain rows for selected BPs/item's selected properties.
    In order to retain present functionality the existing column can remain as it is and also continue to updated as it is.Only additional new table will also get updated and new analysis reports can be build using these newly suggested tables.
    Best Regards,
    Samir Gandhi

    No Body responded very strange !!!!!

  • Setting new cell variant for an alv table column

    Hi,
    I want to set a new cell variant for a column. Therefore I did the following steps:
    1. Create an object of CL_SALV_WD_CV_STANDARD
    2. SET_KEY( 'CELLVAR1 )
    3. set_cell_design([..]-goodvalue_medium )
    4. SET_EDITOR( lr_alv_input_field )
    After that I added the cell variant to the column by using the method "add_cell_variant".
    The last step is to call method SET_SELECTED_CELL_VARIANT.
    I checked my program by using get_selected_cell_variant( ) and the return string was okay.
    But when the table is displayed, the new cell variant isn't working. I defined an input field as the cell editor for my new cell variant but when the table is shown, it is just text - no input possible. In addition to that the selected cell design (goodvalue_medium , step 3) isn't working. So I think the cell variant is not used.
    Can you help me?
    Thanks & Regards,
    Hendrik

    Hi
    I wonder if you can help me please, I too am having issues implementing ALV cell changes in WDA?
    I am basically trying to dynamically change the individual color of a cell (not the entire column or row) dependant on certain criteria. I apologies but find that you are the closest resource for any potential information. Please see screen shot below.
    Currently my code is as follows:
    see: www.picasaweb.google.co.uk/dave.alexander69/Pictures#5244416971466907938
    data: lr_cv TYPE REF TO cl_salv_wd_cv_standard.
    loop at table 1 row data
            loop at table columns
              for the date columns only...
              IF <fs_column>-id(4) = 'CELL'.
               get and set column header dates from select option user input - done
                loop at table 2 row data (table 2 contains date ranges for row concerned)
                  MOVE: ls_zdata-variance TO lv_variance.
                  method 1 - as in sap press WD4A -:
                  lr_cv = cl_wd_table_standard_cell=>new_table_standard_cell(
                                                     view        = view
                                                    variant_key = lv_variance ).
                 as mentioned...
                  CREATE OBJECT lr_cv.
                  lr_cv->set_key( 'VARIANCE' ).
                  lr_cv->set_cell_design( '09' ).
                  lr_cv->set_editor( lr_input_field ).
                  lr_column->add_cell_variant( lr_cv ).
                  lr_column->set_cell_editor( lr_input_field ).
                  lr_column->set_sel_cell_variant_fieldname( 'VARIANCE' ).
                  lr_column->set_cell_design_fieldname( value = 'COLOR_CELL' ).
                  lr_field = lr_table->if_salv_wd_field_settings~get_field( <fs_column>-id ).
                  lr_field->if_salv_wd_sort~set_sort_allowed( abap_false ).
                  the only way I get cell coloring to work - but this is for entire column?
                  ls_zdata-color_cell = cl_wd_table_standard_cell=>e_cell_design-one.
                  MODIFY lt_zdata FROM ls_zdata..
                ENDLOOP.
              ENDIF.
              IF <fs_column>-id = 'COLOR_CELL'.
                CALL METHOD lr_column->set_visible( EXPORTING value = '00' ).
              ENDIF.
            ENDLOOP
          ENDLOOP.
    As you see I am in the dark a bit regarding cell variants and wonder if you can point me in a better direction.
    Many thanks for any help,
    Dave Alexander

  • The new table and Columns to look for in picking headers, etc

    Hi,
    What are the new tables and columns to look for mapping the following old ones:
    1) Pick_Slip_Number from So_Picking_Headers,
    2) Sequence_Number from SO_Picking_lines
    3) Line_ID from So_Note_References
    Thanks and Regards,
    Praveen

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by ravi alladi ([email protected]):
    Actually would it be possible to get a list of all changes in Order Management between 11 and 11i? ie what tables added, what have been modified and which ones are obsolete<HR></BLOCKQUOTE>
    Ravi
    Actually, we are working on that same analysis. If you receive any responses, please forward to myself as well.
    Thank you
    Sha Green

  • Can I replicate new tables using the ACTIVE STANDBY PAIR replication scheme

    Hi,
    I have created myself a simple setup using an active/standby pair with a single subscriber like so:
    CREATE ACTIVE STANDBY PAIR cie ON "tt-test1", cie ON "tt-test2" RETURN RECEIPT SUBSCRIBER cie on "tt-test3";
    I have then added some tables on the master, they did not replicate automatically. I find this:
    Command> repschemes;
    Replication Scheme Active Standby:
    Master Store: CIE on TT-TEST1
    Master Store: CIE on TT-TEST2
    Master Return Service: Return Receipt
    Subscriber Store: CIE on TT-TEST3
    Excluded Tables:
    ROOT.EXTRACTOR_
    ROOT.PROMPT_
    ROOT.PREFERABLE_
    Included Tables:
    List too long (59 items), use verbosity 4 to display
    <snip>
    My question is ... how do I include these tables in replication?
    Do I need to trash and clone the secondary master store and the subscriber again? Even doing that won't add the tables to the replication scheme so I don't think that is a solution.
    I couldn't find much documentation on the ALTER REPLICATION statement but from what I could find it requires me to know the 'name' of the replication scheme and the examples in the documentation didn't work when I used 'Active Standby' as the scheme name in the statement.
    Am I being retarded here? Is this a limitation of using the ACTIVE STANDBY PAIR replication model?
    Thanks in advance.
    Huw

    When you setup and rollout the ACTIVE/STANDBY pair (or indeed legacy replication) it only includes tables that already exist. The normal deployment process is:
    1. Create the first datastore (the one which will initially be the 'active').
    2. Create (and populate) all necessary tables.
    3. Create the active/standby pair replication scheme.
    4. Start the repagent
    5. Make the datastore active by calling ttRepStateSet('ACTIVE')
    6. Use ttRepAdmin -duplicate to create the standby store from the active
    7. Start repagent at standby
    8. Use ttRepAdmin -duplicate to create the subscriber store from the standby
    7. Start repagent at subscriber
    If you need to add/remove tables later you must do the following:
    At active node:
    1. Create any new tables (and populate them) as needed
    2. Stop repagent
    3. Execute ALTER ACTIVE STANDBY PAIR with INCLUDE and/or EXCLUDE clauses as required
    4. Start repagent
    Then you need to redeploy the other stores:
    At standby:
    5. Stop repagent
    6. Drop datastore (ttDestroy)
    7. Re-create datastore from active using ttRepAdmin -duplicate
    8. Start repagent
    At subscriber:
    9. Stop repagent
    10. Drop datastore (ttDestroy)
    11. Re-create datastore from standby using ttRepAdmin -duplicate
    12. Start repagent
    This is documented in the TimesTen Replication Guide in the section on administering an active/standby pair.
    Chris

  • How to add a new Article to a publication and reinitialize subscription only for the new article

    Hi Freinds,
    SQL2008
    I have a publication and subscription in place and want to add a new article into it. the problem is when I fo it, I need to reinitialize the entire subscription to see the effect.
    is there any way to reinitialize the subscription and publication for only the new article added ?
    Thanks in advance,
    -P
    Patrick Alexander

    For transactional replication all you do is this:
    sp_addarticle
    @publication='PublicationName', @article='ArticleName', @source_object='TableName'
    GO
    sp_refreshsubscriptions 'PublicationName'
    GO
    exec sp_startpublication_snapshot @publication = 'publicationName'
    looking for a book on SQL Server 2008 Administration?
    http://www.amazon.com/Microsoft-Server-2008-Management-Administration/dp/067233044X looking for a book on SQL Server 2008 Full-Text Search?
    http://www.amazon.com/Pro-Full-Text-Search-Server-2008/dp/1430215941
    Figured I'd add to this very old post as opposed to starting a new one. I've followed the steps outlined by Hillary, and the new table simply never shows up at the Subscriber.
    I've also attempted everything through the GUI, but get the message "[0%] A snapshot was not generated because no subscriptions needed initialization." when trying to launch the Snapshot Agent.
    Note this is on 2012, and the initialization was done via backup/ restore (not snapshot).
    Any ideas? Thanks!
    TIA, ChrisRDBA

  • Controlling table column alignment using variable

    Hi I'm new to Javascript, having only used Applescript before.
    I'm using Indesign 5.5 on Mac and I'm learning Javascript by adapting old Applescripts that I have been using for years.
    So, with an existing table, one of the things I want to do is to set the alignments in the columns using a varible. Here's what I've tried so far:
    function setColumnWidthsAndAlignments()
        var myWidths=[29, 23, 13, 13, 13, 13];
        var myAlignments=["leftAlign","leftAlign","centerAlign","centerAlign","rightAlign","rightAlign"];
        var numberOfColumns=myTable.columns.count();
        for (c=0;c<numberOfColumns;c++)
            myTable.columns[c].width=myWidths[c];
            myTable.columns[c].cells.everyItem().texts.everyItem().justification=Justification.myAlignments[c];
    but I get an error
    -- Object does not support the property or method 'myAlignments' --
    If I discard the variable myAlignments and just put leftAlign for example, it works, so maybe I'm not declaring the variable properly?
    I know I could add a few extra paragraph styles and cell styles and style the table that way, but I though this would be a good learning exercise (besides which I want to limit the number of paragraph styles in the document - there are enough already!)
    If anybody is really interested, I'd like to place the whole script here and would really welcome any feedback on how the structure could be improved or optimised or just tell me if I'm heading in the right direction.
    Thanks and regards,
    Malcolm
    //Simple table script 1
    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll; //make sure that user interactivity is switched on ????  why????
    if(checkForOpenDocs()) //checks to see if there are any open Indesign documents
            if(targetMyTable()) //checks to see if the selection is inside a table - if not, gives an error dialog - if it is, returns variable myTable which can be used to target different parts of the table
                   // selectLastRow();
                    //resetTable();
                    //applyTableTextParaStyle();
                    //removeRules();
                    //applyAlternatingFills();
                    setColumnWidthsAndAlignments();
                    //setRowHeightsAndInsets();
    function checkForOpenDocs()
        if (app.documents.length!=0)   //there is at least one document open
            myDocument = app.documents.item(0);    //get the id of the frontmost document - might be useful?
            return true;
        else
            alert("There are no documents open");
            return false;
    function targetMyTable() //no matter what is selected in the table, change selection to be whole table
        if(app.selection[0]==null) //if there is nothing selected
            alert("There is nothing selected.");
            return false
        var mySelection = app.selection[0];
        switch(mySelection.constructor.name)
                                            //When a row, a column, or a range of cells is
                                            //selected, the type returned is always "Cell"
            case "Cell":
            myTable=mySelection.parent;
            return true
            break;
            case "Table":
            myTable=mySelection;
            return true
            break;
            case "InsertionPoint":
            case "Character":
            case "Word":
            case "TextStyleRange":
            case "Line":
            case "Paragraph":
            case "TextColumn":
            case "Text":
            if(app.selection[0].parent.constructor.name == "Cell")
                myTable=mySelection.parent.parent;
                return true
            else
                alert("The selection is not inside a table.");
                return false
            break;
            case "Rectangle":
            case "Oval":
            case "Polygon":
            case "GraphicLine":
            case "TextFrame":
            if(app.selection[0].parent.parent.constructor.name == "Cell")
                myTable=mySelection.parent.parent.parent;
                return true
            else
                alert("The selection is not inside a table.");
                return false
            break;
            case "Image":
            case "PDF":
            case "EPS":
            if(app.selection[0].parent.parent.parent.constructor.name == "Cell")
                myTable=mySelection.parent.parent.parent.parent;
                return true
            else
                alert("The selection is not inside a table.");
                return false
            break;
            default:
            break;
    function resetTable()
        myTable.cells.everyItem().clearCellStyleOverrides (true);  
    function selectLastRow()
        //myTable.cells.itemByRange(0,-1).select();
        myTable.rows.itemByRange(-1,-1).select();
    function applyTableTextParaStyle()
        myParagraphStyle=myDocument.paragraphStyles.item("•table text");
        myTable.cells.everyItem().texts.everyItem().appliedParagraphStyle = myParagraphStyle;
    function removeRules()
        myTable.cells.everyItem().topEdgeStrokeWeight=0;
        myTable.cells.everyItem().bottomEdgeStrokeWeight=0;
        myTable.cells.everyItem().leftEdgeStrokeWeight=0;
        myTable.cells.everyItem().rightEdgeStrokeWeight=0;
    function applyAlternatingFills()
        myColor=myDocument.swatches.item("Black");
        myTable.alternatingFills=AlternatingFillsTypes.alternatingRows;
        myTable.startRowFillColor=myColor;
        myTable.startRowFillTint=20;
        myTable.endRowFillColor=myColor;
        myTable.endRowFillTint = 0;
    function setColumnWidthsAndAlignments()
        var myWidths=[29, 23, 13, 13, 13, 13];
        var myAlignments=["leftAlign","leftAlign","centerAlign","centerAlign","rightAlign","rightAlign"];
        var numberOfColumns=myTable.columns.count();
        for (c=0;c<numberOfColumns;c++)
            myTable.columns[c].width=myWidths[c];
            myTable.columns[c].cells.everyItem().texts.everyItem().justification=Justification.myAlignments[c];
    function setRowHeightsAndInsets()
        myTable.rows.everyItem().minimumHeight=1.058;
        myInset=0.5;
        myTable.rows.everyItem().topInset=myInset;
        myTable.rows.everyItem().bottomInset=myInset;

    You'd probably have more luck trying something like:
    var myAlignments = [Justification.LEFT_ALIGN, Justification.LEFT_ALIGN,
    Justification.CENTER_ALIGN etc.]
    and then in the other line: ...texts.everyItem().justification =
    myAlignments[c];
    Alternatively, you could try keeping it as you have it, but perhaps
    changing it to this:
    texts.everyItem().justification = eval("Justification."+myAlignments[c]);...
    which just creates a string and then runs it with eval.
    At any rate, the problem as I see it with what you have is that you
    myAlignments is an array of strings, and you cannot access a property of
    an object (in this case Justification) with a dot+string. When you put
    "Justification.leftAlign" and it works, I think that's because leftAlign
    isn't acting as a string -- it's simply a property of the Justification
    object.
    Ariel

Maybe you are looking for

  • Text Input/Output

    I have downloaded the text input/output widget found here: http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&loc=en_us&extid=1253 021 I inserted the input animation on one slide and the output animation on another. When I preview,

  • Problem with prod. ver. explosion to production order

    Hi I have problem with production versions. I have FERT with 3 production versions. Additionaly we have Z-program (on Z-table) which control parameter sold to party (from sale order) with production version. So after MRP I see in planned order right

  • How to use bapi /external service directly in application service

    Hi I have to use BAPI_ALM--RDER_MAINTAIN in my caf application i have imported it as external service.As there are problems mapping its input fields to entity service , it has to be consumed directly vai application service. But i ahve never done so

  • How to connect Oracle database in VC++.06

    How to connect Oracle database in VC++.06 please give me details

  • Xsl transformation of xml with wrong namespace

    I have xml with wrong namespace: <PAMStartedNotification xmlns="some site"> <tUser>PLVUSER</tUser> </PAMStartedNotification>I need to leave this namespace and transform it. As a result of transformation now I get <tUser></tUser> ...I.e. XPath is not