We're working on creating an integration using our application and Sage 50 Canadian Edition.
Currently working on creating Purchase Journal Entries - we want to allocate the line-item on the journal to a project. In the example, it doesn't show how to do it exactly, but reviewing the Example for a Sales Journal - I see where he is allocating entries to a project as shown below:
// Sales Invoice Example
SalesJournal salJourn = SDKInstanceManager.Instance.OpenSalesJournal();
salJourn.SetDescription("Computer Repair - No Warranty", 1);
salJourn.SetDescription("Item #2", 2);
// allocate projects
ProjectAllocation projAlloc = salJourn.AllocateLine(2);
projAlloc.SetProject("Sage Project", 1);
// can't allocate by percent, allocation by amount
< removed code >
When I use this same logic - the initial call to "ProjectAllocation projAlloc = salJourn.AllocateLine(linenum);" - throws a "SimplySDK.SimplyNoAccessException" exception. Thinking this function may only work after the invoice is posted - I tried doing the line allocations AFTER the posting, the same error is displayed.
Has anyone had any success doing project allocations on Purchase Journals?
It looks like we will be allocating 100% of the costs of the line to a single project - BUT not 100% of the invoice.
The call to purJourn.SelectProject(projectname) appears to work for the whole invoice - but we need to get it at the line level.
I'm sure its something small on my end - anyone have any suggestions?