2 Replies Latest reply on Aug 23, 2013 7:11 PM by JSieber

    What fields are required to create record for voucher

      I'm using a CI I've created over the VCHR_EXPRESS component. This CI contains all the default properties of the component (for testing). When using the CI (via BizTalk), I can successfully do a GET or FIND. When I create, it looks like I'm able to create just fine but I don't see voucher record being created in PS. The response I get from the creation looks to be "bogus"-- but again no errors. I'm thinking there might something failing during the insert but it is failing silently-- something like fields that I didn't populate or are populated but incorrect. Is there a set of required fields needed to successfully use the CI for a creation? This VCHR_EXPRESS component touches a lot of tables so I'm not sure what is required or not. Also the CI has a lot of "read only" properties. Maybe some of these should be flipped? Any help would be appreciated.
        • 1. Re: What fields are required to create record for voucher
          The VCHR_EXPRESS Component uses 2 global variables when it tries to create a voucher. These are required in order for you to continue. I created 2 methods in an application class to populate those 2 global records.

          /* These are required in order for the voucher component to work correctly */

          method setGlobalRecs
          &AP_VCHOPRDFLT_REC = %this.CreateOprDflt(%operatorid);
          &AP_VCHRADDSRCH_REC = %this.CreateAddRecord(&rec);

          method CreateAddRecord
          /+ &recAPV as Record +/
          /+ Returns Record +/
          Local Record &Rec = CreateRecord(Record.VCHR_ADDSRCH_VW);

          &Rec.BUSINESS_UNIT.Value = &recAPV.BUSINESS_UNIT.Value;
          &Rec.VOUCHER_ID.Value = "NEXT";
          &Rec.VOUCHER_STYLE.Value = "REG";
          &Rec.GRP_AP_ID.Value = %This.GROUP_ID;
          &Rec.VENDOR_NAME_SHORT.Value = "";
          /*&Rec.VENDOR_SETID.Value = &recAPV.VENDOR_SETID.Value;*/
          &Rec.VENDOR_ID.Value = &recAPV.VENDOR_ID.Value;
          /*&Rec.VNDR_LOC.Value = &recAPV.VNDR_LOC.Value;*/
          &Rec.ADDRESS_SEQ_NUM.Value = &recAPV.ADDRESS_SEQ_NUM.Value;
          &Rec.INVOICE_ID.Value = &recAPV.INVOICE_ID.Value;
          &Rec.INVOICE_DT.Value = %Date;
          &Rec.GROSS_AMT.Value = &recAPV.GROSS_AMT.Value;
          &Rec.ORIGIN.Value = "APV";

          Return &Rec;

          method CreateOprDflt
          /+ &sOprid as String +/
          /+ Returns Record +/
          Local Record &Rec;
          &Rec = CreateRecord(Record.OPR_DEF_TBL_AP);
          &Rec.OPRID.Value = &sOprid;
          Return &Rec;

          Hope that helps.
          • 2. Re: What fields are required to create record for voucher

            I am trying an Excel to CI using the VCHR_EXPRESS component for use with Single Payment Voucher (voucher style SGLP).  Do you have to do this same  creation of the methods in an Application Class to populate the global variables?  If so where did you put these methods in the Component PeopleCode do they get executed?  THANKS!  Jennifer