Error accessing product object method - Lotus Notes - lotus-notes

I'm getting this error "Error accessing product object method" on Call mySqlTableObj.init(url,user,password)
here is the lotusscript script library:
Dim jsDU As New JAVASESSION
Dim mySqlTable As JAVACLASS
Dim mySqlTableObj As JAVAOBJECT
Set mySqlTable = jsDU.GetClass("org.piu.MySQLTable.MySQLObject")
Set mySqlTableObj = mySqlTable.Createobject()
Call mySqlTableObj.init(url,user,password)
Set getMySQLTableObject = mySqlTableOBJ
here's the java script library:
public void init( String url, String un,String pd) {
this.url = url;
this.un = un;
this.pd = pd;
}
I do not get this error all the time. Sometimes it does not appear sometimes it does. Can anyone help me with this?
Thanks!

Related

Acumatica API: Using CR303000.Actions.ConverToCustomer

I'm trying to use the Acumatica API to convert a Business Account to a Customer on Acumatica 5.20.2067. The code I'm using is based on converting a Lead to a Business Account. Converting a Business Account to a Customer seems simpler than converting a Lead because converting a Business Account does not pop up a dialog box. However, I've tried it two ways and one produces an error and the other creates a completely separate Customer record instead of converting the existing Business Account.
Based on the code in the other post about converting a Lead, here is the code that I think should work:
Public Function ConvertBusinessAccountToCustomer(ByVal baID As String, ByVal firstName As String, ByVal LastName As String)
Dim CR303000 As CR303000Content = m_context.CR303000GetSchema()
m_context.CR303000Clear()
Dim AR303000 As AR303000Content = m_context.AR303000GetSchema()
m_context.AR303000Clear()
' call the Action to convert the BA to a Customer
Dim baKeyVal As Value = CreateValue(CR303000.AccountSummary.BusinessAccount, baID)
Dim updateBACommands As Command() = {baKeyVal, CR303000.Actions.ConverToCustomer}
Dim updateBaResult As CR303000Content() = m_context.CR303000Submit(updateBACommands)
' just like with Lead, the Customer record now needs to be saved
' add other fields required for Customer
Dim customerNameVal As Value = CreateValue(AR303000.CustomerSummary.CustomerName, CreateCustomerFullName(firstName, LastName))
Dim classVal As Value = CreateValue(AR303000.GeneralInfoFinancialSettings.CustomerClass, "DEFAULT")
Dim statementCycleVal As Value = CreateValue(AR303000.GeneralInfoFinancialSettings.StatementCycleID, "ENDOFMONTH")
Dim statementTypeVal As Value = CreateValue(AR303000.BillingSettingsPrintAndEmailSettings.StatementType, "Open Item")
Dim cashDiscountAccountVal As Value = CreateValue(AR303000.GLAccountsCashDiscountAccount.CashDiscountAccount, "10103")
Dim creditVerificationVal As Value = CreateValue(AR303000.GeneralInfoCreditVerificationRulesCreditVerification.CreditVerification, "Disabled")
Dim commandsCustomer As Command() =
{
customerNameVal, classVal, statementCycleVal, statementTypeVal, cashDiscountAccountVal, creditVerificationVal,
AR303000.Actions.Save,
AR303000.CustomerSummary.CustomerID
}
Dim newCustomerContent As AR303000Content() = m_context.AR303000Submit(commandsCustomer)
Dim newCustomerID As String = ""
If newCustomerContent.Length > 0 Then
' this should be exact same as the newBAID, this is just for debugging
newCustomerID = newCustomerContent(0).CustomerSummary.CustomerID.Value
End If
Return newCustomerID
End Function
The result though is that when CR303000Submit is called with the ConverToCustomer action, I get the following error referring to the Default Location Value:
[SoapException: System.Web.Services.Protocols.SoapException: Server was unable to process request.
---> PX.Data.PXFieldValueProcessingException: Error: An error occurred while processing the field Default Location value 15497 Error: Default Location '15497' cannot be found in the system.. ---> PX.Data.PXSetPropertyException: Error: DefLocationID '15497' cannot be found in the system.
at PX.Data.PXSelectorAttribute.throwNoItem(String[] restricted, Boolean external, Object value)
at PX.Data.PXSelectorAttribute.FieldVerifying(PXCache sender, PXFieldVerifyingEventArgs e)
at PX.Data.PXCache.OnFieldVerifying(String name, Object row, Object& newValue, Boolean externalCall)
at PX.Data.PXCache`1.a(TNode& A_0)
--- End of inner exception stack trace ---
at PX.Data.PXCache`1.Insert(Object data, Boolean bypassinterceptor)
at PX.Data.PXCache`1.Insert(Object data, Boolean bypassinterceptor)
at PX.Data.PXCache`1.Insert(Object data)
at PX.Data.PXCache`1.Extend[Parent](Parent item)
at PX.Objects.CR.BusinessAccountMaint.ConverToCustomer(PXAdapter adapter)
at PX.Data.PXAction`1.a(PXAdapter A_0)
at PX.Data.PXAction`1.<Press>d__c.MoveNext()
at PX.Data.PXAction`1.<Press>d__c.MoveNext()
at PX.Api.SyImportProcessor.SyStep.CommitChanges(Object itemToBypass, PXFilterRow[] targetConditions, PXFilterRow[] filtersForAction)
at PX.Api.SyImportProcessor.ExportTableHelper.ExportTable()
at PX.Api.ScreenUtils.Submit(String screenId, Command[] commands, SchemaMode schemaMode, PXGraph& graph, String& redirectContainerView, String& redirectScreen, Boolean mobile, Dictionary`2 viewFilters)
at PX.Api.Services.ScreenService.Submit(String id, IEnumerable`1 commands, SchemaMode schemaMode, Boolean mobile, PXGraph& forceGraph, String& redirectContainerView, String& redirectScreen, Dictionary`2 viewFilters)
at PX.Api.Services.ScreenService.Submit(String id, IEnumerable`1 commands, SchemaMode schemaMode)
at PX.Api.Soap.Screen.ScreenGate.Submit(Command[] commands)
--- End of inner exception stack trace ---]
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1724
Source Error
Line 1555: <System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.acumatica.com/generic/CR303000/Submit", RequestNamespace:="http://www.acumatica.com/generic/", ResponseNamespace:="http://www.acumatica.com/generic/", Use:=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)> _
Line 1556: Public Function CR303000Submit(ByVal commands() As Command) As <System.Xml.Serialization.XmlArrayAttribute("SubmitResult"), System.Xml.Serialization.XmlArrayItemAttribute("Content")> CR303000Content()
Line 1557: Dim results() As Object = Me.Invoke("CR303000Submit", New Object() {commands})
Line 1558: Return CType(results(0),CR303000Content())
Line 1559: End Function
The other thing I tried was to change the commands for the CR303000Submit to add a Save action:
Dim updateBACommands As Command() = {baKeyVal, CR303000.Actions.ConverToCustomer, CR303000.Actions.Save}
That gets me past that line without an error, but then when I call the AR303000Submit it just creates a separate Customer record with a different Customer/Business Account ID rather than converting the existing Business Account.
There are two problems here:
An error occurred while processing the field Default Location value 15497 Error: Default Location '15497' cannot be found in the system.
I think this is your data problem. Login with browser and check this Business Account manually. I think you will receive same error.
Convert To Customer action problem
This action produce redirect. It is a problem. But there is a solution:
Create new customization Project
Create GraphExtension for Grapth "BusinessAccountMaint"
Insert next code
using System;
using System.Collections;
using Avalara.AvaTax.Adapter.AvaCert2Service;
using PX.Common;
using PX.Data;
using PX.Data.EP;
using PX.Objects.AP;
using PX.Objects.CS;
using PX.Objects.CT;
using PX.Objects.SO;
using PX.SM;
using System.Collections.Generic;
using PX.Objects;
using PX.Objects.CR;
namespace PX.Objects.CR
{
public class BusinessAccountMaint_Extension : PXGraphExtension
{
public PXAction<BAccount> convertToCustomerAndSave;
// hidden action. Used in API calls
[PXUIField(DisplayName = "Convert To Customer And Save", Visible = false, MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select)]
[PXButton(ImageKey = PX.Web.UI.Sprite.Main.Process)]
public virtual IEnumerable ConvertToCustomerAndSave(PXAdapter adapter)
{
try
{
return Base.ConverToCustomer(adapter);
}
catch (PXRedirectRequiredException e) // catch redirect exception
{
(e.Graph as AR.CustomerMaint).Save.Press(); // Save our new customer
return adapter.Get();
}
}
}
}
Save and Publish
Regenerate Service Reference (WSDL)
Use new action in your cade
static void Main(string[] args)
{
var client = new ScreenSoapClient();
client.Login("admin", "123");
var baSchema = client.CR303000GetSchema();
var commands = new Command[]
{
new Value
{
Value = "MAURICES",
LinkedCommand = baSchema.AccountSummary.BusinessAccount
},
baSchema.Actions.ConvertToCustomerAndSave // use our new action instead of default
};
client.CR303000Submit(commands);
}
This code will convert Business Account to Customer and Save it immediately

