Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formula for parameter help

Status
Not open for further replies.

jlr123

Technical User
Feb 24, 2014
117
US
I have the following formula parameter however it is not giving me the correct results. The parameter should be UDF New_Sales_Rep if it is not blank else InvoiceHistoryHeader.Salesperson

if isnull ({AR_InvoiceHistoryHeader.UDF_NEW_SALES_REP}) or {AR_InvoiceHistoryHeader.UDF_NEW_SALES_REP}="" then
{AR_InvoiceHistoryHeader.SalespersonNo} else {AR_InvoiceHistoryHeader.UDF_NEW_SALES_REP}


Your help is much appreciated.
 
First off do you have "Default Values for Nulls" selected in the Formula Workshop? Second have you tried using the following code "if len({AR_InvoiceHistoryHeader.UDF_NEW_SALES_REP})= 0 then
{AR_InvoiceHistoryHeader.SalespersonNo} else {AR_InvoiceHistoryHeader.UDF_NEW_SALES_REP}"

 
I thought len is for totext? The data is text already. And your formula does not work. Thanks anyway.
 
My original formula was correct. I did not have the tables linked properly.

No need for any additional assistance on this issue.

Thanks!
 
I now need to add another condition to the formula.

My need is based on this statement -If there is nothing in the UDF field then Header field, and if there is nothing in the UDF field and the Header field does not equal to Customer field then Customer field.

Before adding the additional condition, my formula is working as the following: but I need the added condition.
if isnull ({AR_InvoiceHistoryHeader.UDF_NEW_SALES_REP}) or {AR_InvoiceHistoryHeader.UDF_NEW_SALES_REP}="" then
{AR_InvoiceHistoryHeader.SalespersonNo} else {AR_InvoiceHistoryHeader.UDF_NEW_SALES_REP}

Added condition to this statement would be the following:

If {AR_InvoiceHistoryHeader.SalespersonNo} <> {AR_Customer.SalespersonNo}
THEN {AR_Customer.SalespersonNo}

Thanks for your assistance.
 
I was trying to make this more complicated that necessary.

Don't really need the AR_HistoryHeader.SalespersonNo field.

No additional assistance needed.
Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top