MySPList.Items[0] NullReferenceException

Hi, here is a though one. I hope someone can help, as it is driving me crazy.
I have an assembly in GAC, which has a class, which is being executed by SPTimerScheduler . Everything related to the timer is fine, my code is being run, by SPConfigAcct (the user which is running the Windows SharePoint Timer). The user has all possible permissions, etc...
Now, the problem.
I create an instance of SPSite and SPWeb, which works fine. Using the SPWeb instance, I can access lists just fine. But when I do that:
web.Lists["my list"].Items[0]
I get a NullReferenceException.
I have tried all possible variations, like:
SPList list = web.Lists["my list"];
list.Items[0]; // Throws NullReference
and it just doesn't want to work. Now, the kicker. If I navigate with the browser to the list "my list" in sharepoint and View one of the items there, then run the timer, it can access the items just fine.
This leads me to believe that the problem is somehow related to the application pool. Anyway, I cross-referenced my logs with the logs in SharePoint and here is what I saw (in bold are items I have masked):
12/05/2009 03:00:59.15 NullReferenceException in SPRequest. stackTrace at release:
12/05/2009 03:00:59.15 ERROR:
request not found in the TrackedRequests. We might be creating and closing webs on different threads.
ThreadId = 24, Free call stack =
at Microsoft.SharePoint.SPRequestManager.Release(SPRequest request)
at Microsoft.SharePoint.SPWeb.Invalidate()
at Microsoft.SharePoint.SPWeb.InitWebPublic()
at Microsoft.SharePoint.SPWeb.get_ServerRelativeUrl()
at Microsoft.SharePoint.SPWeb.get_Url()
at Microsoft.SharePoint.SPListItemCollection.EnsureListItemsData()
at Microsoft.SharePoint.SPListItemCollection.get_Item(Int32 iIndex)
at [myAssembly].[myClass].SomeMethod(SPWeb web)
at [myAssembly].TimerJobs.[MyClass].MySynchronizer.Sync()
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at SharePointer.Utilities.InvokingMethod.Invoke()
at SharePointer.Utilities.MethodExecutor.PerformExecution()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart() , Allocation call stack (if present) null
12/05/2009 03:00:59.13 An SPRequest object was not disposed before the end of this thread.
To avoid wasting system resources, dispose of this object or its parent (such as an SPSite or SPWeb) as soon as you are done using it.
This object will now be disposed. Allocation Id: {xxx-FA1C-474D-9DB7-zzzzz
} To determine where this object was allocated,
create a registry key at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\HeapSettings.
Then create a new DWORD named SPRequestStackTrace with the value 1 under this key.
If anyone has any idea, no matter how crazy, please let me know!Regards,
Hristo Yankov
My blog - http://blog.myitechnology.com

Debug the code by attaching the Timer process and see what is really happening.
Are you using the SPWeb in multiple threads??
Enrique Blanco PMP, Consultant http://www.eblanco.com
Hi all of you guys and thanks for your responses. I think I may have found out what the issue is and fixed it. I will test it again in an hour or so, because it didn't reproduce always.
Enrique, you are very close. Anyway, here is what I suspect:
This solution I am using - SPTimerScheduler ... it is run by SharePoint, as a timer job, every minute or so. Then, based on its configuration in a list, the SPTimerScheduler code instantiates my classes and runs them in separate threads. So basically, it works as a dispatcher.
Alright, so what happens is the following:
Main Thread (real timer job run by SharePoint) - running SPTimerScheduler feature class. It prepares to start an instance of my very own class (stored in another assembly). Here is the trick part - the constructor of my class is being run immediately, because that's how threading works. In the constructor of my class, I am getting an instance of SPWeb, based on a URL parameter. So far so good. Ok, so it has now prepared my class in a thread and starts it. Then this Main Thread finishes.
The Thread SPTimerScheduler started - the constructor is already done, right? Alright, Main Thread instructed this thread to execute a method of my class (in this thread). The method tries to access my SPWeb property. Which kind of works, but it is all messed up. At least SPListItem's properties are throwing exceptions.
So, when I moved the initialization of SPWeb from the constructor, to the main method (which the main thread starts in a separate thread), everything started working just fine.
I know it's complicated and I am not good in explanations, so let me illustrate with code. This is what my assembly looks like:
Members:
 SPWeb web;
Constructor: // Being called in Main Thread (the SharePoint timer job)
 web = new SPWeb(siteUrl);
Main Method: // Being called in a thread, separate from Main Thread
 web.Lists[xxx].Items[0]; // Throws NullReferenceException
Conclusion: If I let my SPWeb property be initialized in another thread, but the method of my class which accesses this property, being called in another thread, ugly things happen.
Well, I hope I am right. I will test again later. This is messed up.
Regards,
Hristo Yankov
My blog - http://blog.myitechnology.com

