Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 257
  • Last Modified:

dblookup problem

I have a formula:
@If(CMref_pkg_id = "";CMpkg_desc;
@IsError(@DbLookup("";"";"CMxref";CMref_pkg_id ;"CMpkg_desc")); CMpkg_desc; @DbLookup("";"";"CMxref"; CMref_pkg_id ;"CMpkg_desc"))
This formula checks for a reference field that executes a lookup to extract thedescription froma previous document.  The problem is when the reference is used, the description is generating from the previous document, however I cannot add to the description field in this document.  I would like to be abble to use the previous description as the default but be able to add or change it.  When I do with this formula, it allows the added changes to this field, but then reverts back to the original desc value from te previous document.
????
:)
Paul
0
pratigan
Asked:
pratigan
1 Solution
 
HemanthaKumarCommented:
Try this

Eg:

@If(CMref_pkg_id = "";@Return(CMpkg_desc);"")
@if(@trim(CMpkg_desc) = ""; @Return(CMpkg_desc); "");
lookupval := @DbLookup("";"";"CMxref";CMref_pkg_id ;"CMpkg_desc");
@if( @IsError(lookupval); CMpkg_desc; lookupVal);
""

~Hemanth
0
 
scottrmaCommented:
Is this the formula for your CMpkg_desc field? If so, and if I have understood your requirement correctly, then try something like this:

temp := @DbLookup(""; ""; "CMxref"; CMref_pkg_id; "CMpkg_desc");

@If(CMpkg_desc != ""; CMpkg_desc; CMref_pkg_id = ""; CMpkg_desc; @IsError(temp); CMpkg_desc; temp)

Regards,

Scott
0
 
pratiganAuthor Commented:
Hello Hemanth,
I tested your logic and had an erro missing a ;, I added it  and no data auto generated.
Hello Scottrma,
Your logic worked as desired.  I appreciate both your efforst and rapid turnaround.  Your both valued resources.
Thank you both very much !!
Paul
<:-))
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now