Option change in linked action

Discuss your general Proclaim related queries here.
Post Reply
kcolevol
Posts: 4
Joined: Fri Feb 17, 2017 11:40 pm
Has thanked: 4 times

Option change in linked action

Post by kcolevol » Tue Apr 11, 2017 10:33 am

Scenario;
Injury call back complete option is either YES, NO or TBA.

Some files have been Dead filled without the injury call back option being updated. To save undeading files, going to the page to change call back from TBA to YES, I want to create a button which is clickable whilst a case is dead (which I can do) and I used the PUT command wizard to PUT YES in the option but when I do it at the moment, the option just goes blank.

PUT( Y , {Injuries.Code} )

Don't work nor does it work if I use the description rather than code.

Thank you in advance

revellbikes
Posts: 444
Joined: Fri Jun 15, 2012 12:44 pm
Has thanked: 14 times
Been thanked: 45 times

Re: Option change in linked action

Post by revellbikes » Tue Apr 11, 2017 3:00 pm

Does the linked action work on a Live case?

steve
Posts: 399
Joined: Wed Nov 30, 2011 10:20 pm
Been thanked: 85 times

Re: Option change in linked action

Post by steve » Tue Apr 11, 2017 6:35 pm

I presume your option field is

Code(alpha)____Description(alpha)
Y________________YES
N________________NO
TBA ____________ TBA


is it just that your option code (first column) is an Alpha type, therefore you need to enclose with double quotes, namely:

Code: Select all

put ("Y", {Injuries.Code})

steve
Posts: 399
Joined: Wed Nov 30, 2011 10:20 pm
Been thanked: 85 times

Re: Option change in linked action

Post by steve » Tue Apr 11, 2017 6:37 pm

or could you do an autoroutine instead
SQL:
{file closed.Date} = ""
AND {Injuries.Code} <> "Y"

Linked action:
PUT ("Y", {Injuries.Code})

revellbikes
Posts: 444
Joined: Fri Jun 15, 2012 12:44 pm
Has thanked: 14 times
Been thanked: 45 times

Re: Option change in linked action

Post by revellbikes » Wed Apr 12, 2017 9:04 am

My money was on the lack of quotations like you say Steve.

I've had time to test this now and it doesn't work on live or dead cases, because of the lack of quotation marks.

kcolevol
Posts: 4
Joined: Fri Feb 17, 2017 11:40 pm
Has thanked: 4 times

Re: Option change in linked action

Post by kcolevol » Wed Apr 12, 2017 12:39 pm

Something so simple!! Yes it was the quotation marks. Why O why did the Put Command "wizard" not know this.

Thank you all so much.

revellbikes
Posts: 444
Joined: Fri Jun 15, 2012 12:44 pm
Has thanked: 14 times
Been thanked: 45 times

Re: Option change in linked action

Post by revellbikes » Wed Apr 12, 2017 1:20 pm

It's to do with data types.

Text requires quotation marks, numbers must not have quotation marks.

As PUT statements could contain text or numeric data, the syntax checker and Wizard do not force you to use quotation marks. It's up to the developer to know which to use in each scenario.

Jacqueline
Posts: 88
Joined: Fri May 25, 2012 2:40 pm
Has thanked: 15 times

Re: Option change in linked action

Post by Jacqueline » Tue Oct 08, 2019 7:21 pm

BUmping this up as I've just spent hours figuring out that my maths wasn't working because I was using quotations around a value - though strangely it appeared to work sometimes - can that be possible?

Does the same hold true in WFM TRUE/FALSE tests ie that numbers and values should never have quotation marks around them?

supascooper
Posts: 19
Joined: Tue Jan 21, 2014 12:05 pm
Been thanked: 5 times

Re: Option change in linked action

Post by supascooper » Thu Oct 10, 2019 4:11 pm

Odd - I've always found that it generally (see below) makes no difference if a number has quotation marks or not, though I do always stick to no quotation marks for them as a rule anyway.

A couple of things I have noticed/experienced that might be worth bearing in mind when querying option codes in maths:
  • If the option code has leading zeroes (e.g. 001), it must have quotation marks (I know, I know, that's bread and butter);
  • If an option field contains some codes with purely numbers (1, 2, 3) and some codes that contain text (A1, A2, A3) I have found that it requires quotation marks no matter what otherwise it throws up a maths error when being run. Bad naming convention I know, but hey, sometimes you inherit some **** from bad developers :roll:
Spent hours before I worked out point 2 when some of my maths wasn't working.

revellbikes
Posts: 444
Joined: Fri Jun 15, 2012 12:44 pm
Has thanked: 14 times
Been thanked: 45 times

Re: Option change in linked action

Post by revellbikes » Thu Oct 10, 2019 7:50 pm

It's all to do with data types.

You can set the data type of each option column in database maintenance. It defaults to alpha and from experience is rarely changed from this, but always worth checking.

So as a rule...

- if its data type is alpha use quotation marks
- if it's data type is number don't use quotation marks.

Same applies to database fields and to data types for variables.

Post Reply