We have a user who is receiving reports from SSRS, but who is not listed in the subscription fields (Find report > Manage > Subscriptions). When I query the report server directly, I see them listed in the CC field. The following is the code I found that shows the user in the CC field.
DECLARE
#email VARCHAR(250) = 'user#company.com'
SELECT
cat.[Path],
cat.[Name],
CASE WHEN sub.Description LIKE '%#%' THEN 0 ELSE 1 END AS DDS,
CASE WHEN sub.Description LIKE '%#%' THEN '' ELSE sub.Description END AS DDSDescription,
sub.SubscriptionID,
sub.ExtensionSettings
FROM [ReportServer].[dbo].[Catalog] AS cat
INNER JOIN [ReportServer].[dbo].[Subscriptions] AS sub ON cat.ItemID = sub.Report_OID
WHERE sub.extensionSettings LIKE '%' + #Email + '%'
ORDER BY cat.[Path], cat.[Name]
We have removed and re-created the subscriptions for this report, but they are still receiving the reports. I have confirmed that the user is not part of any of the groups receiving the reports, and there are no forwards enabled that point to their email. I was not able to find anything through google, as most everything I return talks about not receiving valid subscriptions, or users with forwarding enabled.
I inherited these reports, and I am not super SQL savvy. Is it possible that the emails are hard-coded into the report, or is there another location that contains subscription information I could look into?
I'm guessing, but it may be a data driven subscription where email addresses are loaded from database:
Data-Driven Subscriptions
Related
I'm building a report in Power BI and could setup a Power Query custom column using Text.Contains to solve this problem but the M Code would be very long and I'd rather perform this upstream in the SQL query. I have very little SQL experience.
I'm working with website data from Adobe Analytics. We have our website URLS and web pages grouped into categorical segments based on the product/service the URL/webpage corresponds to. A segment is defined by a list of URL paths and/or web page names, sometimes 1 path/page, sometimes over 30.
My result needs to be the following table:
Page URL Path
Page Name
Page Category
varchar(255)
varchar(255)
varchar(255)
Page URL Path examples:
/careers/starting-your-career/scholarships.html
/services/technology/ecommerce.html
Corresponding Page Name Examples:
Career & Scholarships | Company Name
Digital Transformation | E-Commerce | Company Name
There are a total of 76 page categories/segments to define. This screenshot shows an example of some categories and their definition.
Can anyone help me get started in writing this query?
I tried using CONTAINS but I believe this only works within a WHERE statement and I don't think it can be scaled to the needed extent:
SELECT
post_evar3 as 'Page URL Path',
post_evar4 as 'Page Name',
CASE
WHEN post_evar3 CONTAINS ('/services/assurance' or 'services/audit' or 'insights/financial-reporting')
AND (post_evar3 CONTAINS 'asc-842' OR post_evar4 CONTAINS 'asc 842')
THEN 'Audit Services'
WHEN post_evar3 CONTAINS '/services/strategy-and-management-consulting'
THEN 'Business Stratgegy Operations'
ELSE 'Other'
END AS 'Page Category'
FROM
Marketing.WebAnalytics.WebData
WHERE
exclude_hit = 0
AND hit_source = 1
I've read about Full-Text Search and Index solutions that are over my head in developing and I don't know that this method can be used within the Power BI SQL query environment. I've wondered if I need to declare the definition values into their own table, then join with the WebData table, though defining using both Page URL Path AND Page Name for the same category throws me for a loop.
The M code for this kind of matching is not large, though execution time can can vary
let BufferedTable2=Table.Buffer(Table2),
Source = Table.AddColumn(Table1,"Match",(i)=>try Table.SelectRows( BufferedTable2, each Text.Contains(i[Column1],[Match1], Comparer.OrdinalIgnoreCase) and Text.Contains(i[Column2],[Match2], Comparer.OrdinalIgnoreCase) ) [Return]{0} otherwise null, type text)
in Source
Some customers require order emails to be sent for one more recipient (ie. accounting). So, as customer website field not used in shop, planned to use this. However, have trouble for getting data for classes/Mail.php
$website = Context::getContext()->customer->website;
does not get the data stored in customer website field. How to get this data from customer table website field correctly?
PS 1.7.8.7
All the rest seems doable, just set the value for cc field and it works.
So, found some solution. Not the nice one, as there will be extra query to DB, but it works.
$website = Db::getInstance()->getValue('SELECT `website` FROM `'._DB_PREFIX_.'customer` WHERE `email` = \''.($to).'\' ');
I need to come up with a PeopleSoft query that will list employees that have the same MAIL address and HOME address, then either send that list to payroll via email, or send an individual email to each employee letting them know their HOME and MAIL addresses are the same.
I figured out how to send out emails through the alerts system but all it's sending is an stdout file in the email body. I would like the email body to either show the list of employees with duplicate addresses or send an individualized email to each employee showing their duplicate addresses.
This is the query PS generated for me:
SELECT A.EMPLID, A.ADDRESS_TYPE, A.ADDRESS1
FROM PS_ADDRESSES A
WHERE ( ( A.ADDRESS_TYPE = 'HOME'
OR A.ADDRESS_TYPE = 'MAIL'))
ORDER BY 1, 2, 3
Why don't you use the Schedule Query functionality to send an email with the report output in attachment?
Main Menu > Reporting Tools > Query > Schedule Query
In the Process Scheduler Request pop-up set Type to Email and Format to xls, like below:
Then click on 'Distribution' and set the values for your email and the addresses, can be users, roles or just an email address you want:
I'm after getting the OpenText Content Server node id using a word macro after a Content Server user creates a word doc by opening word on their pc and saves (using the enterprise connect dialog) and before the word doc is closed - I'm building a macro to hook the item number and pull some metadata into the doc, allowing the user to insert/update a document footer.
Is there some aspect of the various APIs or SDKs that will allow a word macro to access its own node id (and possibly other metadata) in this scenario?
I've found the file C:\Users[username]\AppData\Roaming\OpenText\OTEdit\sync.fedb which seems to hold a mapping between the file location/name and the document in content server, but interrogating this directly seems like a bit of a hack as OTEdit.exe always has a lock on the file, and I wonder if there is a supported way to do this.
I've investigated DPS as a way to stamp the content server node id into the word doc properties, and while this works if the user closes and re-opens the doc, the properties are not available before the doc is closed and so it is not useful in this situation.
I found a different approach because sync.fedb is locked by the OTEdit process, and there doesn't seem to be any way to access the document metadata via the SDK using a word macro. It's a bit of a hack, but I've put the details here in case anyone else is interested in doing this.
Edited documents are stored under a folder in a path like: C:\Users\[username]\AppData\Roaming\OpenText\OTEdit\EC_[servername]\[folder]\[current document name]
[folder] might match a folder in Content Server, or might not - it is better to check the ~otdirinfo.ini file and parse the parent folder id out of the Browse url.
From here we can do a database search using something like:
SELECT
t.DataID AS NodeId,
CAST(t.CreateDate AS DATE) AS CreateDate,
CASE WHEN k.FirstName IS NULL
AND k.LastName IS NULL THEN k.Name
ELSE LTRIM(RTRIM(( ISNULL(k.FirstName, '') + ' ' + ISNULL(k.LastName, '') )))
END AS CreatedByFullName,
CASE WHEN kr.FirstName IS NULL
AND kr.LastName IS NULL THEN kr.Name
ELSE LTRIM(RTRIM(( ISNULL(kr.FirstName, '') + ' ' + ISNULL(kr.LastName, '') )))
END AS ReservedByFullName,
t.CreatedBy,
t.ReservedBy,
t.ParentID,
t.Name AS Title,
v.FileName
FROM
DTree t
INNER JOIN KUAF k
ON t.CreatedBy = k.ID
LEFT OUTER JOIN KUAF kr
ON t.ReservedBy = kr.ID
INNER JOIN DVersData v
ON t.DataID = v.DocID AND t.VersionNum = v.Version
In practice, I have written an API to wrap the database lookup that returns the results of interest in JSON, which is slightly easier deal with than managing database connections and returns results faster than CWS at my site. I use the handy VBA-Web macros to make the call and handle parsing, place the results of the call into the word doc properties, and then call our existing footer-generation macro.
Note: I'm using Content Server 10.5 for this, apparently the approach for extracting parent id sometimes differs per version.
We've been continuously working on this issue for a few months and not getting far with it. Since this was first asked, we changed the code (based on what the original developer for the site suggested), but we are still not getting where we need to be.
I'm relatively new to Ruby and am currently taking some courses to learn more about it, so please bear with me. We're using Ruby 1.9 and Rails 3.2 We use AS/400 for our database. We've tried using Active Record for this before, and it doesn't want to work because of our versions of Ruby and Rails being older combined with getting it to connect with the 400.
We have an online ordering site that you have to have an account set up to access. Depending on what type of account you are set up as, you might have to have your order approved by someone. I.e. if I am a drop ship account, my distributor has to approve what I'm ordering. The way it had been set up, the distributor wasn't getting any kind of approval email.
Each account that requires approval has x number of email addresses attached to it of people who are able to approve the order. We have been told that target_email needs to be a string, so we tried numerous ways of making it a string to no avail. As is, it's only sending the first two email, not the approval email. If we run target_email = Contact.find_by_sql ["SELECT EMAL23 FROM WEBOEL23 WHERE ACT223 =''"] in console, it returns the expected email addresses associated with that account. So we know that's working the way it should... but we're at a loss as to what is wrong with the rest of the code.
# notify Customer
Mailer.deliver_order_coastal_notify_email("", "Coastal Pet Online Ordering<noreply#coastalpet.com>", "Order Confirmation", email_details)
target_email = Contact.connection.select_values "SELECT EMAL23 FROM WEBOEL23 WHERE ACT223 =''"
# Order Approval
if sign_on.acctypw1.strip == "DS" or sign_on.acctypw1.strip == "DSD"
# If there is no distributor email address, the mailer model will substitute in the admin's email from their settings
target_email.each do | email_address | Mailer.deliver_order_distributor_approval_email(email_address, 'Coastal Pet Online Ordering<noreply#coastalpet.com>', "Order Confirmation Approval", email_details)
end
# notify Coastal staff
Mailer.deliver_order_coastal_notify_email("", "Coastal Pet Online Ordering<noreply#coastalpet.com>", "Order Confirmation-Notify Staff", email_details)
end
I tried
target_email = Contact.connection.select_values("SELECT EMAL23 FROM WEBOEL23 WHERE ACT223 = act223").uniq
This works but it sends emails to multiple accounts why this would happen? I think I need to set a value for act223
act223 = "ACT223"
target_email = Contact.connection.select_values("SELECT EMAL23 FROM WEBOEL23 WHERE ACT223 = #{Contact.connection.quote(act223)}").uniq
this throws NameError (undefined local variable or methodact223' for #):`
in development.log.
Here is a link to the relevant table data if more table information is needed just let me know and I can add it to that page. I am looking to do some sort of a join of a field from another table. In this same model I have SignOn.prefdstw1 which gets me the same account number is there a way to Join this field in the query with the 400?
Any help or suggestions would be greatly appreciated! Thank you in advance!
find_by_sql always returns an array of model objects, so
Contact.find_by_sql ["SELECT EMAL23 FROM WEBOEL23 WHERE ACT223 =''"]
is not an array of email addresses - it's an array of Contact objects, with only one object
You could either extract the email addresses from this, using something like
Contact.find_by_sql(["SELECT EMAL23 FROM WEBOEL23 WHERE ACT223 =''"]).collect do |contract|
contact.emal23
end
I'm not entirely sure what rails will do to the uppercased column name.
If you don't want to instantiate a whole Contact object just to get the email you could also do
Contact.where("ACT223 = ''").pluck('EMAL23')
which would return an array of emails, assuming that Rails knows that the correct table to use for this is WEBOEL23 - it's not clear to me whether that is the table for Contact (and thus you've use set_table_name to configure this) or whether Contact is just a random model unrelated to that table.
You could also drop down a level and do
Contact.connection.select_values "SELECT EMAL23 FROM WEBOEL23 WHERE ACT223 =''"
which will also return an array of email addresses.
Inside the each loop, target_email is a bareword variable (without quotes), but the first argument to the mailer is the string (within quotes) 'target_email'.
Remove those quotes to get to this (whitespace added for readability):
target_email.each do | email_address |
Mailer.deliver_order_distributor_approval_email(
email_address,
'Coastal Pet Online Ordering<noreply#coastalpet.com>',
"Order Confirmation Approval",
email_details
)
end
Then the mailer should have access to the email address.