Skip to content

Instantly share code, notes, and snippets.

View weiserman's full-sized avatar

Warren weiserman

  • Agile Business Technology
  • Cape Town
View GitHub Profile
@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 March 20, 2023 19:24
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
Working as the CTO of Neptune Software for the last three and a half years, I have spent most of my time working with SAP mobility and User Experience, meeting and discussing with customers and helping in mobile SAP implementations all over the world. This post will look at the three major misconceptions I have observed that in my opinion dooms your mobility project.
1 - Responsive Web Design is sufficient for Enterprise Mobility
With the emergence of HTML5 and great frameworks like SAPUI5, it is possible to create responsive web pages enhanced for viewing on mobile devices and even optimized for touch events. It is tempting to view mobile web apps as the most cost efficient and best option to roll out mobility in an organization.
Unfortunately this solution is ill suited for any serious mobility project and more so in an enterprise setting. I see more and more of the SAP community considering mobility as inherent in all other topics, which is good, but I am afraid that projects downplay mobility into
@weiserman
weiserman / SAP UI5
Created October 5, 2014 08:50
Hello World SAP UI5
<!DOCTYPE html>
<html lang="en">
<head>
<title>SAPUI5 Hello World live demo</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<script id="sap-ui-bootstrap"
type="text/javascript"
src="/temp/ui5/resources/sap-ui-core.js"
@weiserman
weiserman / FPM Event Raise
Created March 27, 2014 10:14
ABAP to raise a floorplan event
* Local data
data: lo_fpm type ref to if_fpm,
lo_event type ref to cl_fpm_event.
* Create the object
create object lo_event
exporting
iv_event_id ='DELETE_AIRPORT'.
* Set the parameters
@weiserman
weiserman / Web Dynpro in ABAP
Created March 16, 2014 14:24
Example to call a Web Dynpro from within ABAP passing a paramter. Note this will launch the Web Dynpro application within SAPGUI
DATA: lt_param TYPE tihttpnvp,
ls_param TYPE ihttpnvp,
ls_url TYPE string.
* Set up configuration ID for calling the Web Dynpro
MOVE 'WDCONFIGURATIONID' TO ls_param-name.
MOVE 'ZSD_SD_INV_REQ_CREATE' TO ls_param-value.
APPEND ls_param TO lt_param.
* Set up the parameter that need to be passed into Web Dynpro