As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
-****************************************************************************** -* Extract User Profile -****************************************************************************** -INCLUDE FEIPROF1 -IF &FOCERRNUM NE 0 GOTO ACTIVITY_ERR;
-SET &RGN2 = '&RGN1.EVAL'; -SET &WHERERGN = IF &RGN2 EQ 'ALL' THEN ' ' ELSE 'WHERE REGION EQ ''&RGN2.EVAL'';';
-SET &WHEREPOS=IF &USERTYPE EQ 'CSDS' THEN 'WHERE CRBY.POSITION EQ ''Contact / Dealer Support'' OR POSITION EQ ''Contact / Dealer Support 2'';' -ELSE IF &USERTYPE EQ 'RSM' THEN 'WHERE OWN.POSITION EQ ''RSM'';' -ELSE IF &USERTYPE EQ 'ISR' THEN 'WHERE CRBY.POSITION EQ ''ISR'';' -ELSE IF &USERTYPE EQ 'SC' THEN 'WHERE CRBY.POSITION EQ ''Coordinator'';' -ELSE 'WHERE POSITION NOT CONTAINS ''Temp'';';
-****************************************************************************** -* Setup Output Format Parameters -****************************************************************************** -SET &FORMATOUT=DECODE &FORMAT( -'PDF' 'ON TABLE SET ONLINE-FMT PDF' -'EXCEL' 'ON TABLE SET ONLINE-FMT EXL2K' -ELSE 'ON TABLE HOLD AS HTMLOUT FORMAT HTMTABLE');
-SET &RSMPRNT = IF &SELGB EQ 'RESULT' THEN 'NOPRINT' ELSE ''; -SET &RSMPRNT1 = IF &SELGB EQ 'CREATEDBYNAME' THEN 'NOPRINT' ELSE ''; -SET &RSMPRNT2 = IF &SELGB EQ 'REGION' THEN 'NOPRINT' ELSE ''; -SET &RSMPRNT5 = IF &DATE1 EQ 'CDATE' THEN '' ELSE 'NOPRINT'; -SET &BYDATE = IF &RSMPRNT5 EQ 'NOPRINT' THEN 'DUEDATE' ELSE 'DATECREATED';
-****************************************************************************** -* Setup Date Parameters -****************************************************************************** -SET &SEL_DATE = IF &DATE1 EQ 'CDATE' THEN 'CREATEDON' ELSE IF &DATE1 EQ 'DDATE' THEN 'SCHEDULEDSTART'; -SET &SEL_DATE1 = IF &DATE1 EQ 'CDATE' THEN 'CREATEDON' ELSE IF &DATE1 EQ 'DDATE' THEN 'ACTUALSTART'; -SET &SEL_DATE2 = IF &DATE1 EQ 'CDATE' THEN 'CREATEDON' ELSE IF &DATE1 EQ 'DDATE' THEN 'SCHEDULEDEND'; -SET &SEL_DATE3 = IF &DATE1 EQ 'CDATE' THEN 'CREATE_DT_CORRECTED' ELSE IF &DATE1 EQ 'DDATE' THEN 'START_DT_CORRECTED';
TABLE FILE MSEXT_CONTACTVIEW PRINT FULLNAME NOPRINT -*To take care of the end date - When user pics From & To COMPUTE ERNG_DT_CORRECTED/HYYMDS = HADD(DT(&ERNG.EVAL 23:59:59.999), 'HOUR', -(&CORR_HOURS), 8, 'HYYMDS'); -*To take care of the end date - When user picks as at COMPUTE SRNG_DT_CORRECTED/HYYMDS = HADD(DT(&SRNG.EVAL 23:59:59.999), 'HOUR', -(&CORR_HOURS), 8, 'HYYMDS'); WHERE READLIMIT EQ 1 ON TABLE SET HOLDLIST PRINTONLY ON TABLE SAVE AS TIMETABLE1 END -RUN
-SET &WHEREDATE1 = IF &ONE_DAY EQ '' THEN -'WHERE CREATEDON FROM DT(&SRNG.EVAL 00:00:00.000) TO DT(&ERNG1.EVAL 23:59:59.999);' -ELSE 'WHERE CREATEDON FROM DT(&SRNG.EVAL 00:00:00.000) TO DT(&SRNG1.EVAL 23:59:59.999);';
-****************************************************************************** -* Setup Region Selection Based On User's Profile -****************************************************************************** -SET &SEL_RGN = document.forms[0].RGN[document.forms[0].RGN.selectedIndex].value;
-****************************************************************************** -* Setup Heading -****************************************************************************** -SET &HEADING1 = IF &USERTYPE EQ 'ISR' THEN 'ISR Phone Call Subject Summary' - ELSE IF &USERTYPE EQ 'RSM' THEN 'RSM Phone Call Subject Summary' - ELSE IF &USERTYPE EQ 'CSDS' THEN 'CSDS Phone Call Subject Summary' - ELSE IF &USERTYPE EQ 'SC' THEN 'Sales Coordinator Phone Call Subject Summary' - ELSE 'All Users Phone Call Subject Summaries';
-SET &HEADING = IF &ONE_DAY EQ 'YES' OR &DATE_FROM EQ &DATE_TO -THEN &HEADING1 | ' as at: &DATE_FROM.EVAL' -ELSE &HEADING1 | ' from &DATE_FROM.EVAL to &DATE_TO.EVAL';
-****************************************************************************** -* Setup Report Footing -****************************************************************************** -SET &FOOTING = - 'Report ID: nfphsubr' || - ( ' / Report Date: ' | &RUN_DATE ) || - ( ' / Report Time: ' | &RUN_TIME ) || - ( ' / Page: ' || ' TABLE FILE MSCRM_STRINGMAP PRINT ATTRIBUTENAME ATTRIBUTEVALUE VALUE COMPUTE SUBJECT/A255 = IF VALUE EQ '-Pick a Subject-' THEN 'MISSINGSUBJECT' ELSE IF VALUE EQ 'ACB' THEN 'ACB' ELSE IF VALUE EQ 'Account Inquiry' THEN 'ACCOUNTINQUIRY' ELSE IF VALUE EQ 'Dealer Rep kit Request' THEN 'DEALERREPKITREQUEST' ELSE IF VALUE EQ 'DIP (Outgoing)' THEN 'DIPOUTGOING' ELSE IF VALUE EQ 'DSC Full Report' THEN 'DSCFULLREPORT' ELSE IF VALUE EQ 'DSC Inquiry' THEN 'DSCINQUIRY' ELSE IF VALUE EQ 'DSC Refund' THEN 'DSCREFUND' ELSE IF VALUE EQ 'Full Free Unit Report' THEN 'FULLFREEUNITREPORT' ELSE IF VALUE EQ 'Full Trial Balance Report' THEN 'FULLTRIALBALANCEREPORT' ELSE IF VALUE EQ 'Income Trusts' THEN 'INCOMETRUSTS' ELSE IF VALUE EQ 'Marketing Fulfillment' THEN 'MARKETINGFULFILLMENT' ELSE IF VALUE EQ 'Other' THEN 'OTHER' ELSE IF VALUE CONTAINS 'PPN' THEN 'PPNSLINKNOTES' ELSE IF VALUE EQ 'Product Inquiry' THEN 'PRODUCTINQUIRY' ELSE IF VALUE EQ 'Statement Request' THEN 'STATEMENTREQUEST' ELSE IF VALUE EQ 'Tax Inquiry' THEN 'TAXINQUIRY' ELSE IF VALUE EQ 'Flow Through' THEN 'FLOWTHROUGH' ELSE IF VALUE EQ 'Market Conditions' THEN 'MARKETCONDITIONS' ELSE IF VALUE EQ 'Book Meeting' THEN 'BOOKMEETING' ELSE IF VALUE EQ 'Follow-up' THEN 'FOLLOWUP' ELSE IF VALUE EQ 'Fund Campaign' THEN 'FUNDCAMPAIGN' ELSE IF VALUE EQ 'Introduction' THEN 'INTRODUCTION' ELSE IF VALUE EQ 'Information Change' THEN 'INFORMATIONCHANGE' ELSE IF VALUE EQ 'Marketing' THEN 'MARKETING' ELSE IF VALUE EQ 'Problem Resolution' THEN 'PROBLEMRESOLUTION' ELSE IF VALUE EQ 'RSM Project' THEN 'RSMPROJECT' ELSE IF VALUE EQ 'Rep Complaint' THEN 'REPCOMPLAINT' ELSE IF VALUE EQ 'Rep Request/Change Meeting' THEN 'REPREQUESTCHANGEMEETING' ELSE IF VALUE EQ 'Rep Inquiry' THEN 'REPINQUIRY' ELSE IF VALUE EQ 'Thank You' THEN 'THANKYOU' ELSE IF VALUE EQ 'Rep Request Promos' THEN 'REPREQUESTPROMOS' ELSE IF VALUE EQ 'Income Trusts' THEN 'INCOMETRUSTS' ELSE IF VALUE EQ 'Prospectus' THEN 'PROSPECTUS' ELSE IF VALUE EQ 'Due Diligence' THEN 'DUEDILIGENCE' ELSE VALUE; WHERE OBJECTTYPECODE = 4210 AND ATTRIBUTENAME EQ 'cf_subjectclientservices' OR ATTRIBUTENAME EQ 'cf_subjectsales' BY ATTRIBUTEVALUE NOPRINT ON TABLE HOLD AS SUBJECTS END
JOIN VALUE IN SUBJECTS TO ALL SUBJECT IN MSCRM_PHONECALL AS J1
TABLE FILE SUBJECTS SUM CNT.SUBJECT AS 'Subjects' MAX.CREATEDBYNAME OWNERID CREATEDBY REGARDINGOBJECTID REGARDINGOBJECTTYPECODE &WHEREDATE1 BY CREATEDBY BY SUBJECT ON TABLE HOLD AS COUNTSUB END
TABLE FILE MSEXT_SYSTEMUSERVIEW PRINT SYSTEMUSERID POSITION BY SYSTEMUSERID NOPRINT ON TABLE HOLD AS ISRID END
-****************************************************************************** -* Extract User Profile -****************************************************************************** -INCLUDE FEIPROF1 -IF &FOCERRNUM NE 0 GOTO ACTIVITY_ERR;
-****************************************************************************** -* Generate Report -****************************************************************************** SET NODATA = 0 -*JOIN CREATEDBY IN COUNTSUB TO SYSTEMUSERID IN ISRID AS J2 -*JOIN CREATEDBY IN COUNTSUB TO ALL SYSTEMUSERID IN MSEXT_CRMTEAMCOVERAGEVIEW AS J3 JOIN CREATEDBY IN COUNTSUB TO SYSTEMUSERID IN CRMSYSTEMUSER TAG CRBY AS J4 JOIN OWNERID IN COUNTSUB TO SYSTEMUSERID IN CRMSYSTEMUSER TAG OWN AS J5 JOIN REGARDINGOBJECTID IN COUNTSUB TO CONTACTID IN MSEXT_CONTACTVIEW TAG CON AS J6
TABLE FILE COUNTSUB PRINT * COMPUTE REGION1/A300=IF REGARDINGOBJECTTYPECODE EQ 2 THEN CON.CF_REGIONNAME ELSE OWN.BUSINESSUNITIDNAME; AS 'REGION' REGARDINGOBJECTTYPECODE &WHEREPOS ON TABLE HOLD AS CHECK END
TABLE FILE CHECK PRINT CREATEDBYNAME REGION &WHERERGN ON TABLE HOLD AS CHECK2 END
-IF &FOCERRNUM NE 0 GOTO ACTIVITY_ERR; -IF &LINES = 0 THEN GOTO NOREPORT ELSE GOTO PRINTOUT; -NOREPORT
TABLE FILE MSEXT_CONTACTVIEW PRINT FULLNAME NOPRINT WHERE RECORDLIMIT EQ 1
-GOTO HSTYLE -PRINTOUT
SET NODATA = 0 TABLE FILE COUNTSUB SUM MAX.SUBJECTS &RSMPRNT.EVAL AS '' COMPUTE REGION1/A300=IF REGARDINGOBJECTTYPECODE EQ 2 THEN CON.CF_REGIONNAME ELSE OWN.BUSINESSUNITIDNAME; NOPRINT ACROSS SUBJECT AS '' BY REGION BY CREATEDBYNAME &RSMPRNT1.EVAL &WHEREPOS -*&WHERERGN WHERE SYSTEMUSERID NE ' ' AND SUBJECTS NE 0; ON TABLE HOLD AS SUBACROSS END
CHECK FILE SUBACROSS HOLD -RUN
FILEDEF HOLD1 DISK HOLD1.FEX -RUN
TABLE FILE HOLD PRINT FIELDNAME COMPUTE ASNAME/A100 = IF FIELDNAME EQ 'CREATEDBYNAME' THEN 'AS ''Created By''' ELSE IF FIELDNAME EQ 'MISSINGSUBJECT' THEN 'AS ''Missing Subject''' ELSE IF FIELDNAME EQ 'ACB' THEN 'AS ''ACB''' ELSE IF FIELDNAME EQ 'ACCOUNTINQUIRY' THEN 'AS ''Account Inquiry''' ELSE IF FIELDNAME EQ 'DEALERREPKITREQUEST' THEN 'AS ''Dealer Rep Kit Request''' ELSE IF FIELDNAME EQ 'DIPOUTGOING' THEN 'AS ''DIP (Outgoing)''' ELSE IF FIELDNAME EQ 'DSCFULLREPORT' THEN 'AS ''DSC Full Report''' ELSE IF FIELDNAME EQ 'DSCINQUIRY' THEN 'AS ''DSC Inquiry''' ELSE IF FIELDNAME EQ 'DSCREFUND' THEN 'AS ''DSC Refund''' ELSE IF FIELDNAME EQ 'FULLFREEUNITREPORT' THEN 'AS ''Full Free Unit Report''' ELSE IF FIELDNAME EQ 'FULLTRIALBALANCEREPORT' THEN 'AS ''Full Trial Balance Report''' ELSE IF FIELDNAME EQ 'INCOMETRUSTS' THEN 'AS ''Income Trusts''' ELSE IF FIELDNAME EQ 'MARKETINGFULFILLMENT' THEN 'AS ''Marketing Fulfillment''' ELSE IF FIELDNAME EQ 'OTHER' THEN 'AS ''Other''' ELSE IF FIELDNAME EQ 'PPNSLINKNOTES' THEN 'AS ''PPNs (Link Notes)''' ELSE IF FIELDNAME EQ 'PRODUCTINQUIRY' THEN 'AS ''Product Inquiry''' ELSE IF FIELDNAME EQ 'STATEMENTREQUEST' THEN 'AS ''Statement Request''' ELSE IF FIELDNAME EQ 'TAXINQUIRY' THEN 'AS ''Tax Inquiry''' ELSE IF FIELDNAME EQ 'FLOWTHROUGH' THEN 'AS ''Flow Through''' ELSE IF FIELDNAME EQ 'MARKETCONDITIONS' THEN 'AS ''Market Conditions''' ELSE IF FIELDNAME EQ 'BOOKMEETING' THEN 'AS ''Book Meeting''' ELSE IF FIELDNAME EQ 'FOLLOWUP' THEN 'AS ''Follow-up''' ELSE IF FIELDNAME EQ 'FUNDCAMPAIGN' THEN 'AS ''Fund Campaign''' ELSE IF FIELDNAME EQ 'INTRODUCTION' THEN 'AS ''Introduction''' ELSE IF FIELDNAME EQ 'INFORMATIONCHANGE' THEN 'AS ''Information Change''' ELSE IF FIELDNAME EQ 'MARKETING' THEN 'AS ''Marketing''' ELSE IF FIELDNAME EQ 'PROBLEMRESOLUTION' THEN 'AS ''Problem Resolution''' ELSE IF FIELDNAME EQ 'RSMPROJECT' THEN 'AS ''RSM Project''' ELSE IF FIELDNAME EQ 'REPCOMPLAINT' THEN 'AS ''Rep Complaint''' ELSE IF FIELDNAME EQ 'REPREQUESTCHANGEMEETING' THEN 'AS ''Rep Request/Change Meeting''' ELSE IF FIELDNAME EQ 'REPINQUIRY' THEN 'AS ''Rep Inquiry''' ELSE IF FIELDNAME EQ 'THANKYOU' THEN 'AS ''Thank You''' ELSE IF FIELDNAME EQ 'REPREQUESTPROMOS' THEN 'AS ''Rep Request Promos''' ELSE IF FIELDNAME EQ 'INCOMETRUSTS' THEN 'AS ''Income Trusts''' ELSE IF FIELDNAME EQ 'PROSPECTUS' THEN 'AS ''Prospectus''' ELSE IF FIELDNAME EQ 'DUEDILIGENCE' THEN 'AS ''Due Diligence''' ELSE 'AS ' | FIELDNAME; WHERE FIELDNAME NE 'REGION1' ON TABLE HOLD AS HOLD1 END -RUN
-IF &USERTYPE EQ 'CSDS' THEN GOTO SUBCS -ELSE IF &USERTYPE IN ('RSM', 'ISR', 'SC') THEN GOTO SUBSALES -ELSE GOTO SUBALL;
-SUBCS TABLE FILE SUBACROSS PRINT -MRNOEDIT -INCLUDE HOLD1 BY REGION NOPRINT ON TABLE ROW-TOTAL/D15 AS 'Total' ON REGION1 SUBHEAD "&WHERERGN
Stick a -RUN after every END statement so that the WebFOCUS code gets put in the stack (don't ask!) before the Dialogue Manager command gets executed. This way, the TABLE FILE commands will actually get executed before the -GOTO does. I don't know if this will solve the problem, but this what I always do.
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
will not act as you expect, as the &FOCERRNUM will not be set at that point, it will be the value from a previous point. To get it right add a -RUN after the END statement (a la Francis).
Whilst DM statements are perfectly OK within a table request, your code at the -GOTO HSTYLE (as Prarie pointed out) is syntactically incorrect (should have a semi colon) and there is no END statement finishing off the prior TABLE request before starting the next one -
TABLE FILE MSEXT_CONTACTVIEW
PRINT
FULLNAME NOPRINT
WHERE RECORDLIMIT EQ 1
-GOTO HSTYLE
-PRINTOUT
SET NODATA = 0
TABLE FILE COUNTSUB
SUM
MAX.SUBJECTS &RSMPRNT.EVAL AS ''
The code at BY CREATEDBYNAME &RSMPRNT1.EVAL is OK as it is although if &RSMPRNT1 is not evaluated as NOPRINT, WF will have a problem with the code BY CREATEDBYNAME CREATEDBYNAME.
I would also be inclined to change the COMPUTE ASNAME/A100 to be a decode and also change the A100 to a value that actually reflects the real length of the string that you are going to populate it with. I would also do the same to SUBJECT further up but you would need to add a CONTAINS to that as well.
That's after a quick run through so try it again after sorting out some basic syntax rule errors and the &FOCERRNUM processing error. Then let us know what you get.
A couple of methods of testing for errors in a program like this is to add
-RUN -? & -EXIT
after dialogue manager sections to check the variables are being populated as you require,
-RUN -* If it is a basic hold file ?F holdfile_name -* If it is a FOCUS type file ? FILE holdfile_name -* to check the actually masterfile description produced !TYPE holdfile_name.MAS -EXIT
after sections of code where you are populating a temporary table to ensure that the field names and lengths are as you expect.
As you check each section of code, remove the -EXIT and then progress onto the next section until you hit the area that is really causing you the problem
T
In FOCUS since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2
WebFOCUS App Studio 8.2.06 standalone on Windows 10
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004
Thanks for your help...I've made some changes in terms of syntax. I'm new to focus so I'm not too sure about the syntax. However, my problem hasn't been resolved yet. I'm doing the testing methods to see what's wrong.
Ok all my errors are fixed. Now my problem is my program doesn't show the region. It works fine except it doesn't show the region and my problem is in this part of the program.
-SET NODATA = 0 TABLE FILE COUNTSUB SUM MAX.SUBJECTS &RSMPRNT.EVAL AS '' COMPUTE REGION1/A300=IF REGARDINGOBJECTTYPECODE EQ 2 THEN CON.CF_REGIONNAME ELSE OWN.BUSINESSUNITIDNAME; NOPRINT ACROSS SUBJECT AS '' BY REGION1 BY CREATEDBYNAME &RSMPRNT1.EVAL -&WHEREPOS -&WHERERGN WHERE SUBJECTS NE 0; ON TABLE HOLD AS SUBACROSS END -RUN
But here's all of the program that I've fixed.
TABLE FILE MSCRM_STRINGMAP PRINT ATTRIBUTENAME ATTRIBUTEVALUE VALUE COMPUTE SUBJECT/A255 = IF VALUE EQ '-Pick a Subject-' THEN 'MISSINGSUBJECT' ELSE IF VALUE EQ 'ACB' THEN 'ACB' ELSE IF VALUE EQ 'Account Inquiry' THEN 'ACCOUNTINQUIRY' ELSE IF VALUE EQ 'Dealer Rep kit Request' THEN 'DEALERREPKITREQUEST' ELSE IF VALUE EQ 'DIP (Outgoing)' THEN 'DIPOUTGOING' ELSE IF VALUE EQ 'DSC Full Report' THEN 'DSCFULLREPORT' ELSE IF VALUE EQ 'DSC Inquiry' THEN 'DSCINQUIRY' ELSE IF VALUE EQ 'DSC Refund' THEN 'DSCREFUND' ELSE IF VALUE EQ 'Full Free Unit Report' THEN 'FULLFREEUNITREPORT' ELSE IF VALUE EQ 'Full Trial Balance Report' THEN 'FULLTRIALBALANCEREPORT' ELSE IF VALUE EQ 'Income Trusts' THEN 'INCOMETRUSTS' ELSE IF VALUE EQ 'Marketing Fulfillment' THEN 'MARKETINGFULFILLMENT' ELSE IF VALUE EQ 'Other' THEN 'OTHER' ELSE IF VALUE CONTAINS 'PPN' THEN 'PPNSLINKNOTES' ELSE IF VALUE EQ 'Product Inquiry' THEN 'PRODUCTINQUIRY' ELSE IF VALUE EQ 'Statement Request' THEN 'STATEMENTREQUEST' ELSE IF VALUE EQ 'Tax Inquiry' THEN 'TAXINQUIRY' ELSE IF VALUE EQ 'Flow Through' THEN 'FLOWTHROUGH' ELSE IF VALUE EQ 'Market Conditions' THEN 'MARKETCONDITIONS' ELSE IF VALUE EQ 'Book Meeting' THEN 'BOOKMEETING' ELSE IF VALUE EQ 'Follow-up' THEN 'FOLLOWUP' ELSE IF VALUE EQ 'Fund Campaign' THEN 'FUNDCAMPAIGN' ELSE IF VALUE EQ 'Introduction' THEN 'INTRODUCTION' ELSE IF VALUE EQ 'Information Change' THEN 'INFORMATIONCHANGE' ELSE IF VALUE EQ 'Marketing' THEN 'MARKETING' ELSE IF VALUE EQ 'Problem Resolution' THEN 'PROBLEMRESOLUTION' ELSE IF VALUE EQ 'RSM Project' THEN 'RSMPROJECT' ELSE IF VALUE EQ 'Rep Complaint' THEN 'REPCOMPLAINT' ELSE IF VALUE EQ 'Rep Request/Change Meeting' THEN 'REPREQUESTCHANGEMEETING' ELSE IF VALUE EQ 'Rep Inquiry' THEN 'REPINQUIRY' ELSE IF VALUE EQ 'Thank You' THEN 'THANKYOU' ELSE IF VALUE EQ 'Rep Request Promos' THEN 'REPREQUESTPROMOS' ELSE IF VALUE EQ 'Income Trusts' THEN 'INCOMETRUSTS' ELSE IF VALUE EQ 'Prospectus' THEN 'PROSPECTUS' ELSE IF VALUE EQ 'Due Diligence' THEN 'DUEDILIGENCE' ELSE VALUE; WHERE OBJECTTYPECODE = 4210 AND ATTRIBUTENAME EQ 'cf_subjectclientservices' OR ATTRIBUTENAME EQ 'cf_subjectsales' BY ATTRIBUTEVALUE NOPRINT ON TABLE HOLD AS SUBJECTS END -RUN
JOIN VALUE IN SUBJECTS TO ALL SUBJECT IN MSCRM_PHONECALL AS J1
TABLE FILE SUBJECTS SUM CNT.SUBJECT AS 'Subjects' MAX.CREATEDBYNAME OWNERID CREATEDBY REGARDINGOBJECTID REGARDINGOBJECTTYPECODE &WHEREDATE1 BY CREATEDBY BY SUBJECT ON TABLE HOLD AS COUNTSUB END -RUN
TABLE FILE MSEXT_SYSTEMUSERVIEW PRINT SYSTEMUSERID POSITION BY SYSTEMUSERID NOPRINT ON TABLE HOLD AS ISRID END -RUN
-****************************************************************************** -* Extract User Profile -****************************************************************************** -INCLUDE FEIPROF1 -IF &FOCERRNUM NE 0 GOTO ACTIVITY_ERR;
-****************************************************************************** -* Generate Report -****************************************************************************** SET NODATA = 0 -*JOIN CREATEDBY IN COUNTSUB TO SYSTEMUSERID IN ISRID AS J2 -*JOIN CREATEDBY IN COUNTSUB TO ALL SYSTEMUSERID IN MSEXT_CRMTEAMCOVERAGEVIEW AS J3 JOIN CREATEDBY IN COUNTSUB TO SYSTEMUSERID IN CRMSYSTEMUSER TAG CRBY AS J4 JOIN OWNERID IN COUNTSUB TO SYSTEMUSERID IN CRMSYSTEMUSER TAG OWN AS J5 JOIN REGARDINGOBJECTID IN COUNTSUB TO CONTACTID IN MSEXT_CONTACTVIEW TAG CON AS J6
TABLE FILE COUNTSUB PRINT * COMPUTE REGION1/A300=IF REGARDINGOBJECTTYPECODE EQ 2 THEN CON.CF_REGIONNAME ELSE OWN.BUSINESSUNITIDNAME; AS 'REGION' REGARDINGOBJECTTYPECODE &WHEREPOS ON TABLE HOLD AS CHECK END -RUN
TABLE FILE CHECK PRINT CREATEDBYNAME REGION -*&WHERERGN ON TABLE HOLD AS CHECK2 END -RUN
-IF &FOCERRNUM NE 0 GOTO ACTIVITY_ERR; -IF &LINES = 0 THEN GOTO NOREPORT ELSE GOTO PRINTOUT; -NOREPORT
TABLE FILE MSEXT_CONTACTVIEW PRINT FULLNAME NOPRINT WHERE RECORDLIMIT EQ 1
-GOTO HSTYLE -PRINTOUT
-SET NODATA = 0 TABLE FILE COUNTSUB SUM MAX.SUBJECTS &RSMPRNT.EVAL AS '' COMPUTE REGION1/A300=IF REGARDINGOBJECTTYPECODE EQ 2 THEN CON.CF_REGIONNAME ELSE OWN.BUSINESSUNITIDNAME; NOPRINT ACROSS SUBJECT AS '' BY REGION1 BY CREATEDBYNAME &RSMPRNT1.EVAL -&WHEREPOS -&WHERERGN WHERE SUBJECTS NE 0; ON TABLE HOLD AS SUBACROSS END -RUN
CHECK FILE SUBACROSS HOLD -RUN
FILEDEF HOLD1 DISK HOLD1.FEX -RUN
TABLE FILE HOLD PRINT FIELDNAME COMPUTE ASNAME/A100 = IF FIELDNAME EQ 'CREATEDBYNAME' THEN 'AS ''Created By''' ELSE IF FIELDNAME EQ 'MISSINGSUBJECT' THEN 'AS ''Missing Subject''' ELSE IF FIELDNAME EQ 'ACB' THEN 'AS ''ACB''' ELSE IF FIELDNAME EQ 'ACCOUNTINQUIRY' THEN 'AS ''Account Inquiry''' ELSE IF FIELDNAME EQ 'DEALERREPKITREQUEST' THEN 'AS ''Dealer Rep Kit Request''' ELSE IF FIELDNAME EQ 'DIPOUTGOING' THEN 'AS ''DIP (Outgoing)''' ELSE IF FIELDNAME EQ 'DSCFULLREPORT' THEN 'AS ''DSC Full Report''' ELSE IF FIELDNAME EQ 'DSCINQUIRY' THEN 'AS ''DSC Inquiry''' ELSE IF FIELDNAME EQ 'DSCREFUND' THEN 'AS ''DSC Refund''' ELSE IF FIELDNAME EQ 'FULLFREEUNITREPORT' THEN 'AS ''Full Free Unit Report''' ELSE IF FIELDNAME EQ 'FULLTRIALBALANCEREPORT' THEN 'AS ''Full Trial Balance Report''' ELSE IF FIELDNAME EQ 'INCOMETRUSTS' THEN 'AS ''Income Trusts''' ELSE IF FIELDNAME EQ 'MARKETINGFULFILLMENT' THEN 'AS ''Marketing Fulfillment''' ELSE IF FIELDNAME EQ 'OTHER' THEN 'AS ''Other''' ELSE IF FIELDNAME EQ 'PPNSLINKNOTES' THEN 'AS ''PPNs (Link Notes)''' ELSE IF FIELDNAME EQ 'PRODUCTINQUIRY' THEN 'AS ''Product Inquiry''' ELSE IF FIELDNAME EQ 'STATEMENTREQUEST' THEN 'AS ''Statement Request''' ELSE IF FIELDNAME EQ 'TAXINQUIRY' THEN 'AS ''Tax Inquiry''' ELSE IF FIELDNAME EQ 'FLOWTHROUGH' THEN 'AS ''Flow Through''' ELSE IF FIELDNAME EQ 'MARKETCONDITIONS' THEN 'AS ''Market Conditions''' ELSE IF FIELDNAME EQ 'BOOKMEETING' THEN 'AS ''Book Meeting''' ELSE IF FIELDNAME EQ 'FOLLOWUP' THEN 'AS ''Follow-up''' ELSE IF FIELDNAME EQ 'FUNDCAMPAIGN' THEN 'AS ''Fund Campaign''' ELSE IF FIELDNAME EQ 'INTRODUCTION' THEN 'AS ''Introduction''' ELSE IF FIELDNAME EQ 'INFORMATIONCHANGE' THEN 'AS ''Information Change''' ELSE IF FIELDNAME EQ 'MARKETING' THEN 'AS ''Marketing''' ELSE IF FIELDNAME EQ 'PROBLEMRESOLUTION' THEN 'AS ''Problem Resolution''' ELSE IF FIELDNAME EQ 'RSMPROJECT' THEN 'AS ''RSM Project''' ELSE IF FIELDNAME EQ 'REPCOMPLAINT' THEN 'AS ''Rep Complaint''' ELSE IF FIELDNAME EQ 'REPREQUESTCHANGEMEETING' THEN 'AS ''Rep Request/Change Meeting''' ELSE IF FIELDNAME EQ 'REPINQUIRY' THEN 'AS ''Rep Inquiry''' ELSE IF FIELDNAME EQ 'THANKYOU' THEN 'AS ''Thank You''' ELSE IF FIELDNAME EQ 'REPREQUESTPROMOS' THEN 'AS ''Rep Request Promos''' ELSE IF FIELDNAME EQ 'INCOMETRUSTS' THEN 'AS ''Income Trusts''' ELSE IF FIELDNAME EQ 'PROSPECTUS' THEN 'AS ''Prospectus''' ELSE IF FIELDNAME EQ 'DUEDILIGENCE' THEN 'AS ''Due Diligence''' ELSE 'AS ' | FIELDNAME; WHERE FIELDNAME NE 'REGION' ON TABLE HOLD AS HOLD1 END -RUN
-IF &USERTYPE EQ 'CSDS' THEN GOTO SUBCS -ELSE IF &USERTYPE IN ('RSM', 'ISR', 'SC') THEN GOTO SUBSALES -ELSE GOTO SUBALL;
-SUBCS TABLE FILE SUBACROSS PRINT -MRNOEDIT -INCLUDE HOLD1 BY REGION ON TABLE ROW-TOTAL/D15 AS 'Total' ON REGION SUBHEAD "&WHERERGN
Frank is correct although I don't believe in overusing -RUN. But whenever you have Dialog Manager code embedded in Focus code, to ensure that the DM runs at the proper time, you must put the -RUN statements in.
Since you are new to Focus, it is important to understand the parsing order in a focexec. Dialog Manager commands get evaluated first (-commands and &variables). All other commands are placed in focstack. The DM commands are executied first followed by commands in focstack unless the Focus commands are followed by a -RUN which executes the commands in the stack.
This area of your code is questionable:
TABLE FILE CHECK PRINT CREATEDBYNAME REGION &WHERERGN ON TABLE HOLD AS CHECK2 END ==> Need a -RUN here. -IF &FOCERRNUM NE 0 GOTO ACTIVITY_ERR; -IF &LINES = 0 THEN GOTO NOREPORT ELSE GOTO PRINTOUT; -NOREPORT
TABLE FILE MSEXT_CONTACTVIEW PRINT FULLNAME NOPRINT WHERE RECORDLIMIT EQ 1 <== This is an incomplete request.
-GOTO HSTYLE <== This label doesn't exist. -PRINTOUT
The reason you are getting the SUBACROSS not found error is that that hold file is never getting created. You need to trace your DM logic to find out why. Try -SET &ECHO=ALL; instead.
Thanks for the mini lesson. However, I didn't post all of my code on here so the HSTYLE does exist, I just didn't post the HTML part of my code. In my revised code I do have a -RUN at the end of TABLE FILE CHECK PRINT CREATEDBYNAME REGION &WHERERGN ON TABLE HOLD AS CHECK2 END
I've tested this and it works TABLE FILE MSEXT_CONTACTVIEW PRINT FULLNAME NOPRINT WHERE RECORDLIMIT EQ 1
Those aren't the problems in the program.
This part is -SET NODATA = 0 TABLE FILE COUNTSUB SUM MAX.SUBJECTS &RSMPRNT.EVAL AS '' COMPUTE REGION1/A300=IF REGARDINGOBJECTTYPECODE EQ 2 THEN CON.CF_REGIONNAME ELSE OWN.BUSINESSUNITIDNAME; NOPRINT ACROSS SUBJECT AS '' BY REGION1 BY CREATEDBYNAME &RSMPRNT1.EVAL -&WHEREPOS -&WHERERGN WHERE SUBJECTS NE 0; ON TABLE HOLD AS SUBACROSS END -RUN
It doesn't seem to give an output for region. The report runs but no output for the region.
1) YOU mixcase in the pull: CNT.SUBJECT AS 'Subjects' and MAX.SUBJECTS &RSMPRNT.EVAL AS '' in subsequent step??? 2) Do ?FF COUNTSUB after the TABLE step and after -RUN to see if it is named correctly and actually populated; If YES, table it out and see if each column is populated, as expected:
-SET &ECHO=ALL;
TABLE FILE SUBJECTS SUM CNT.SUBJECT AS 'Subjects' MAX.CREATEDBYNAME OWNERID CREATEDBY REGARDINGOBJECTID REGARDINGOBJECTTYPECODE &WHEREDATE1 BY CREATEDBY BY SUBJECT ON TABLE HOLD AS COUNTSUB END -RUN
?FF COUNTSUB -RUN
TABLE FILE COUNTSUB PRINT * IF RECORDLIMIT EQ 100 END -EXIT
These 'ARE NOT' Dialogue Manager statements, remove the dash. In the ECHO, make sure these are the desired WHERE statements you generated at the top. This may be the reaon for ZERO records..