Hi, I need to restrict “Issue material” against Request quantity, Now system able to issue more than request quantity. I tried to configure BPM but not able to do it properly.
Check out this topic first and update your post with more information. There are a lot of very friendly helpful people who are willing to assist, but the information you provided isn’t enough to go on.
Trying to prevent users from issuing more material than the job quantity requires?
Not sure if any settings in the employee setup would solve this.
Worst case you could write a method directive to prevent this. Do you know how to use Tracing to view the business objects being called?
Hi,
I am trying “GetNewIssueReturnToJob” in issueReturn Service.
You want PerformMaterialMovement in IssueReturn.
I have a BPM for that, which uses a bunch of widgets for conditions and set variable and messages. So its not a single piece of code I could easily copy.
I am using IssueReturn.PerformMaterialMovement and it’s working good for us.
10 pieces of material are required and already issued so cannot issue 11th piece.
Use “execute custom code”
Below is the code you can put in the “execute custom code” node
var TIssueRet = (from IsuRet_Row in ds.IssueReturn where IsuRet_Row.RowMod=="U" || IsuRet_Row.RowMod=="A" select IsuRet_Row).FirstOrDefault();
if (TIssueRet != null)
{
var JbM = (from JM_Row in Db.JobMtl
where JM_Row.Company == Session.CompanyID && JM_Row.JobNum == TIssueRet.ToJobNum && JM_Row.MtlSeq == TIssueRet.ToJobSeq
select JM_Row).FirstOrDefault();
if (JbM != null)
{
if ((JbM.IssuedQty + TIssueRet.TranQty) > JbM.RequiredQty)
{
CallContext.Current.ExceptionManager.AddBLException("Put you error message here");
}
}
}
In my BPM, I also checked if the TranType was STK-MTL. If it was, then I knew the TranQty was being added (issued) to QtyPreviouslyIssued; otherwise, it was a return and so TranQty needed to be subtracted from the QtyPreviouslyIssued, and a warning generated that the material line would now be under-issued.
Yes, TranQty will be negative figure in case of return material. So condition will automatically subtract in my code and will allow transaction to process.
Thank You Great its working
Don’t forget to give who ever helped solve your problem a “Solved” on their post… Helps future people reading them and it’s nice to give Kudos.