Skip to content

Instantly share code, notes, and snippets.

View weiserman's full-sized avatar

Warren Eiserman weiserman

View GitHub Profile
_schema-version: 3.3.0
ID: dbtest
version: 1.0.0
description: "A simple CAP project."
parameters:
enable-parallel-deployments: true
deploy_mode: html5-repo
build-parameters:
before-all:
- builder: custom
@weiserman
weiserman / annotation
Created February 3, 2026 04:48
annotation example
<edmx:Edmx xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx" Version="4.0">
<edmx:Reference Uri="https://sap.github.io/odata-vocabularies/vocabularies/UI.xml">
<edmx:Include Namespace="com.sap.vocabularies.UI.v1" Alias="UI" />
</edmx:Reference>
<edmx:Reference Uri="/sap/opu/odata4/sap/zap_comm_ui_v4/srvd/sap/zap_comm_ui/0001/$metadata">
<edmx:Include Namespace="com.sap.gateway.srvd.zap_comm_ui.v0001" Alias="SAP__self" />
</edmx:Reference>
<edmx:DataServices>
<Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="local">
<Annotations Target="SAP__self.EmailType">
@weiserman
weiserman / zgoog_cl_qs_address_validation
Created January 15, 2026 08:03
Check Address Data - ABAP Cloud with Google SDK
CLASS zgoog_cl_qs_address_validation DEFINITION
PUBLIC FINAL
CREATE PUBLIC.
PUBLIC SECTION.
INTERFACES if_oo_adt_classrun.
ENDCLASS.
CLASS zgoog_cl_qs_address_validation IMPLEMENTATION.
import com.sap.gateway.ip.core.customdev.util.Message;
import javax.crypto.Mac
import javax.crypto.spec.SecretKeySpec
import java.text.SimpleDateFormat
import java.util.TimeZone;
import org.apache.commons.codec.digest.DigestUtils;
import com.sap.it.api.ITApiFactory;
import com.sap.it.api.securestore.SecureStoreService
import groovy.json.JsonBuilder
import groovy.json.JsonSlurper
@weiserman
weiserman / filtering.js
Last active November 27, 2022 12:48
Frappe Client Script
// This script was created so that we can select web users for gym membership
// only allow active plans to be selected
// Once a plan is selected we default the values for price
frappe.ui.form.on('Gym Membership', {
plan: function(frm) {
frm.set_value('length', 99);
frm.set_value('price', 101.11);
frm.set_value('status', "Awaiting Payment");
},
refresh: function(frm) {
@weiserman
weiserman / api.py
Last active October 10, 2022 08:28
Frappe Python API example with SQL
import frappe
// This code is called from a front end script and returns a SQL query with a dictionary list.
@frappe.whitelist()
def get_rental_articles(first_name):
rentals = frappe.db.sql(f""" SELECT * from `tabLibrary Transaction` WHERE library_member = '{first_name}' """, as_dict=True)
return rentals
@weiserman
weiserman / Library_member.js
Created October 10, 2022 08:24
Frappe Client Script
frappe.ui.form.on('Library Member', {
refresh(frm) {
// Get the library memmbers first name from form JavaScript object
let first_name = frm.doc.first_name;
console.log(frm.doc);
// Check we have a name value and call the backend using an AJAX like call
// On completion call an Arrow function with results
// Backend function is written in python in the api.py file
if (first_name){
@weiserman
weiserman / frappe.md
Last active November 21, 2025 08:36
Frappe Bench on Digital Ocean droplet

Guide-to-Install-Frappe-on-Digital-Ocean-Droplet

A guide to Install Frappe Bench v14 on Ubuntu 22.04 LTS and start building the Library Tutorial I hope this makes your Frappe development and exploration more simpler. Frappe Cloud provides great capabilities too. This is for a development server and not for a production build (obviously)

Pre-requisites before your start

  Digital Ocean account and a droplet created
  Ubuntu 22.04 LTS
@weiserman
weiserman / consumer.robot
Created February 2, 2022 18:08
Consumer Robot syntax
*** Settings ***
Library RPA.Robocorp.WorkItems
Library RPA.Tables
Library RPA.JSON
Library Collections
*** Tasks ***
Consume Items
[Documentation] Cycle through the quote items
@weiserman
weiserman / gist:85e67532ded325ba3e08d5813bb67030
Last active February 1, 2022 19:19
Upload file to process in robocorp
*** Settings ***
Documentation This robot will be run in robocloud, ask user for input file and then load work items
Library Collections
Library RPA.Tables
Library RPA.Dialogs
Library RPA.Robocorp.Process
Library RPA.Robocorp.Vault
*** Variables ***
${CSV_FILE} devdata${/}price_increase.csv