how to save custom entity with service builder liferay

how to save custom entity with service builder liferay?
i create new entity (name=BasicProfile)
and build by service builder liferay but
an exception occurred while saving.
my code :
BasicProfile basicProfile = new BasicProfileImpl();
basicProfile.setUserId(11701L);
basicProfile.setBirthCertificateSerial(birthCertificate);
basicProfile.setCreateDate(new Date());
basicProfile.setFatherName(fatherName);
basicProfile.setExtCustId(acceptorNumber);
basicProfile.setMobileNumber(telNumber);
basicProfile.setNationalCode(nationalCode);
basicProfile = BasicProfileLocalServiceUtil.addBasicProfile(basicProfile);
In your BasicProfileLocalServiceImpl.java create the following method:
public BasicProfile create(long userId, String birthCertificate, String fatherName, String acceptorNumber, String telNumber, String nationalCode) throws Exception {
long id = counterLocalService.increment();
BasicProfile obj = createBasicProfile(id);
obj.setUserId(userId);
obj.setBirthCertificateSerial(birthCertificate);
obj.setCreateDate(new Date());
obj.setFatherName(fatherName);
obj.setExtCustId(acceptorNumber);
obj.setMobileNumber(telNumber);
obj.setNationalCode(nationalCode);
obj = updateProduct(obj);
return obj;
}
Then in your code call that method to create a new object:
BasicProfile basicProfile = BasicProfileLocalServiceUtil.create(userId, birthCertificate, fatherName, acceptorNumber, telNumber, nationalCode);

