Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Collections.Generic;
using System.Text;
using Sage.Platform.Application;
using Sage.Platform.Application.UI;
using Sage.Platform.Security;
using Sage.SalesLogix.Web;
using Sage.SalesLogix.Security;
using System.Reflection;
using Sage.Entity.Interfaces;
@isTest
private class SSSCsvReaderTest {
static testmethod void testSplitCsvSimple(){
String line = 'abc,efg';
String[] splitted = new SSSCsvReader(line).readLine();
System.assertEquals(2, splitted.size());
System.assertEquals('efg', splitted[1]);
System.assertEquals('abc', splitted[0]);
}
/**
* Used to read a delimited file.
*/
public class SSSCsvReader {
private String delim = ',';
// the input data
private String[] buffer;
public SSSCsvReader(String data){
this.buffer = data.split('\n');
Pseudo code for SyncTarget method:
sourceDigest = get_digest_from_feed(syncSource)
targetDigest = GetDigest()
for each entry in syncSource:
gcon = retrieve_contact_from_google (entry)
if gcon == null:
create_google_contact(entry)
else:
<TargetConfigInfo>
<TargetPage>C_OPP_BRAND</TargetPage>
<ReferingPages>
<ContextConditionInfo>
<ReferringPage>OPPORTUNITY</ReferringPage>
<DataPath>C_OPP_BRAND:OPPORTUNITYID</DataPath>
<ConditionValue>ReferringId</ConditionValue>
</ContextConditionInfo>
</ReferingPages>
</TargetConfigInfo>
<?xml version="1.0"?>
<ContextualListConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<TargetPages>
<TargetConfigInfo>
<TargetPage>CONTACT</TargetPage>
<ReferingPages>
<ContextConditionInfo>
<ReferringPage>ACCOUNT</ReferringPage>
<DataPath>CONTACT:ACCOUNTID</DataPath>
<ConditionValue>ReferringId</ConditionValue>
@f1code
f1code / GetCampaignResponsesPaged.cs
Created April 5, 2012 16:41
GetCampaignResponsesPaged
public class CampaignResponse
{
public String Id { get; set; }
public String ContactId { get; set; }
}
public List<CampaignResponse> GetCampaignResponses(String campaignId)
{
List<CampaignResponse> result = new List<CampaignResponse>();
GetCampaignResponsesPaged(campaignId, result, 1);
ICAccWidget nw = Sage.Platform.EntityFactory.Create();
nw.Account = caccwidget.Account;
nw.WIdget_name = caccwidget.WIdget_name;
nw.Quantity = caccwidget.Quantity;
nw.Price = caccwidget.Price;
nw.Save();
function () {
// Execute the "Copy" method on each selected record
var grid = this;
// check that we have a selection
var selectedItems = grid.selection.getSelected();
if (selectedItems.length < 1) {
alert(grid.noSelectionsText);
return;
}
@f1code
f1code / gist:858089
Created March 7, 2011 04:52
CSV Reader Test
@isTest
private class SSSCsvReaderTest {
static testmethod void testSplitCsvSimple(){
String line = 'abc,efg';
String[] splitted = new SSSCsvReader(line).readLine();
System.assertEquals(2, splitted.size());
System.assertEquals('efg', splitted[1]);
System.assertEquals('abc', splitted[0]);
}