Calling a method from ABL code not working - progress-4gl

When I create a new quote from Epicor I would like to add an item from the parts form automatically.
I am trying to do this using the following ABL code which runs when 'GetNewQuoteHed' is called:
run Update.
run GetNewQuoteDtl.
run ChangePartNumMaster("Rod Tube").
ttQuoteDtl.OrderQty = 5.
run Update.
I am getting the error:
Index -1 is either negative or above rows count.
This error occurs for each line in my ABL code.
What am I doing wrong?

That's not the proper format for a 4GL error message (nor is it at all familiar) so I'd say it is an Epicor application message. Epicor support is probably your best bet. However... Just guessing but it sounds like you might need to somehow initialize the thing that you're updating.

Agree with #Tom, but i would also say try and isolate the error and see where the error is raised as soon as you find the point the error is actually raised it is normally much easier to figure out exactly what is going wrong and how to solve it.
Working between a 0 based and a 1 based system there can be issues with the 1st or last entry depending on which way you moving. As the index for 0 based systems starts at 0 and ends at n-1 where 1 based systems start at 1 and end at n.

Related

I got error while simulate code written in PROMELA

I am using ispin and got an error stating spin: trails end after 10 steps and transition fail.
How can I prevent this error from happening?
You prevent the error from happening in one of two ways:
fix your Promela model - you have a bug in your Promela that needs to be removed
you've found an error in the system that you are modeling. Congratulations. You now report the error to the person in charge of the system that you are modeling.
In practice, when you have a trail indicating an error, you next perform
spin -p -t <name of the model>.pml
which will print out the step by step model executions that lead to the error. You scour them to confirm that they are correct - if so, see #2 above; if not correct, see #1.
I had the same problem and it is fixed after putting -DVECTORSZ :
in the advanced parameters settings window of verification tab.I have also increased the physical memory to 2048.

Editing Timeline from CCB file in cocos

