Hi. I want to remove the Bill-to-contact field from the billing address on my invoice report. I see that this is set up as an array in formataddr. Is there anyway I can remove this field from the formataddr function?
I usually do something like this:
FOR ind := 1 TO ARRAYLEN(addressarray) DO
IF addressarray[ind] = “Bill-to Contact” THEN
addressarray[ind] := ‘’;
COMPRESSARRAY(addressarray);
Not very elegant, but it does the trick. [:)]
just delete the control from the section designer
Thank you for your help. However I get an error message that says “unknown variable ind”
I suppose that I need to replace “addressarray” from your script with the array I am using. In my case this would be Custaddr. Am I right?
I’d say it isn’t neccesary to accomplish this via code…just delete that [arr] [i] (check the report output to identify the [i]) and simply delete it from the section designer…
I don’t really understand what you mean I should delete, but now I figured it out using code… I had to alter the code a bit, so now it looks like this:
FOR i := 1 TO ARRAYLEN(CustAddr) DO
IF CustAddr[i] = “Bill-to Contact” THEN
CustAddr[i] := ‘’;
COMPRESSARRAY(CustAddr);
Thanks for all your help…
You cannot do it like that. As the “Bill to contact” is not always in the same AddrArray[] !
The general idea is to go through the array filled by the appointed function, find the element containing the Bill-to Contact value and clean it.
In my sample of code “addressarray” is the array name, your Custaddr, ind is an integer variable which you must define in the globals.
I hadn’t noticed this post. I see you managed to interpret my suggestion correctly. Good work! [Y]
Sorry for having been careless in my explanation.