CA Service Management

Expand all | Collapse all

Error in PDM_LIST

Jump to Best Answer
  • 1.  Error in PDM_LIST

    Posted 09-25-2018 10:16 AM

    Hi,

    I need your help. I use PDM_LIST to determine the number of records in a table (z_prop_log) and get no results, but an error message in the log. (SDM 14.1)

    I use this code in detail_in.htmpl (the line 1350 is the bold pdm_list statement):

    var count_log_recs;
    var count_cr_recs;
    count_log_recs=0;
    count_cr_recs=0;

    <PDM_SET args.count=12>
    count_log_recs=0;
    <PDM_LIST PREFIX="list" FACTORY=z_prop_log WHERE="cr_persid='$args.persistent_id'">   
        count_log_recs=count_log_recs+1;
    </PDM_LIST>
    <PDM_SET args.count = count_log_recs>
    alert("2 tst:log_recs:" + $args.count);

    --------------------------- the result is 0 !---

    in LOG:

    bpvirtdb_srvr   9716 ERROR        vdbsql.c    4597 SQL parse error: syntax error, unexpected FROM at FROM
    bpvirtdb_srvr   9716 SIGNIFICANT  vdbsql.c  4598 SELECT FROM z_prop_log WHERE z_prop_log.cr_persid = 'cr:7505695'
    web:local    4000 ERROR    parse.c  8055 Unable to receive record for PDM_LIST at detail_in.htmpl[1350]: syntax error, unexpected FROM at FROM

    ------------------------- the output from bop_sinfo:---

    D:\temp>bop_sinfo -dqf z_prop_log

    Factory z_prop_log < z_prop_log >
       Rel Attr        = id
       Common Name     = cr_persid
       Func Group      =
       Display Name    = z_prop_log
       Display Group   =
       REST Operations = CREATE READ UPDATE
       Schema Name     = z_prop_log
       Producers       = z_prop_log

     Attributes:
       id                   INTEGER UNIQUE
       producer_id          LOCAL STRING(20)
       persistent_id        LOCAL STRING(60)
       anz_strings          INTEGER
       anz_zeilen           INTEGER
       cr_persid            STRING(30)
       desc_01              STRING(240)
       desc_02              STRING(240)
       last_mod_dt          DATE
       last_mod_by          SREL -> cnt.id

     

    Has anyone had this error? Does anyone have an idea?

    Regards



  • 2.  Re: Error in PDM_LIST
    Best Answer

    Posted 09-25-2018 10:32 AM

    Hi,

    to avoid this error you need to perform any PDM code call within PDM_LIST tags, this one should work:

    <PDM_LIST PREFIX="list" FACTORY=z_prop_log WHERE="cr_persid='$args.persistent_id'">    
        <PDM_IF "$list.id" != "0"> // always true
            count_log_recs=count_log_recs+1;
        </PDM_IF>
    </PDM_LIST>

    Regards,

    Timur



  • 3.  Re: Error in PDM_LIST

    Posted 09-25-2018 10:57 AM

    Thank you. It works!!  ( I tested also <pdm_if 1>   and this  doesnt work !!)



  • 4.  Re: Error in PDM_LIST

    Posted 09-25-2018 11:11 AM

    yeah, i thought about PDM_IF 1 after I said "any PDM code call" which i havent tried before.

    but now we know that we should call some list attribute.



  • 5.  Re: Error in PDM_LIST

    Posted 09-27-2018 06:30 AM

    Hi Timur,

    a little question:

    do you have an example of how you can show the count in a notebook tab title? '

     

    <PDM_SET args.count_cr="count_cr_recs">    <-- the count

     

    <PDM_MACRO name="startTabGroup" title="ExtraInfo">
    <PDM_MACRO name="tab" title="ExtraInfo_log  (args.count_cr)" height="300" id="cr_prop1" src="OP=SEARCH+FACTORY=z_prop_cr+QBE.EQ.cr_persid=$args.persistent_id+QBE.EQ.edit_flag=0" tooltip="LOGs properties">
    I  tested also with $args.count_cr, but lso wrong.

    Thanks Horst



  • 6.  Re: Error in PDM_LIST

    Posted 09-27-2018 09:20 AM

    Hi,

    simply use javascript function:

    start_pdm_tab("ExtraInfo_log " + count_cr_recs, "", "cr_prop1", 
    "OP=SEARCH+FACTORY=z_prop_cr+QBE.EQ.cr_persid=$args.persistent_id+QBE.EQ.edit_flag=0",
    "300", "", "", "true");

    Regards.