I have c# code that fires when a button is clicked. I can create the PO header just fine, but get an error when trying to add the POLine. Here is my code:
It wants me to put a qty in to “CalcOurQty”, but that field does not actually exist in the PODetail table. I am trying to put it in the “OrderQty” and “XOrderQty”, but no luck. I have seen that this is an issue on the DMT side as well, and the fix they have is to change “OrderQty” to “CalcOurQty”. Can’t seem to figure it out. Any ideas?
I have seen that it exists on the form, that is what drives me crazy. My theory is that it is referencing the qty from the release table. The issue is that this customization is not running from the PO form. We have a dashboard that lists all items that need to be Subcontracted for the week. The idea is that they can select the record, and click a button that generates a PO for the Subcontract operation.
Oh, now that’s interesting… I wonder if you added the CalcOurQty field to the DataView on your dashboard (just the DataView, not a UDF) and populated it if it would work… I’ve never ran into this problem before, so I’ve never tried it.
oooooh! Getting closer! How much of this is necessary? Also, it keeps giving me an error saying that the subcontract operation 0 is invalid, yet I am setting the operation to 60. here is the Code:
In that order. Your demands may be different, but for some BO’s you need to set the parameters first, so try setting the sequence number of 60 first, then do: adapterPO.ChangeDetailJobSeq(60);
Do a trace and you can see when submitting ChangeDetailJobSeq the fields that are required to be completed before running that method.
Sometimes they don’t that is why I said you must set the 60 first then run that BO, or after it possibly. Also try just setting your Sequence, and not using that BO, sometimes they are not needed.
That did work! I have a new set of errors to play with, but it is at least creating the line with the correct job, op, and asm. I didn’t think I could call out those fields like that since they technically don’t exist in the PODetail table.
Chris, yes it is valid, what Matthis1337 mentioned above worked for the job, asm, and op.
I am going to try to figure out this next set of issues, that way I don’t keep bothering y’all. I may be back monday with more questions haha. Thanks for the help so far!
Be sure to mark a response as a solution so others know what to do in future. Also remember you are just dealing with a dataset and a BO. They aren’t confined to rules of a table. You can build as many tables as you want in a dataset, and then the BO can submit it and built it accordingly. Not saying this happens everywhere, but for some yes.
Hi Aaron,
I know this is an old post, but I’m hopeful you’ll see this. In the traces I’ve run, I can see the methods you mentioned. I’m trying to use them in a custom code of a function.
This is my code, below. It doesn’t create new PO lines and it doesn’t throw any errors (when I test from REST call / swagger).
I have so many questions, but the main question is what am I doing wrong to create a PO line?
I’m also wondering how do these methods know which PO line is being created or modified?
ChangeDetailPartNum
ChangeDetailCalcOurQty
ChangeUnitPrice
I would so appreciate any help or guidance!
Thanks,