I did some research into this and couldn't really find anything, so if this is a repetitive question I apologize. but anyway I have made a CCB file in CocosBuilder and I would like to start the timeline, for example, at one second instead of playing from the beginning. Is there a way to do this? Thanks for the help guys.
Edit: i would like this to be done in the code.
I am using 2.2.1 Cocos2DX version. I think there is no option to play it from given interval. But you can tweak yourself to get it done. (Not simple one)
You have to go to CCBAnimationManager and there you get "mNodeSequences".
It is dictionary and you get difference properties there like "rotation position etc..."
values there.
Internally AnimationManager reads this value (These values are specified in your CCB)
and puts in runAction queue.
So you have to break it as you want.(Ex. 5 min timeline you have. But you want to start
from 1 min then you have run first 1 min Actions without delay and for remaining you
have properly calculate tween intervals.
It's long procedure and needs calculation. If you don't know any other simpler way try this. If you know pls let us know (Post it).

EF6/Code First: Super slow during the 1st query, but only in Debug

I'm using EF6 rc1 with Code First strategy, without precompiled views and the problem is:
If I compile and run the exe application it takes like 15 seconds to run the first query (that's okay, since I'm still working on the pre-generated views). But if I use Visual Studio 2013 Preview to Debug the exact same application it takes almost 2 minutes BEFORE running the first query:
Dim Context = New MyEntities()
Dim Query = From I in Context.Itens '' <--- The debug takes 2 minutes in here
Dim Item = Query.FirstOrDefault()
Is there a way to remove this extra time? Am I doing something wrong here?
Ps.: The context itself is not complicated, its just full with 200+ tables.
Edit: Found out that the problem is that during debug time the EF appears to be generating the Views ignoring the pre-generated ones.
Using the source code from EF I discovered that the property:
IQueryProvider IQueryable.Provider
{
get
{
return _provider ?? (_provider = new DbQueryProvider(
GetInternalQueryWithCheck("IQueryable.Provider").InternalContext,
GetInternalQueryWithCheck("IQueryable.Provider").ObjectQueryProvider));
}
}
is where the time is being consumed. But this is strange since it only takes time in debug. Am I missing something here?
Edit: Found more info related to the question:
Using the Process Monitor (by Sysinternals) I found out that there its the 'desenv.exe' process that is consuming tons of time. To be more specific its consuming time with an 'Thread Exit'. It repeats the Thread Exit stack 36 times. I don't know if this info is very useful, but I saved a '.cvs' with the stack, here is his body: [...] (edit: removed the '.cvs' body, I can post it again by the comments if someone really think its going to be useful, but it was confusing and too big.)
Edit: Installed VS2013 Ultimate and Entity Framework 6 RTM. Installed the Entity Framework Power Tools Beta 4 and used it to generate the Views. Nothing changed... If I run the exe it takes 20 seconds, if I 'Start' debugging it takes 120 seconds.
Edit: Created a small project to simulate the error: http://sdrv.ms/16pH9Vm
Just run the project inside the environment and directly through the .exe, click the button and compare the loading time.
This is a known performance issue in Lazy (which EF is using) when the debugger is attached. We are currently working on a fix (the current approach we are looking at is removing the use of Lazy). We hope to ship this fix in a patch release soon. You can track progress of this issue on our CodePlex site - http://entityframework.codeplex.com/workitem/1778.
More details on the coming 6.0.2 patch release that will include a fix are here - http://blogs.msdn.com/b/adonet/archive/2013/10/31/ef6-performance-issues.aspx
I don't know if you have found the solution. But in my case, I had similar issue which wasted me close to a week after trying different suggestions. Finally, I found a solution by changing my web.config to optimizeCompilations="true" and performance improved dramatically from 15-30 seconds to about 2 seconds.

NSStream Event Timer - iPhone

All,
Is there a way to have a minimum time to keep a stream open before it closes? For some reason, my stream is closing prematurely which is causing errors elsewhere. I need to keep it open to make sure ALL of the data is gathered, and then it can run the other code.
Thanks,
James
In the case that someone falls upon this question later, I ended up creating nested if statements to pull it off.
Basically, there is one statement that checks if the end tag is not found (for my code, the END of the ENTIRE data that I should be receiving is </SessionData> - So, I did if([outputString rangeOfString:#"</SessionData>"].location == NSNotFound). I created a string called totalOutput that would have the outputString added onto the end of totalOutput until the </SessionData> is found.
If anyone ever needs help, just go ahead and comment on here and I can give more information.

Exception when running on simulator 3.2

I'm testing my app on simulator 3.1.3, it runs fine.
When it come to simulator 3.2, it crashes right from the beginning:
2010-06-24 16:35:29.208 MyTestApp[6991:207] *** Terminating app due to uncaught exception 'NSGenericException', reason: 'This coder requires that replaced objects be returned from initWithCoder:'
2010-06-24 16:35:29.213 MyTestApp[6991:207] Stack: (
46195275,
2520474889,
46194715,
46194554,
6387912,
6392266,
5568184,
6388086,
6386450,
6392266,
5564974,
5573454,
3555255,
3560368,
3586056,
3567777,
3599431,
52998524,
45735996,
45731912,
3559044,
3591649,
10824,
10678
)
As far as I know, I do not use the "initWithCoder" method (do not really know what this is though).
How can I know where the exception is thrown so I could have a better understanding of what is causing the problem?
ps: I have added an exception in Breakpoint: objc_exception_throw (with location libobjc.A.dylib, strangely I had to enter the location manually, I expected xcode to find it for me when I added objc_exception_throw). But still the same trace and no more information.
This page should provide some helpful info: Debugging Tips for Objective-C
Of particular interest is the console command info line *. Every one of those numbers listed by the exception log is an address on the stack. Those bottom ones in the 10,000 and below range are usually located in the app's main method, for example. The highest ranged addresses tend to represent the default libraries.
Using the command info line *10678 would likely return some info about a specific line in the main method, which doesn't help very much. Normally the trick is to find the highest address before the default libraries begin. I'm unsure how much this will help your problem in particular, seeing as there's a huge gap between the expected small addresses and the next highest up. In any case, start with the smallest address above the bottom two (3555255 from what I can see in the log you posted) and see if it returns a line from one of your own code files. If it does, check the one above it, and so on until you find the last address from your own code. Hope this helps.
I figured out the reason of this error. I had created an object of type NSDictionnary within IB and it seems it was not the correct way to do this. Instead I have programmatically created this same object in XCode and this works fine. Seems like it was some kind of persistent problem.