Skip to content

Instantly share code, notes, and snippets.

View vinodronold's full-sized avatar

Vinod Ronold vinodronold

  • New Jersey
View GitHub Profile
Local Package:Header &oInvoiceHeader = create Package:Header();
Local number &nCnt;
Local SQL &sqlHeader, &sqlLine;
Local Record &recHeader, &recLine;
Local array of Record &arrHeader, &arrLine;
&recHeader = CreateRecord(Record.Z_HDR_TAO);
&arrHeader = CreateArrayRept(&recHeader, 0);
import PACKAGE:Utils:StringHashtable;
class Header
method Header();
method init();
method insert();
method createFile();
property string fileName get;
property string fullFilePathName get;
@vinodronold
vinodronold / TS_EARNCODE
Last active March 13, 2020 03:59
Computing the total hours worked per earnings code
Local PACKAGE:NumberHashtable &oHrsByErnCd = Create PACKAGE:NumberHashtable();
Local Rowset &rsTSIntfc = CreateRowset(Record.Z_TSINFC_VW);
REM Get all the timesheets for the week
&rsTSIntfc.Fill(" WHERE EARNS_END_DT = %DateIn(:1) AND EMPLID = :2 ", &Timesheet.WeekEndDate, &Timesheet.EmplID);
For &nCnt = 1 To &rsTSIntfc.RowCount
&recTSIntfc = &rsTSIntfc(&nCnt).Z_TSINFC_VW;
REM Add the Hours to the Hashtable with ERNCD as the Key
&oHrsByErnCd.Add(&recTSIntfc.ERNCD.value, &recTSIntfc.TOTAL_HRS.value);
End-For;
@vinodronold
vinodronold / NumberHashtable
Created March 13, 2020 03:40
PeopleCode: his class provides a simple Hashtable implementation for storing and looking up Numbers based on String keys
/*
This class provides a simple Hashtable implementation for storing and looking up Numbers based on String keys
*/
class NumberHashtable
method NumberHashtable();
method Put(&key As string, &value As number);
@vinodronold
vinodronold / StringHashtable
Created March 13, 2020 03:38
PeopleCode: This class provides a simple Hashtable implementation for storing and looking up Strings based on String keys
/*
This class provides a simple Hashtable implementation for storing and looking up Strings based on String keys
*/
class StringHashtable
method StringHashtable();
method Put(&key As string, &value As string);
@vinodronold
vinodronold / InstrumentAssignments.onExecute
Last active November 16, 2021 05:31
Sample REST API Implementation using PeopleCode
import Z_REST_UTIL:Request;
class InstrumentAssignments
method InstrumentAssignments(&nVendorId As number, &nPaymentPartyId As number, &nPaymentInstrumentId As number);
property number VendorId readonly;
property number PaymentPartyId readonly;
property number PaymentInstrumentId readonly;
property string PaymentFlow readonly;
property string PaymentInstrumentType readonly;
property string PrimaryIndicator readonly;
/** APPLICATION_PACKAGE.Z_REST_UTIL.Request.OnExecute **/
import EOEW_ETLAPI:COMMON:HashTable;
class Request
method Request(&sURL As string);
method get() Returns JsonObject;
method post(&jsonRequest As JsonObject) Returns JsonObject;
method generateRequest(&MethodName As string, &Request As string) Returns JsonObject;
method buildGenericMessage(&MethodName As string, &Request As string) Returns Message;
method base64ToString(&sBase64 As string) Returns string;
@vinodronold
vinodronold / youtubePlayer
Created November 12, 2016 00:39 — forked from broekema41/youtubePlayer
Encapsulate the Youtube Iframe API with RequireJS
/**
* This module uses global declared functions to communicate with the youtube api (iframe)
* Communication to parent (implementation) modules is done with jquery trigger.
*
* basic exsample:
* <div class="video-wrapper">
* <div id="unique-id-here"
* </div>
* </div>
*