cancel
Showing results for 
Search instead for 
Did you mean: 

Alternatives

Former Member
0 Kudos

Hi All,

I am currently setting up an 'Alternative' in my context. What i am wanting to do is be able to bind it to a field in the form so that IF a field in the database for customer contact is NULL to instead of writing the blank field, to input the default text 'Purchase Ledger Supervisor'.

Resulting in my Dunning Notice header reading either:

Attention: {Customer Contact}

OR if NULL:

Attention: Purchase Ledger Supervisor

Any ideas welcome!

Regards,

Ryan Harris

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Problem solved!

harman_shahi
Contributor
0 Kudos

Place some code as following in the FormReady Event of your Adobe form. Remember to set your Script Language to Javascript.

if (TextField1.rawValue == "NULL" || TextField1.rawValue == null)
{
TextField1.rawValue = "Purchase Ledger Supervisor'";
}

hope this helps,

harman

Edited by: Harman Shahi on Jul 8, 2008 4:40 PM

Former Member
0 Kudos

Thanks harman, ill give that a go!

Former Member
0 Kudos

I've set a form:ready event to the field on the form that pulls the customer contact with the script:

if (TextField1.rawValue == "NULL" || TextField1.rawValue == null){TextField1.rawValue = "Purchase Ledger Supervisor";}

I have set this to Javascript and tried the client, server and client server settings, but it is continuing to, in the case where the field is null, remaining blank instead of populating with the above text!

help!

thanks!

ryan

harman_shahi
Contributor
0 Kudos

Hi Ryan,

1)

first, Please try to test if your code is being triggered:

Place the following line before the IF statement:

xfa.host.messageBox("Value: " + TextField1.rawValue);

The above line should pop up a message with the wording 'null'. If it doesn't, that means either your codes is not being triggered OR your TextField1 is blank.

2) Remember that comparing strings is case sensitive. So, please make sure that the word you're checking for 'NULL' and not 'null'

hope this helps,

Harman

Former Member
0 Kudos

Hi,

can you confirm whether 'textfield1' in the script is a static value or whether it should be substituted with the name of my actual field?

thanks!

Former Member
0 Kudos

also, the only real way i can test if its working is to check the spool after a dunning run and see if the form looks how i want it to. I have tried the additional info in the script as suggested and get no pop up boxes anywhere during my process.

Former Member
0 Kudos

Hi Ryan,

You need to replace it with actual field name.

Regards,

Arafat

Former Member
0 Kudos

project management are keen to avoid using scripting of any kind in the form itself. so really this puts the above out of the question.

Instead the following has been setup....and i need help to get it working.

Data ZSABE in the context relates to a field F150D-ZSABE in the SAP backend and contains customer contact details.

My form requires a binding for this data to be displayed. However on the occasion when this field in the database contains nothing the text 'Purchase Ledger Supervisor' should appear.

A text in the context has been created for 'Purchase Ledger Supervisor' and the following 3 scenarios have been tested so far:

when the text is bound to the form, 'Purchase Ledger Supervisor' appears.

when ZSABE is bound to the form where the field F150D-ZSABE has data, the data appears on the form.

when ZSABE is bound to the form where the field F150D-ZSABE is null, no data appears.

I have thus far created an alternative, with 1 condition. The first operand in the condition is the field 'F150D-ZSABE'.

what i need to know is what to set the second operand and also the relational operator to, and which way round i should be placing my ZSABE and 'Purchase Ledger Supervisor' text in the TRUE/FALSE structure to get my desired result!

Ideas welcome!!

Thanks!