Need help building a menuopt file for Jenzabar CX - report

I'm not sure if anyone out here uses Jenzabar & ACE reporting, but the question is specific to that as far as I know.
I'm building an ACE report and the menuopt file for it has to be modified to lookup values for a parameter based on several specific conditions.
The portion of the menuopt file I have now is:
LU7 = crs_rec.title1, optional;
PA7: optional,
comments = "Enter a course number - leave blank if for all"
default = "",
lookup LU7 joining *crs_rec.crs_no,
upshift,
length = 10;
I'm looking to modify the lookup so that it only lists courses that can be found by this SQL statement:
SELECT DISTINCT crs_no
FROM crs_rec
WHERE dept IN ( SELECT dept
FROM dept_table
WHERE div IN ('CCE','HLTH'));
If anyone is familiar with using Jenzabar CX & ACE reporting, any help would be appreciated.
Thanks

I got this answer from someone on a Jenzabar listserv....
Sometimes you can get the same effect by limiting it based on other params.
For example:
LU6 = cat_table.txt;
PA6: optional,
comments = "COMMENT_CAT_TBCODE",
lookup LU6 joining *cat_table.cat,
upshift,
length = 4;
LU7 = crs_rec.title1, optional;
LU7B = crs_rec.dept, optional,
qualifier = "#XXXX,YYYY,ZZZZ,DDDD,EEEE";
LU7C = crs_rec.cat, optional,
qualifier = "field:PA6";
PA7: optional,
comments = "COMMENT_CRS_NO - COMMENT_BLANK_ALL"
default = "",
lookup LU7,LU7B,LU7C joining *crs_rec.crs_no,
upshift,
length = 10;
This would show only the courses in departments XXXX,YYYY,ZZZZ,DDDD, and EEEE in the catalog entered as param PA6.
(the catalog param is basically the only way of doing the "distinct" for the crs_no in the menuopt).
You cannot do the dept in div thing unless you make dept another parameter in which case you could limit the dept selection with a div qualifier and change the LU7B to reference field:xxxx (the param for the dept).

Related

How do I pass a filter to Count?

Is it possible to put a filter into the Issue model whose items are getting counted here????
issues = Student.objects.annotate(Count('issue'))
I really need to filter it so as to get the desired outcome...
If not is there a way I can be able to get count of all Issues to a particular student?
class Issue(SafeDeleteModel):
_safedelete_policy = SOFT_DELETE
borrower_id = models.ForeignKey(Student,on_delete=models.CASCADE)
book_id = models.ForeignKey(Books,on_delete=models.CASCADE)
class Student(models.Model):
school = models.ForeignKey(School, on_delete=models.CASCADE)
name = models.CharField(max_length=200)
student_id = models.CharField(max_length=20)
Yes, you can filter what items are counted with the filter=… parameter [Django-doc]. We can for example filter on the book_id with:
issues = Student.objects.annotate(
num_issues=Count(
'issue',
filter=Q(issue__book_id_id=some_book_id)
)
)
or to exclude soft deleted items, we can work with the deleted field that has been defined in your model (by the django-safedelete package):
issues = Student.objects.annotate(
num_issues=Count(
'issue',
filter=Q(issue__deleted=False)
)
)
Note: Normally one does not add a suffix _ids to a ManyToManyField field, since Django
it refers to a manager over the target objects. Therefore it should
be book, instead of book_id.

Does a OUTER-JOIN always divide the query in two parts, leaving the part on the right empty if not complete in Progress?

I'm trying to do an OUTER-JOIN in progress using this page as inspiration. My code is as follows
OPEN QUERY qMovto
FOR EACH movto-estoq
WHERE movto-estoq.lote BEGINS pc-lote
AND movto-estoq.it-codigo BEGINS pc-it-codigo
AND movto-estoq.dt-trans >= pd-data1
AND movto-estoq.dt-trans <= pd-data2
AND movto-estoq.cod-emitente = pi-cod-emitente,
EACH item OUTER-JOIN
WHERE movto-estoq.it-codigo = item.it-codigo,
EACH item-cli OUTER-JOIN
WHERE item-cli.item-do-cli BEGINS pc-item-cli
AND movto-estoq.cod-emitente = item-cli.cod-emitente
AND movto-estoq.it-codigo = item-cli.it-codigo
AND movto-estoq.un = item-cli.unid-med-cli,
EACH nota-fiscal OUTER-JOIN
WHERE movto-estoq.nro-docto = nota-fiscal.nr-nota-fis
BY movto-estoq.dt-trans DESCENDING BY movto-estoq.hr-trans DESCENDING.
The problem that is happening is when 1 element in null, all the other elements that are in the OUTER-JOIN are appearing as null as well, even though they are not null. Is there a better way to write this code? Should I put 'LEFT' before the OUTER-JOIN? Thanks for your time.
To make your example easier, consider making it work from ABL dojo. The following code:
define temp-table ttone
field ii as int
.
define temp-table tttwo
field ii as int
field cc as char
.
create ttone. ttone.ii = 1.
create ttone. ttone.ii = 2.
create tttwo. tttwo.ii = 2. tttwo.cc = "inner".
create tttwo. tttwo.ii = 3. tttwo.cc = "orphan".
define query q for ttone, tttwo.
open query q
for each ttone,
each tttwo outer-join where tttwo.ii = ttone.ii.
get first q.
do while available ttone:
message ttone.ii tttwo.cc.
get next q.
end.
Can be run from https://abldojo.services.progress.com/?shareId=600f40919585066c219797ed
As you can see, this results in :
1 ?
2 inner
The join which is not available is shown as unknown. The value of the outer part of the join is shown.
Since you do not show how you are getting an unknown value for everything, maybe you are concatenating the unknown values?

