Skip to content

Instantly share code, notes, and snippets.

View apocsve's full-sized avatar
🍉
Restart

Rafael Sanchez apocsve

🍉
Restart
View GitHub Profile
@apocsve
apocsve / r-debug.php
Created November 13, 2019 07:24 — forked from Rarst/r-debug.php
R Debug (set of dump helpers for debug)
<?php
/*
Plugin Name: R Debug
Description: Set of dump helpers for debug.
Author: Andrey "Rarst" Savchenko
Author URI: https://www.rarst.net/
License: MIT
*/
global with sharing class InvoiceUtilities {
// class method to renumber Line Items for a given Invoice number
// returns a string that indicates success or failure
webservice static String renumberLineItems(String invoiceName) {
// create a copy of the target Invoice object and it's Line Items
Invoice__c invoice = [Select i.Name, (Select Name From Line_Items__r ORDER BY Name)
From Invoice__c i
Where i.Name = :invoiceName LIMIT 1];