Good morning.
I have a function in VB to edit purchase documents.
Everything goes well but if you call %code% the header variables are changed, but when calling %code% always gives an error:
8169: Conversion failed when converting from a character string to
uniqueidentifier.
It gives the idea that the doccompra gets lost after %code% .
Thank you for your help
%pre%
______ azszpr332118 ___
When calling the %code% method with the second parameter equal to 5, it means that we will change the data related to %code% , %code% , %code% , etc. When you change data related to %code% , the %code% method will change the %code% by suggesting the next number in the series.
To work around the problem, you can re-assign the %code% after calling the %code% method.
Code:
%pre%
Another solution would be to call the %code% method with the second parameter equal to 2, so it only changes the entity's related data.
Code:
%pre%
______ azszpr332130 ___
John
In the code you are running there are some improvements you can make, for example, as the property %code% is controlled by PRIMAVERA you do not have to do anything about it. The type of entity also does not have to be indicating, and by utlimo as Flavio Jardim said is to use parameter 2 because in reality it is only changing the entity and only this is that it has impact on other properties of the document. >
%pre%
More information about the codes of this method.
%pre%
___