Transform report with distribution by months

I have the following ALV report generated from the RFKSLD00 program:
I need to generate a report based on the above report like this one (as part of my work):
Any ideas how to do this? I am not asking for a solution but some steps on how to achieve this.
Each line of the original report is one line of your report, you need just to adjust the sums for local currency, i.e. multiply all values by local currency rate. The yellow totals lines shouldn't confuse you, they are generated by grid, not by report.
The only thing that is missing in original report is debit and credit of balance carryforward, I suppose in the original you have already reconciliated value. To get separate values for it you need inspecting the code.
The initial step would be to declare final structure and table based on it:
TYPES: BEGIN OF ty_report,
rec_acc TYPE skont,
vendor TYPE lifnr,
...
jan_deb TYPE wrbtr,
jan_cred TYPE wrbtr,
febr_deb TYPE wrbtr,
febr_cred TYPE wrbtr,
...
acc_bal_deb TYPE wrbtr,
acc_bal_cred TYPE wrbtr,
END OF ty_report,
tt_report TYPE TABLE OF ty_report.
DATA: lt_report TYPE tt_report.
Then you only need looping original report internal table and fill your final structure, not missing currency conversion:
select single * from tcurr
into #DATA(tcurr)
where fcurr = 'EUR'
and tcurr = 'AUD'. "<- your local currency
DATA(lv_ukurs) = tcurr-ukurs.
LOOP AT orig_table INTO DATA(orig_line).
APPEND INITIAL LINE INTO lt_report ASSIGNING FIELD-SYMBOL(<fs_rep>).
MOVE-CORRESPONDING orig_line TO <fs_rep>.
CASE orig_line-monat. "<- your period
WHEN '01'.
<fs_rep>-jan_deb = orig_line-debit.
<fs_rep>-jan_cred = orig_line-credit.
WHEN '02'.
<fs_rep>-febr_deb = orig_line-debit.
<fs_rep>-febr_cred = orig_line-credit.
...
ENDCASE.
DO 30 TIMES.
ASSIGN COMPONENT sy-index OF STRUCTURE <fs_rep> TO FIELD-SYMBOL(<field>).
CHECK sy-subrc = 0.
DESCRIBE FIELD <field> TYPE DATA(TYP).
CHECK TYP = 'P'.
CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
EXPORTING
DATE = sy-datum
FOREIGN_CURRENCY = 'EUR'
LOCAL_CURRENCY = 'AUD'
FOREIGN_AMOUNT = <field>
TYPE_OF_RATE = 'M'
IMPORTING
EXCHANGE_RATE = lv_ukurs
LOCAL_AMOUNT = <field>.
ENDDO.
ENDLOOP.
I recommend to name all components of your final structure ty_report the same as in original as much as possible. Thus you can maximally utilize MOVE-CORRESPONDING and avoid manual coding.
This is just quick shot and I may be missing some details and errors.

Building a query in appmaker with "or"

So say I am using a form to build a query against my datasource (i've come so far in two weeks! I can do this!), how do I make it more complex?
What if I want books by austen that include the word "pride" AND books by gabaldon that contain the word "Snow"
the individual queries would be
widget.datasource.query.filters['author']._contains = "austen";
widget.datasource.query.filters['title']._contains = "pride";
and
widget.datasource.query.filters['author']._contains = "gabaldon";
widget.datasource.query.filters['title']._contains = "snow";
in pseudosql it would be
select * from table
where
((author like 'austen') and (title like 'snow'))
or
((author like 'gabaldon') and (title like 'pride'))
Is there a way to filter a data source on a complex query like this and cut out the whole widget.datasource aspect? I'd be fine with using a calculated table.
Edit: Ok i'm making some progress towards the kind of functionality I need, can anyone tell me why this works:
widget.datasource.query.filters.document_name._contains = 'x';
but this does not?
widget.datasource.query.parameters.v1 = "x";
widget.datasource.query.where = 'document_name contains :v1';
this also doesn't work:
widget.datasource.query.where = 'document_name contains "x"';

Sage CRM - It is possible to create an appointment through Classic ASP code?

Using this:
var NewComm = CRM.CreateRecord("Communication");
NewComm("Comm_ChannelId") = Request.Form("chanId");
NewComm("Comm_Type") = "Appointment";
NewComm("Comm_DateTime") = Request.Form("initialHour");
NewComm.SaveChanges()
I can see in the DDBB that the Communication is created
Just for testing (and to see if it needs a Comm_Link row to be able to show), i updated some row in the Comm_Link table (CmLi_Comm_CommunicationId column) to the ID equals to the Communication i just created, but still i do not see my Comm when clicking in My Calender
There is somethgin else i need to do?
There are certain fields that are required for security, namely Team (Channel) fields and Territory (Secterr) fields.
With Communications, you also need to make sure there are other default fields, as Communicationa are often filtered.
For example, Communication lists are filtered by the Status field = Pending by default, so make sure the comm_status field is set.
Also, all Communications generally have an Action (comm_action) and some other fields.
We advise setting the following fields, in addition to those you have already set:
NewComm("comm_status") = 'Pending';
NewComm("comm_action") = 'Meeting';
NewComm("comm_secterr") = *A Territory Id*;
NewComm("comm_subject") = 'A Subject';
NewComm("Comm_ToDateTime") = *End Date/Time*;
NewCommLink("cmli_comm_userid") = *The User Id*;
NewCommLink("cmli_comm_communicationid") = *The Communication Id*;
NewCommLink("cmli_comm_personid") = *The Person Id if required*;
NewCommLink("cmli_comm_companyid") = *The Company Id if required*;
Hope that helps!
Six Ticks Support

Resources