jcomboue
17th February 2010, 17:28
Hi,
I would like automate the receipts.
It's OK if i take the first purchase order in the session tdpur4131s000
But i would like select for exemple the 4th or 5th line.
And it's not OK
It don't generate the receipt.
Can you help me ?
Thanks
mark_h
17th February 2010, 22:13
I always recommend searching the forum for the session number - in this case this thread is found (http://www.baanboard.com/baanboard/showthread.php?t=27441&highlight=tdpur4131s000). It contains a link to code that does works. If you still have issues, please search other threads on the forum for tdpur4131s000. Then if that fails come back here and post your code.
I do not use that session - I create a receipt for all the lines at once. Then as they receive each line I go get the receipt number and modify it for a given line. You will find most of my code in the threads.
jcomboue
18th February 2010, 17:43
I can select the good purchase order
It shall do FIND when you have the good purchase order
My code for the session tdpur4131s000 :
HandleSubProc("add");
try
{
PutField(_Supplier, supplier);
ChangeView(out errorMessage);
retour = BrowseSet("first.set", out errorMessage);
while (!string.IsNullOrEmpty(errorMessage) && (retour == true))
{
GetField(_Order, 6, out returnValue);
if (string.Equals(order, returnValue)) // order is purchase order to find
{
GetField(_Position, 3, out returnValue);
if (string.Equals(position, returnValue)) { break;} // position is position of purchase order to find
GetField(_Item, 16, out returnValue);
if (string.Equals(item, returnValue)) { break;} // item is item of purchase order to find
}
retour = BrowseSet("next.set", out errorMessage);
}
if ((!string.IsNullOrEmpty(errorMessage.Trim())) || (retour == false))
{
return false;
}
else
{
Find();
PutField("tdpur045.mark", "1");
Update(out errorMessage);
Mark(out errorMessage);
ContinueProcess(out errorMessage);
return true;
}
}
finally
{
HandleSubProc("kill");
EndSession();
}
i hope to help some users