Invalid OData path and Invalid action error

I am trying to create a ODataController and have it like so:
public class ProductSetController : ODataController
{
public IQueryable<ProductRef> GetAllProducts(string StoreId, string flag)
{
long lStoreId = Convert.ToInt64(StoreId);
var featuredProducts = (from b in new SomeContext().SomeInfluence
where b.SomeInfluenceTypeId == 1234 && b.StoreId == lStoreId && b.IsDeleted == false
select b.ProductId).ToList();
return (from b in new OProdctSubscriptionContext(lStoreId).ProductRef where featuredProducts.Contains(b.ProductId) select b).AsQueryable();
}
}
And this in WebApiConfig's Register method:
ODataConventionModelBuilder builder = new ODataConventionModelBuilder();
builder.EntitySet<ProductRef>("ProductSet");
config.Routes.MapODataRoute("ODataRoute", "odata", builder.GetEdmModel());
To test it I made a call like so:
http://localhost:32944/odata/ProductSet/GetAllProducts?StoreId=5010&flag="N"
The browser printed out this error:
{"$id":"1","Message":"The OData path is
invalid.","ExceptionMessage":"Invalid action detected.
'GetAllProducts' is not an action that can bind to
'Collection([Entities.OpenApi.Products.ProductRef
Nullable=False])'.","ExceptionType":"Microsoft.Data.OData.ODataException","StackTrace":"
at
System.Web.Http.OData.Routing.DefaultODataPathHandler.ParseAtEntityCollection(IEdmModel
model, ODataPathSegment previous, IEdmType previousEdmType, String
segment)\r\n at
System.Web.Http.OData.Routing.DefaultODataPathHandler.ParseAtCollection(IEdmModel
model, ODataPathSegment previous, IEdmType previousEdmType, String
segment)\r\n at
System.Web.Http.OData.Routing.DefaultODataPathHandler.ParseNextSegment(IEdmModel
model, ODataPathSegment previous, IEdmType previousEdmType, String
segment)\r\n at
System.Web.Http.OData.Routing.DefaultODataPathHandler.Parse(IEdmModel
model, String odataPath)\r\n at
System.Web.Http.OData.Routing.ODataPathRouteConstraint.Match(HttpRequestMessage
request, IHttpRoute route, String parameterName, IDictionary`2 values,
HttpRouteDirection routeDirection)"}
What am I missing?
Any help is greatly appreciated.
Regards.
Just had this today.
Change
builder.EntitySet<ProductRef>("ProductSet");
to:
builder.EntitySet<ProductRef>().Collection.Action("GetAllProducts");
Add
[HttpPost]
public IQueryable<ProductRef> GetAllProducts(string StoreId, string flag)
This page helped me: http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/odata-actions

Web Browser to handle pop ups within the application

I am trying to use the WebBrowser control to launch a new form for popups instead of it opening in IE. I have tried to use the AxWebBrowser instead to get the popups which works with NewWindow3 event and just doing e.ppDisp = AxWebBrowser.Application, but there are many limitations that come with AxWebBrowser. So instead I am trying to Extend the normal WebBrowser to include the NewWindow3 event like the AxWebBrowser but running into problems. With e.ppDisp = AxWebBrowser.Application I am getting errors: "InvalidVariant was detected" followed by "Specified OLE variant is invalid" if I continue.
Note: This is my first time extending a class so I could be over looking something simple. If I try just navigating to the new URL in the new window, I get java script errors from the site.
I have updated the code base on comments. Have removed the ExtendedWebBrowser class for a munch smaller and nicer version. Here is the New Code:
From the main form and a very similar BrowserPopup form -
Protected Overrides Sub OnLoad(ByVal e As EventArgs)
MyBase.OnLoad(e)
nativeBrowser = DirectCast(ExtendedWebBrowser1.ActiveXInstance, SHDocVw.WebBrowser)
AddHandler nativeBrowser.NewWindow3, AddressOf nativeBrowser_NewWindow3
AddHandler nativeBrowser.WindowClosing, AddressOf nativeBrowser_WindowClosing
End Sub
Private Sub nativeBrowser_NewWindow3(ByRef ppDisp As Object, ByRef Cancel As Boolean, ByVal dwflags As UInteger, ByVal bStrUrlContext As String, ByVal bstrUrl As String)
Dim popup = New BrowserPopup()
popup.Show(Me)
popup.browserPop.DocumentText = bStrUrlContext
ppDisp = popup.browserPop.ActiveXInstance
End Sub
Private Sub nativeBrowser_WindowClosing(ByVal IsChildWindow As Boolean, ByRef Cancel As Boolean)
MsgBox("working?") '<<<Doesn't Trigger>>>
End Sub
Protected Overrides Sub OnFormClosing(ByVal e As FormClosingEventArgs)
MyBase.OnFormClosing(e)
End Sub
Also, if it helps, here is the scripting from the page that should be able to close the popup form but just seems to deactivate the WebBrowser instead.
<table isListBtn="false" cellpadding="0" enabled="true" class="buttonBorderBlue"
cellspacing="0" border="0" onClick="if (typeof(workpaneMediator_toolbar)!='undefined')
workpaneMediator_toolbar.onSelect('CANCEL_ACTION', this)"
actionType="CLOSE_WINDOW_TYPE" id="workpaneMediator_toolbar_CANCEL_ACTIONWrapper"
nowrap><tr><td class="buttonBlueTD">
You're right that WindowClosing doesn't get fired for Winforms WebBrowser Control, I confirm that. It appears to be a long-time bug in .NET WebBrowser ActiveX hosting code, which has never been addressed. Check this post for more details and a possible workaround.
Another possible workaround may be to host WebBrowser ActiveX Control directly via AxHost class, in which case WindowClosing gets fire correctly. Example:
C#:
using Microsoft.Win32;
using System;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace WebBrowserApp
{
// MainForm
public partial class MainForm : Form
{
WebBrowser webBrowser;
public MainForm()
{
InitializeComponent();
InitBrowser();
if (this.webBrowser.Document == null && this.webBrowser.ActiveXInstance == null)
throw new ApplicationException ("Unable to initialize WebBrowser ActiveX control.");
var ax = (SHDocVw.WebBrowser)this.webBrowser.ActiveXInstance;
ax.NewWindow2 += (ref object ppDisp, ref bool Cancel) =>
{
var popup = new RawBrowserPopup();
popup.Visible = true;
ppDisp = popup.WebBrowser.ActiveXInstance;
};
this.Load += (s, e) =>
{
this.webBrowser.DocumentText = "<a target=\"_blank\" href=\"javascript:'<button onclick=\\'window.close()\\'>Close</button>'\">Go</a>";
};
}
// create a WebBrowser instance
void InitBrowser()
{
this.webBrowser = new WebBrowser();
this.webBrowser.Dock = DockStyle.Fill;
this.Controls.Add(this.webBrowser);
this.webBrowser.Visible = true;
}
}
// RawWebBrowser
public class RawWebBrowser : AxHost
{
public RawWebBrowser()
: base("8856f961-340a-11d0-a96b-00c04fd705a2")
{
}
public event EventHandler Initialized;
protected override void AttachInterfaces()
{
if (this.Initialized != null)
this.Initialized(this, new EventArgs());
}
public object ActiveXInstance
{
get
{
return base.GetOcx();
}
}
}
// RawBrowserPopup
public class RawBrowserPopup : Form
{
RawWebBrowser webBrowser;
public RawWebBrowser WebBrowser
{
get { return this.webBrowser; }
}
public RawBrowserPopup()
{
this.webBrowser = new RawWebBrowser();
this.webBrowser.Initialized += (s, e) =>
{
var ax = (SHDocVw.WebBrowser)this.webBrowser.ActiveXInstance;
ax.NewWindow2 += (ref object ppDisp, ref bool Cancel) =>
{
var popup = new RawBrowserPopup();
popup.Visible = true;
ppDisp = popup.WebBrowser.ActiveXInstance;
};
ax.WindowClosing += (bool IsChildWindow, ref bool Cancel) =>
{
Cancel = true;
this.Close();
};
};
this.webBrowser.Dock = DockStyle.Fill;
this.Controls.Add(this.webBrowser);
this.webBrowser.Visible = true;
}
}
}
VB.NET:
Public Class Form1
Dim webBrowser As WebBrowser = New WebBrowser()
Sub New()
MyBase.New()
Me.InitializeComponent()
webBrowser.Dock = DockStyle.Fill
Me.Controls.Add(webBrowser)
webBrowser.Visible = True
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.webBrowser.DocumentText = "<a target='_blank' href='javascript:""<button onclick=\""window.close()\"">Close</button>""'>Go</a>"
Dim ActiveX As SHDocVw.WebBrowser = Me.webBrowser.ActiveXInstance
AddHandler ActiveX.NewWindow2, AddressOf WebBrowser_ActiveX_NewWindow2
End Sub
Private Sub WebBrowser_ActiveX_NewWindow2(ByRef ppDisp As Object, ByRef Cancel As Boolean)
Dim popup As RawBrowserPopup = New RawBrowserPopup()
popup.Visible = True
ppDisp = popup.WebBrowser.ActiveXInstance
End Sub
End Class
Public Class RawWebBrowser
Inherits System.Windows.Forms.AxHost
Sub New()
MyBase.New("8856f961-340a-11d0-a96b-00c04fd705a2")
End Sub
Event Initialized(sender As Object, e As EventArgs)
Protected Overrides Sub AttachInterfaces()
RaiseEvent Initialized(Me, New EventArgs())
End Sub
Public ReadOnly Property ActiveXInstance() As Object
Get
Return MyBase.GetOcx()
End Get
End Property
End Class
Public Class RawBrowserPopup
Inherits System.Windows.Forms.Form
Dim WithEvents rawBrowser As RawWebBrowser = New RawWebBrowser()
Sub New()
MyBase.New()
rawBrowser.Dock = DockStyle.Fill
Me.Controls.Add(rawBrowser)
rawBrowser.Visible = True
End Sub
Public ReadOnly Property WebBrowser() As Object
Get
Return rawBrowser
End Get
End Property
Private Sub rawBrowser_Initialized(sender As Object, e As EventArgs) Handles rawBrowser.Initialized
Dim activeX As SHDocVw.WebBrowser = rawBrowser.ActiveXInstance
AddHandler activeX.NewWindow2, AddressOf activeX_NewWindow2
AddHandler activeX.WindowClosing, AddressOf activeX_WindowClosing
End Sub
Private Sub activeX_NewWindow2(ByRef ppDisp As Object, ByRef Cancel As Boolean)
Dim popup As RawBrowserPopup = New RawBrowserPopup()
popup.Visible = True
ppDisp = popup.WebBrowser.ActiveXInstance
End Sub
Private Sub activeX_WindowClosing(IsChildWindow As Boolean, ByRef Cancel As Boolean)
Cancel = True
Me.Close()
End Sub
End Class

How to update field value in current item via event receiver?

EDIT: I've realized that my approach in the second code block was unnecessary. I could accomplish the same thing by doing the following in ItemUpdated:
SPListItem thisItem = properties.ListItem;
thisItem.File.CheckOut();
thisItem["Facility Number"] = "12345";
thisItem.Update();
thisItem.File.CheckIn("force check in");
Unfortunately, I'm still getting the same error message when "thisItem.Update();" is executed: he sandboxed code execution request was refused because the Sandboxed Code Host Service was too busy to handle the request
I actually was receiving the error above when deploying my sandbox solution originally and used this link (http://blogs.msdn.com/b/sharepointdev/archive/2011/02/08/error-the-sandboxed-code-execution-request-was-refused-because-the-sandboxed-code-host-service-was-too-busy-to-handle-the-request.aspx) to fix it.
I am trying to write a C# event receiver that changes the value of a field when a document is added/changed in a library. I have tried using the following code:
public override void ItemUpdating(SPItemEventProperties properties)
{
base.ItemUpdating(properties);
string fieldInternalName = properties.List.Fields["Facility Number"].InternalName;
properties.AfterProperties[fieldInternalName] = "12345";
}
Unfortunately, this is only working for certain fields. For example, if I replaced "Facility Number" with "Source", the code will execute properly. This may be the fact that we are using a third party software (called KnowledgeLake) that replaces the default edit form in SharePoint with a Silverlight form. Anyway, because I was having challenges with the code above (again, because I think the Silverlight form may be overriding the field after the ItemUpdating event fires), I have tried the following code:
public override void ItemUpdated(SPItemEventProperties properties)
{
base.ItemUpdated(properties);
//get the current item
SPListItem thisItem = properties.ListItem;
string fieldName = "Facility Number";
string fieldInternalName = properties.List.Fields[fieldName].InternalName;
string fieldValue = (string)thisItem["Facility Number"];
if (!String.IsNullOrEmpty(fieldValue))
{
//properties.AfterProperties[fieldInternalName] = "123456789";
SPWeb oWebsite = properties.Web as SPWeb;
SPListItemCollection oList = oWebsite.Lists[properties.ListTitle].Items;
SPListItem newItem = oList.GetItemById(thisItem.ID);
newItem.File.CheckOut();
thisItem[fieldInternalName] = "12345";
thisItem.Update();
newItem.File.CheckIn("force");
}
}
First off, the above seems a little klunky to me as I would love to just use the AfterProperties method. Additionally, I am getting the following error when "newItem.Update()" is executed: he sandboxed code execution request was refused because the Sandboxed Code Host Service was too busy to handle the request
Am I missing something here? I would love to utilize the first code block. Any help would be appreciated.
Josh was able to answer his own question, which helped me fix my problem as well. Here is a working code snippit.
public override void ItemUpdated(SPItemEventProperties properties)
{
string internalName = properties.ListItem.Fields[columnToUpdate].InternalName;
//Turn off event firing during item update
base.EventFiringEnabled = false;
SPListItem item = properties.ListItem;
item[internalName] = newVal;
item.Update();
//Turn back on event firing
base.EventFiringEnabled = true;
base.ItemUpdated(properties);
}

Resources