Hi Steve,
I've checked the {Claim type.Code} field in DB maint and thee type is alpha, so I tried using the variable solution (below) and it saved the maths but I still get the "Non-Delegated Hire OR wrong file type" message on a file which should give me the other message.
Code: Select all
va = {SYS Haven Delegated.Code}
vb = {Claim type.Code}
IF va = "Yes" AND ( vb = "02" OR vb = "04" OR vb = "03" ) THEN
MESSAGE( "Delegated Hire & Right File Type" )
ELSE
MESSAGE( "Non-Delegated Hire OR wrong file type" )
END
I also tried with the .description as well but I got exactly the same result:
Code: Select all
va = {SYS Haven Delegated.Code}
vb = {Claim type.Description}
IF va = "Yes" AND ( vb = "Credit Hire" OR vb = "Credit Hire + Credit Repair" OR vb = "Credit Hire + Storage & Recovery" ) THEN
MESSAGE( "Delegated Hire & Right File Type" )
ELSE
MESSAGE( "Non-Delegated Hire OR wrong file type" )
END
So I started Messaging out both:
Code: Select all
#===== Test 01
va = {SYS Haven Delegated.Code}
vb = {Claim type.Code}
IF va = "Yes" AND ( vb = "02" OR vb = "04" OR vb = "03" ) THEN
MESSAGE( "Test 01" , NEWLINE , NEWLINE , "Delegated Hire & Right File Type" , NEWLINE , NEWLINE , "Claim Delegated: " , {SYS Haven Delegated.Code} , NEWLINE , NEWLINE , "Claim Type " , NEWLINE , {Claim type.Code} , " - " , {Claim type.Description} )
ELSE
IF va <> "Yes" THEN
MESSAGE( "Test 01" , NEWLINE , NEWLINE , "Non-Delegated" , NEWLINE , NEWLINE , "Claim Delegated: " , {SYS Haven Delegated.Code} , NEWLINE , NEWLINE , "Claim Type " , NEWLINE , {Claim type.Code} , " - " , {Claim type.Description} )
ELSEIF vb <> "02" AND vb <> "04" AND vb <> "03" THEN
MESSAGE( "Wrong file type" )
ELSE
MESSAGE( "Test 01" , NEWLINE , NEWLINE , "Non-Delegated Hire OR wrong file type" , NEWLINE , NEWLINE , "Claim Delegated: " , {SYS Haven Delegated.Code} , NEWLINE , NEWLINE , "Claim Type " , NEWLINE , {Claim type.Code} , " - " , {Claim type.Description} )
END
END
#===== Test 02
#==
va = {SYS Haven Delegated.Code}
vb = {Claim type.Description}
IF va = "Yes" AND ( vb = "Credit Hire" OR vb = "Credit Hire + Credit Repair" OR vb = "Credit Hire + Storage & Recovery" ) THEN
MESSAGE( "Test 02" , NEWLINE , NEWLINE , "Delegated Hire & Right File Type" , NEWLINE , NEWLINE , "Claim Delegated: " , {SYS Haven Delegated.Code} , NEWLINE , NEWLINE , "Claim Type " , NEWLINE , {Claim type.Code} , " - " , {Claim type.Description} )
ELSE
IF va <> "Yes" THEN
MESSAGE( "Test 02" , NEWLINE , NEWLINE , "Non-Delegated" , NEWLINE , NEWLINE , "Claim Delegated: " , {SYS Haven Delegated.Code} , NEWLINE , NEWLINE , "Claim Type " , NEWLINE , {Claim type.Code} , " - " , {Claim type.Description} )
ELSEIF vb <> "Credit Hire" AND vb <> "Credit Hire + Credit Repair" AND vb <> "Credit Hire + Storage & Recovery" THEN
MESSAGE( "Wrong file type" )
ELSE
MESSAGE( "Test 02" , NEWLINE , NEWLINE , "Non-Delegated Hire OR wrong file type" , NEWLINE , NEWLINE , "Claim Delegated: " , {SYS Haven Delegated.Code} , NEWLINE , NEWLINE , "Claim Type " , NEWLINE , {Claim type.Code} , " - " , {Claim type.Description} )
END
END
Both of these present the wrong message regardless of how the fields are populated.
The other solution you gave me works perfectly and I don't need to use this now but it would be useful to know for future use.
Thanks again
John