Similar Messages

  • Custom SharePoint 2010 designer page throws "The data source control failed to execute the insert command" exception while adding the new item after the August 13, 2013 CU has installed

    We have the SharePoint Server 2010 with SP1 environment on which the custom SP2010 designer pages were working as expected before the
    August 13, 2013 CU has installed. But, getting the below exception while trying to add the new item after the CU has installed.
    Error while executing web part: System.NullReferenceException: Object reference not set to an instance of an object.     at Microsoft.SharePoint.WebControls.SPDataSourceView.ExecuteInsert(IDictionary values)     at
    System.Web.UI.DataSourceView.Insert(IDictionary values, DataSourceViewOperationCallback callback) 3b64c3a0-48f3-4d4a-af54-d0a2fc4553cc
    06/19/2014 16:49:37.65  w3wp.exe (0x1240)                        0x1300 SharePoint Foundation        
     Runtime                        tkau Unexpected Microsoft.SharePoint.WebPartPages.DataFormWebPartException: The data source control
    failed to execute the insert command. 3b64c3a0-48f3-4d4a-af54-d0a2fc4553cc    at Microsoft.SharePoint.WebPartPages.DataFormWebPart.InsertCallback(Int32 affectedRecords, Exception ex)     at System.Web.UI.DataSourceView.Insert(IDictionary
    values, DataSourceViewOperationCallback callback)     at Microsoft.SharePoint.WebPartPages.DataFormWebPart.FlatCommit()     at Microsoft.SharePoint.WebPartPages.DataFormWebPart.HandleOnSave(Object sender, EventArgs e)    
    at Microsoft.SharePoint.WebPartPages.DataFormWebPart.RaisePostBackEvent(String eventArgument)     at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)     at System.Web.UI.Page.ProcessRequestMain(Boolean
    inclu... 3b64c3a0-48f3-4d4a-af54-d0a2fc4553cc
    06/19/2014 16:49:37.65* w3wp.exe (0x1240)                        0x1300 SharePoint Foundation        
     Runtime                        tkau Unexpected ...deStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 3b64c3a0-48f3-4d4a-af54-d0a2fc4553cc
    I have tried changing the "DataSourceMode" as below, now the insert command is working, but update command is not working.
    <SharePoint:SPDataSource runat="server" DataSourceMode="ListItem" />
    Also, the lookup dropdown fields are displaying the value as "<a href="Daughterhttp://cpsp10/sites/Employees/_layouts/listform.aspx?PageType=4&ListId={8F62F444-FB6A-4F03-9522-C4696B45DCD1}&ID=10&RootFolder=*">Daughter</a>"
    instead of only "Daughter".
    Please provide the solution to get rid of this issue.
    Thanks
    Ramasubbu

    Try below:
    http://social.technet.microsoft.com/Forums/en-US/ae910269-3a0c-4506-844b-e8bc89d95b71/data-source-control-failed-to-execute-the-insert-command
    http://blog.jussipalo.com/2012/01/sharepoint-2010-data-source-control.html
    While there can be many causes for this generic error message, in my case the first parameter or ddwrt:DataBind function inside the SharePoint:FormFields element was
    'i' and I was working with an Edit Form. Changing it to
    'u' as it was with every other FormField fixed the issue.
    <SharePoint:FormField runat="server" id="ff1{$Pos}" ControlMode="Edit" FieldName="Esittaja" __designer:bind="{ddwrt:DataBind('u',concat('ff1',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Esittaja')}"
    />
    Explanation:
    DataBind operation type parameters (the first parameter) are listed below:
    'i' stands for INSERT,
    'u' stands for UPDATE,
    'd' stands for DELETE.
    http://webcache.googleusercontent.com/search?q=cache:d9HHY4I7omgJ:thearkfloats.blogspot.com/2014/03/sharepoint-2010-data-source-control.html+&cd=4&hl=en&ct=clnk&gl=in
    If this helped you resolve your issue, please mark it Answered

  • SQL CLR Table-Valued Function System.NullReferenceException

    Good day.
    I wrote a clr table-valued function that gets the data from the sharepoint list using the client model.
    Sometimes I get exception (When I calling this function I get 90000 rows and then I get this exception...):
    Msg 6260, Level 16, State 1, Line 1
    An error occurred while getting new row from user defined Table Valued Function :
    System.NullReferenceException: Object reference not set to an instance of an object. System.NullReferenceException: v at SDS.FillRow(Object obj, SqlInt32& month, SqlString& datePlanSalary, SqlString& dilerCode, SqlString& dilerName, SqlString&
    model, SqlInt32& countSalary).
    How can I fix this issue?
    My Code:
    public class SDS
    [SqlFunction(SystemDataAccess = SystemDataAccessKind.Read, FillRowMethodName = "FillRow")]
    public static IEnumerable SDSItems(SqlString url, SqlString listName)
    ClientContext context = new ClientContext(url.ToString());
    List list = context.Web.Lists.GetByTitle(listName.ToString());
    CamlQuery query = new CamlQuery();
    query.ViewXml = "<View/>";
    ListItemCollection listItems = list.GetItems(query);
    context.Load(list);
    context.Load(listItems);
    context.ExecuteQuery();
    return listItems;
    public static void FillRow(
    object obj,
    out SqlInt32 month,
    out SqlString datePlanSalary,
    out SqlString dilerCode,
    out SqlString dilerName,
    out SqlString model,
    out SqlInt32 countSalary
    item = (ListItem)obj;
    month = Convert.ToInt32(item["_x041c__x0435__x0441__x044f__x04"]);
    datePlanSalary = Convert.ToString(item["_x0414__x0430__x0442__x0430__x000"]);
    dilerCode = Convert.ToString(item["_x041a__x043e__x0434__x0020__x04"]);
    dilerName = Convert.ToString(item["_x041d__x0430__x0437__x0432__x04"]);
    model = ((FieldLookupValue)item["_x041c__x043e__x0434__x0435__x04"]).LookupValue;
    countSalary = Convert.ToInt32(item["_x041a__x043e__x043b__x0438__x04"]);

    That's not a lot of information to go on, but...
    Can you put a check in your FillRow method for a null object (or one of your fields being null) and put out diagnostic information? Or is it happening in the ListItemCollection iterator itself? (i.e. before it returns a row back to FillRow). If it's happening
    in the iterator, perhaps you could subclass it and return diagnostics at that point.
    I'm also wondering (if it actually always happen at row 90000) if you're hitting a limit in web service call, or iterator, or UDF code. Does the function ever return more than 90000 rows successfully?
    Hope this helps, Bob

  • NullReferenceException was unhandled

    I am Building a Webbrowser in C#: this is the code
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    namespace Web_Browser
        public partial class Form1 : Form
            public Form1()
                InitializeComponent();
            private void goButton_Click(object sender, EventArgs e)
                webBrowser1.Navigate(new Uri(comboBox1.SelectedItem.ToString()));
            private void homeToolStripMenuItem_Click(object sender, EventArgs e)
                webBrowser1.GoHome();
            private void goBackToolStripMenuItem_Click(object sender, EventArgs e)
                webBrowser1.GoForward();
            private void goForwardToolStripMenuItem_Click(object sender, EventArgs e)
                webBrowser1.GoBack();
            private void Form1_Load(object sender, EventArgs e)
                comboBox1.SelectedText = "0";
                webBrowser1.GoHome();
    the problem is: when I run it I get this error
    "NullReferenceException was unhandeled"
    at the bold line
    can someone explane to me what I need to do??

    Hi programming,
    I have reproduced your code, and I was wondering what operation you made. If you debug your project and click the “goButton” after the form_load, it would appear the error message. It was becase your call the “comboBox1.SelectedItem” and “comboBox1.SelectedItem”
    was never set. I think you could modify your Form1_Load like below:
    private void Form0109_Load(object sender, EventArgs e)
    //comboBox1.SelectedText = "0";
    comboBox1.SelectedItem = comboBox1.Items[0];
    webBrowser1.GoHome();
    It would be helpful if you could share us how you get the error message.
    Best Regards,
    Edward
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

  • B1WS 1.1 WSDL Services Generator throwing NullReferenceException

    Hello, I'm new to B1WS so please bear with me.
    I've installed B1WS 1.1 on our test server running Windows Server 2008 Standard, SQL Server 2008 and B1 8.8. I followed the instructions in the enclosed "B1WS: B1 Web Services wrapper" document (B1WS.doc) and verified that DI Server was running.
    When I try to run the WSDL services generator against our demo company database, I get the following exception:
    System.NullReferenceException: Object reference not set to an instance of an object.
       at WebServiceDescription.SelectOperation.ShowUDOsList(String sessionID)
       at WebServiceDescription.SelectOperation..ctor(String sessionID)
       at WebServiceDescription.WsdlServicesGenerator.ShowOptions()
       at WebServiceDescription.Form1.btCreateWsdl_Click(Object sender, EventArgs e)
       at System.Windows.Forms.Control.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
       at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ButtonBase.WndProc(Message& m)
       at System.Windows.Forms.Button.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    Any ideas?
    Thanks in advance.
    Update: I got a copy of the source code and found where the failure is occurring. In the SelectOperation.cs file, the generator uses the CompanyService service in order to execute the query "SELECT Code, Name FROM OUDO" against the database. The call to the Query function returns a Recordset object, but the Row collection that is part of the Recordset object is null.
    An excerpt is below:
        private void ShowUDOsList(string sessionID)
          B1WSCompanyService.CompanyService cmpSrv = new WebServiceDescription.B1WSCompanyService.CompanyService();
          B1WSCompanyService.MsgHeader msgHeader = new WebServiceDescription.B1WSCompanyService.MsgHeader();
          msgHeader.ServiceName = WebServiceDescription.B1WSCompanyService.MsgHeaderServiceName.CompanyService;
          msgHeader.ServiceNameSpecified = true;
          msgHeader.SessionID = sessionID;
          cmpSrv.MsgHeaderValue = msgHeader;
          B1WSCompanyService.RecordsetParams rsp = new B1WSCompanyService.RecordsetParams();
          rsp.Query = "SELECT Code, Name FROM OUDO";
          B1WSCompanyService.Recordset rs = cmpSrv.Query(rsp);
          bool hasWrongUDOs = false;
          string wrongUDOs = "Following UDOs are not in the list because they have spaces in their names: ";
          for (int i=0; i< rs.Row.Length; i++)   // <--- This is where the NullReferenceException is thrown.
            if (rs.Row<i>.Property[1].Value.Contains(" "))
              hasWrongUDOs = true;
              wrongUDOs += rs.Row<i>.Property[0].Value + " ";
            else
              udoCheckedListBox.Items.Add(rs.Row<i>.Property[0].Value, true);
          if (hasWrongUDOs)
            Globals.AddLog(wrongUDOs, Globals.LogType.Error);
            wrongUDOs += ". Please modify these UDOs and run one more time the WsdlServicesGenerator.exe if you want to access them through B1WS.";
            MessageBox.Show(wrongUDOs, "UDOs excluded because of spaces in their names", MessageBoxButtons.OK, MessageBoxIcon.Warning);
    Why would the Recordset object have a null Row collection?
    Edited by: Dan Jordan on Sep 15, 2010 10:25 PM

    I worked around the problem by adding a user-defined object to our demo database. I didn't have any UDO's defined there, but it looks like there's a bug in how the code handles databases without any UDO's defined.

  • NULLReferenceException when using LINQ query with In clause

    Hi,
    I am not sure where my code is actually breaking. Kindly help as it's a production issue. It's not happening in SIT, but on production.
    NullReferenceException occurring when below method is called:
            internal bool IsFilingPartyWithActiveLAB(string docId)
                IBackEndMediator bckEndMd = null;
                List<DocCasePartyEntity> lstDCPWithLAB = null;
                try
                    if (!string.IsNullOrEmpty(docId))
                        bckEndMd = new BackEndMediatorImpl();
                        List<DocCasePartyEntity> lstDCP = bckEndMd.GetListDocCasePartyByDocId(docId);
                        lstDCPWithLAB = new List<DocCasePartyEntity>();
                        if (lstDCP != null && lstDCP.Count > 0)
                            lstDCPWithLAB = (from dcp in lstDCP
                                             where dcp.FilingInd
    == FilingPartyInd.Y &&
                                             dcp.HasLAC == YesNo.Y
                                             select dcp).ToList();
                        if (lstDCPWithLAB != null && lstDCPWithLAB.Count > 0)
                            foreach (DocCasePartyEntity dcp in lstDCPWithLAB)
                                DocCasePartyLACDetailEntity dcpLACDetailEntity = bckEndMd.GetDocCasePartyLACDetailByDCPId(dcp.DCPID);
                                if (dcpLACDetailEntity != null)
                                    if (dcpLACDetailEntity.LACRefStatus == LACRefStatus.A)
                                        return true;
                catch (Exception ex)
                    log.Error("Exception during IsFilingPartyWithActiveLAB()", ex);
                    throw;
                return false;
    Logged ERROR is:
    ERROR 2015-04-16 10:23:05,296 20 IELS.BackEnd.TaskList.Business.TaskListLABService -
    Exception during IsFilingPartyWithActiveLAB()
    System.NullReferenceException: Object reference not set to an instance of an object.
       at IELS.BackEnd.TaskList.Business.TaskListLABService.IsFilingPartyWithActiveLAB(String docId)
    DEBUG 2015-04-16 10:23:05,296 56 CrimsonLogic.Common.DMS.Utilities.SharePointHelper - :End GetSPFolder(http://URL, IELSFormXMLTemplates)
    ERROR 2015-04-16 10:23:05,296 20 IELS.BackEnd.TaskList.Presentation.TaskItemApprovalPage - TaskItemApproval: method-TaskItemApproval.BindWaiverFeeDetails, msg-System.NullReferenceException: Object reference not set to an instance of an object.
       at IELS.BackEnd.TaskList.Business.TaskListLABService.IsFilingPartyWithActiveLAB(String docId)
       at IELS.BackEnd.TaskList.Presentation.TaskItemApprovalPage.BindWaiverFeeDetails(List`1 feeListDTO)
    ERROR 2015-04-16 10:23:05,296 20 IELS.BackEnd.TaskList.Presentation.TaskItemApprovalPage - TaskListApprovalPageException occured at Page_Load
    System.NullReferenceException: Object reference not set to an instance of an object.
       at IELS.BackEnd.TaskList.Business.TaskListLABService.IsFilingPartyWithActiveLAB(String docId)
       at IELS.BackEnd.TaskList.Presentation.TaskItemApprovalPage.BindWaiverFeeDetails(List`1 feeListDTO)
       at IELS.BackEnd.TaskList.Presentation.TaskItemApprovalPage.Page_Load(Object sender, EventArgs e)
    ERROR 2015-04-16 10:23:05,296 20 CrimsonLogic.Legal.BootStrapper.BackEnd.ExceptionHandlerModule - Unhandled error occurred -
    System.NullReferenceException: Object reference not set to an instance of an object.
       at IELS.BackEnd.TaskList.Business.TaskListLABService.IsFilingPartyWithActiveLAB(String docId)
       at IELS.BackEnd.TaskList.Presentation.TaskItemApprovalPage.BindWaiverFeeDetails(List`1 feeListDTO)
       at IELS.BackEnd.TaskList.Presentation.TaskItemApprovalPage.Page_Load(Object sender, EventArgs e)
       at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
       at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
       at System.Web.UI.Control.OnLoad(EventArgs e)
       at System.Web.UI.Control.LoadRecursive()
       at System.Web.UI.Control.LoadRecursive()
       at System.Web.UI.Control.LoadRecursive()
       at System.Web.UI.Control.LoadRecursive()
       at System.Web.UI.Control.LoadRecursive()
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    ERROR 2015-04-16 10:23:05,296 20 CrimsonLogic.Legal.BootStrapper.BackEnd.BootStrapper - Unknown application error occurred.
    Thanks, SS

    I don't trust compilers.  Had issues over 30 years ago and never use a combined 'if' where one of the items is null.
    if (lstDCP != null)
    if(lstDCP.Count > 0)
    lstDCPWithLAB = (from dcp in lstDCP
    where dcp.FilingInd == FilingPartyInd.Y &&
    dcp.HasLAC == YesNo.Y
    select dcp).ToList();
    jdweng
    That will not happen becuase he is checking for null first then count:
    This is 
    List<string> lst = null;
    if ( lst != null && lst.Count > 0 )
    different than this: this will cause null ref error
    List<string> lst = null;
    if ( lst.Count > 0 && lst != null )
    Fouad Roumieh

  • NullReferenceException error

    2.     I created a validator for Sourcing Approvals (type 5012) where I want to get EntityViewerSections for the SourcedSpecification of the Sourcing Approval in context. I get a NullReferenceException error (i.e. Object reference not set to an instance of an object) for the code below. Any ideas what is causing the NullReferenceException?
    protected override bool Validate_Internal(IValidationContext ctx, object propVal)
    try
    var sourcingApproval = ctx.ValidationTarget.As<ISourcingApproval>();
    var sourcedSpec = sourcingApproval.SourcedSpecification;
    if (sourcedSpec is IIngredientSpecification)
    IEntityViewerConfig vc = null;
    vc = new IngredientParentViewerConfig();
    var specSections = vc.GetEntityViewerSections(sourcedSpec, null);
    catch (Exception ex)
    var errorId = EventLogWriter.AddEntry("{0}".F(ex.ToString()), EventLogEntryType.Error);
    AddValidationError(m_bReport, ctx, "An error has occured in ScrmRestrictedIngredientsValidator. Error Id #{0} has been assigned as the Id error. Please use this error Id #{0} when refering to this error.".F(errorId), GetType());
    return ctx.ErrorCount == 0;
    Edited by: user12207415 on Oct 26, 2012 9:35 AM

    so i found the missing line i needed for the configsections node and put it in the srcm web.config. i'm now able to call the GetEntityViewerSections without error but now i'm getting another NullReferenceException (stack trace is at the bottom). here's the line of code it's happening on. any ideas as to why?
    var specSections = vc.GetEntityViewerSections(sourcedSpec, null);
    var formulationSpecs = (new ArrayList(specSections)
    .Cast<IEntityViewerSection>()
    .SelectMany(entityViewerSection => entityViewerSection.Items.Cast<IEntityViewerItem>(),
    (entityViewerSection, item) => PdmGateway.GetBaseSpecByPkid(item.PKID))
    .Where(x => x is IFormulationSpecification)
    .Where(SpecWorkflowTagEvaluator.IsSpecApproved))
    .ToArray();
    Here's what GetBaseSpecByPkid does:
    public IBaseSpec GetBaseSpecByPkid(string pkid)
    return pkid == "" ? null : GetIXDataObject<IBaseSpec>(pkid);
    Here's the stack trace:
    at Xeno.Prodika.Services.ServiceManager.Xeno.Prodika.Services.IServiceManager.get_Item(String key)
    at Oracle.Agile.PlmProcess.PLM4PExtensionUtils.Common.ServiceHelper.get_ClassScopedSpecService()
    at Oracle.Agile.PlmProcess.PLM4PExtensionUtils.Workflow.SpecWorkflowTagEvaluator.IsSpecApproved(IBaseSpec baseSpec)
    at System.Linq.Enumerable.<>c__DisplayClassf`1.<CombinePredicates>b__e(TSource x)
    at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
    at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
    at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
    at Tyson.Pdm.Validator.Lib.ScrmValidators.ScrmRestrictedIngredientsValidator.Validate_Internal(IValidationContext ctx, Object propVal) in c:\PDMProjects\Prodika.Extensions\Dev\Trunk\Tyson.Pdm.Validator.Lib\ScrmValidators\ScrmRestrictedIngredientsValidator.cs:line 63

  • Open and Cleared Items

    Hi all
    We are currently busy finalising our FI-CA BW Data Modeling exercise - and in process to complete Dataflow documentation.
    We will make use of the standard open and cleared item extractors with enhancements on different levels. Some background on the requirements:
    - We will have to extract document types, divisions, dates, clearing reasons, contract account, Business Partner etc.. information to meet the requirements.
    - We will have to keep history for at least 26 months to produce the required management reports (very high number of data), and 'partition' the cubes on date level for both Cleared and Open Items.
    - Most of the reports display 13 months worth of billing/ payment figures. I.e. the report for the end of October show billings vs. payments for October 2006, September, August, July, ... to October 2005.
    - The requirement is that the report figures will not change from one month to the next (i.e. if I run the report for end of October - all figures from October 2006 to Oct 2005 will remain the same when I run the report for end of November). I.e. if reversals, transfers, returns etc. occur - these will be picked up in later months.
    - For the above requirement, we are looking at extracting open (end of month) and cleared items (for the specific monthly interval) on a monthly basis, and appending the data in the cubes. We will then always base the June figure in the report on the June month extraction (LAUFD/ LAUFI fields) and we will pick up any movement in the next month/s - i.e. July.
    Has anyone had these types of requirements before - to report on billings vs. payments, and report on history as described above. We would appreciate it if you could share your report requirements, and also design documents, especially the DataFlow documentation that we can look at as input to our design.

    We had a requirement to retrieve "aging of receiveables" by customer. Basically, it goes thru each record and depending on the due date places the amounts in the following buckets (example). 0-30 day Overdue, 31-60 days Overdue, 61-90 days overdue, 30+ days overdue, 60+ days overdue) etc all the way to 6+ years overdue.
    There are also cooresponding buckets for coming due analysis. For example, what is: 0-30 days coming due, 31-60 days coming due, 30+ days coming due, etc...
    To do this, first I needed to be able be able to produce an open items statement at any given time in the past. Now, this seems impossible because of how the items go from open to cleared all the time. And an item that was open one month ago, may not be open anymore.
    What I did was first remove any selections on item status. Then compare the posting date with teh key date in the past, if the posting date is less than or equal to the key date, keep the record.
    Then compare the clearing date with the key date. First, keep all that are #. (This keeps all records still open from that posting date/key date)
    Then, add another check for all items that were cleared after the key date (GT Key Date). This gives you the open items on that date.
    Hope that makes sense. Let me know if you want clarification.
    /smw

  • Configuring requirement : ordered item to absorb cost of free goods

    Hello Friends,
    I need to configure this in SAP SD.
    The main item should accumulate the cost of the free goods.
    I have  set the cumulative indicator and deactivated pring for this item.
    Do i still need to configure the stock value for the free goods as cost free item? Or is this step only applicable for
    another scenario, like,
    If I were to activate Pricing such that free goods is displayed as subitem and VPRS configured as cost and discount set to 100%
    1. Set  Item category to TANN using FREE usage   AND
    2. use condition type RL00 with requirement 55.
    3. use pricing type B.
    regards
    Ravi

    Read this SAP help at http://help.sap.com/saphelp_47x200/helpdata/en/dd/55fa4e545a11d1a7020000e829fd11/frameset.htm and the topic Free Goods in Sales and Distribution Processing for details.
    Also go through each step of the configuration of the path at SPRO->Sales and distribution->basic functions->free goods.
    Regards,

  • Divide discount of free goods between several items (SO)

    Hi gurus,
    I need to split the cost of the free good between the items generating it, i.e. if the customer buy 5pcs of Mat A and 4pcs of Mat B he gets 1pcs of Mat C for free. He will only see the original price for the "main" items and zero for the free good but intenally the profit margin of the "main" materials should be deducted with the cost of the free good and the free good should have full profit margin as if it was sold for full price.
    I'm aware that this is not standard SAP functionality and that I probably need to change a user exit in program MV45AFZZ.
    Please help me with this problem! Any advice or tips are highly appreciated.
    Best regards,
    Mia

    Is it possible to solve this problem by modifying a user exit? I was considering creating a new pricing condition which should be inflicted between the net value and profit margin by the user exit so that the customer only sees the original values for the main materials but the profit margins are reduced with the price of the free goods directly in the order. Is this doable?
    /Mia

  • Return of Free goods item - Problem in item category

    I am trying to create return order of Free sample billing
    (ZFDP). The return order type for the free sample is ZFDR.
    We have specified Item category for the ZFDR is RENN (Free good item) in IMG Activity -> Assign Item categories.
    When I create order and save it, it prompts me to enter G/L Account.
    This material is free. It should not prompt G/L Account for it. There is no revenue recognition specified for the item category. I tried changing item category to ZKLN i.e Free of charge item. This item category does not prompt for G/L Account while creating order. but I can not use this item category because it prompts me for Avialability. I can not remove the Avaialabilty check for it because the same item category is used in the Free sample order where availability check is required
    In ZFDP order type, we are issuing 100% discount by using R100
    discount condition.  Please let me know how can I solve this problem.
    I think there is some problem in my item category itself. .
    My setting for Item category in IMG - Define item category is
    same for both ZKLN and RENN. Only difference is RENN has returns
    tick and pricing field is blank. In ZKLN pricing is defined as B- 100%
    discount. I also tried changing the pricing option of RENN to B.
    But still it is asking for G/L Account.
    I can not use ZKLN instead of RENN because my ZKLN is used in the
    Free item Sales order.
    Please help.
    Regards
    Saurabh Gothivrekar

    Hi
    I got answer to my query. YOu need to specify the bill type while defining sales document type. This bill type should not have account assignment mentioned in it.
    I changed the bill type, which does not have Account assignment procedure attached to it.
    It has solved my problem

  • Unable to capture field values in Master agreement  Line Items

    I am trying to get the field values from master agreement line items page. I have written the following code to get the line item details which is working fine to capture part number and quantity->
    agreementBean = doc.getRootParentIBean();
    lineItemCollection = agreementBean.getLineItems();
    collectionsize = lineItemCollection.size();
    for(i=0;i<collectionsize;i++){
         collectionbean = lineItemCollection.get(i);
         partNum = ""+collectionbean.getPartNumber() ;
         Quantity = ""+collectionbean.getQuantity();     
         throw doc.createApplicationException(null,partNum + " , " + Quantity );
    Now, my problem is that I am unable to capture the following field item values in the master agreement > line items page.
    1. Price Unit
    2. Unit Price
    3. Product Category
    4. Plant
    Please help me to find the values.
    Thankx in Advance.
    Su
    Edited by: subrataindra on Aug 10, 2010 11:11 AM

    This will return the name of the plant.
    .getExtensionField("PLANT").get().getDisplayName(session);
    Check if this returns the product category
    collectionbean.getExtensionField("ITEM_CAT").get().getDisplayName();
    This will Return the Price
    collectionbean.getExtensionField("PRICE").get().getPrice();
    (return type :BigDecimal)
    This will return the currency
    collectionbean.getExtensionField("PRICE").get().getCurrency;
    (Return type:String)
    Similarly to retrieve other fields for which there are no standard functions, use .getExtensionField("Field ID")
    Hope this helps
    Regards,
    Immanuel

  • Metodo de avaliação do item

    Bom dia,
    Um usuário entrou no cadastro do item  e mudou o método de avaliação para "Padrão" e deu entrada de uma qtd.
    Automaticamente a entrada ficou com o custo zero.
    Qdo vou fazer a saída ele informa q o item está sem custo, e não executa a saída.
    Para eu alterar o método de avaliação eu preciso estar com o estoque zerado, mas não consigo fazer a saída deste estoque.
    Alguém sabe me ajudar??
    Danielle

    Bom dia Danielle,
    Nesse caso você pode fazer uma reavaliação de estoque para esse item.
    Para fazer a reavaliação você deve ir em Estoque>Transações do Estoque>Reavaliação do Estoque.

  • Código de item da lista de serviço - Salvador

    Boa tarde amigos,
    Estamos no meio de um projeto de implementação de NFSe, e por incrivel que pareça estamos obtendo êxito, porém no meio desse caminho, há uma série de mapeamentos de campos referente aos respectiavos municipios dos quais, estão nos dando um pouco de dor de cabeça.
    Para que fiquei mais claro a minha duvida, neste momento estamos mapeando Salvador, e no nosso cliente existe uma tabela contendo sua lista de serviço. Essa tabela deve ser linkada com as das prefeituras que são emitidas as notas, neste caso Salvador. O campo que nos pede essa informação é o tsItemListaServico C Código de item da lista de serviço 5 do manual de integração.
    Gostaria de saber de vocês se alguém possui/jáviu ou sabe, se esta lista é especifica para Salvador ou é como a Nacional, aparentemente esta aqui - http://www.usp.br/gefim/manuais/CodigosISS.htm
    Bom estamos mapeando agora Salvador mas depois partiremos para Recife, RJ, BH e Curitiba, estou deixando aqui citado, porque caso haja mais dessas listas.
    Enfim acredito que seja somente isso, agradeço a atenção de vocês desde já!
    Vitor Grassato

    Fernando mais uma vez obrigado pela dica.
    Venho aqui informar que cadastrei no SAP os códigos que foram definidos junto ao fiscal da empresa quais melhor se encaixavam com as descritas nos manuais das prefeituras.
    No proprio site de cada prefeitura em seu campo Legislação há uma lista diferente para ser atribuida junto aos tipos de serviço de cada empresa.
    A que mais me chamou atenção foi RJ, que possui cerca de 6 digitos para o campo do manual da ABRASF que é de 5 digitos, lçogo é necessario fazer uma alteração no XML caso vc queira implementar no municipio de RJ.
    Do mais o Fernando ja exemplificou!
    Agradeço a todos a colaboração e boa semana!

  • Item cost not found for one or more items - Inventory Posting

    Good Day Mentors,
    My user has encountered an error during Inventory Posting and its "Item cost not found for one or more items".
    The specific Message ID from SAP's System Message Log is 10001287.
    I found a similar post which addresses this error here.
    But unfortunately it did not help me solve my user's problem.
    I already checked if the items had a defined "Item Cost" in the Item Master Data Inventory Tab, and they all have "Item Cost" defined.
    I'm not sure if this will help, but below is the Inventory Audit Report of one of the items that is throwing the "Item cost not found" error.
    I am not a business consultant neither am I literate in accounting, so thanks for the patience.
    SAP Version: 9.0 PL5
    Valuation Method: Moving Average
    Thanks in advance!
    Sean

    Hi Augusto and Raviraj,
    I've already verified in our production database the points you made:
    - Is the "Manage Item cost per warehouse" selected in the Basic Initialization Screen?
    YES
    - Is the "Manage Inventory by Warehouse" ticked/checked in the "Inventory Data" tab of the "Item Master Data" screen?
    YES
    * I apologize for not have been able to give this information upfront.
    Anyway, the database only has one warehouse at the moment.
    I've checked the items, like the item in the screen shot above, and it does have an item cost.
    Below is the screenshot of the sample item from my original post,
    Thanks in advance!
    Sean

Maybe you are looking for

  • Enhancement view does not appear in my list of views

    Hi , I have created an enhancement and now I used the wizard to add a new view to this application.The view created does not appear in my list of views but it appears in my Z BSP application. Please help! Regards Shilpi

  • Package Procedure cursor declaration

    Hi am facing this issues , I am too close the problem to figure. Pl help procedure addRox(p_reg_type_id in  number, p_offender_id in  number,p_sentence_end_date in  date,                             p_registration_date in  date,p_end_registration_dat

  • Junit Problem

    I have downloaded junit-4.3.1 n i'm trying to run the text editor but it is not working n this is the error that i'm getting java -cp junit-4.3.1.jar;. junit.textui.TestRunner junit.samples.AllTests Error: java.lang.ClassCastException: class junit.sa

  • Green frames when using AppleScript to export from QT

    Not sure if this is a QuickTime issue, h.264 issue, or an AppleScript issue, but i thought I'd start here since I know the least about AppleScript and have some clues to the problem. I'm creating an Automator workflow that requires a run AppleScript

  • High usage of physical memory

    hello, i  just bought my first mac few days ago, and i have a question about the physical memory usage, my mac is macbook pro 13' with retina display and 8 GB, and i think that for some reason my memory usage is significantly high then it should. whe