calendarView work with shared meeting room account? - calendar

Since I start working on MSGraph to extract all the meeting history data. I asked what's the best way. Now I know:
List events does not support parameter of date range, so I cannot use
it.
getSchedule has bug of odata.nextLink, I already file
ticket.
Now I like to try calendarView. calendarView only related to the login account, e.g. I
login as A, if meeting room account B have a meeting not related to
A, then calendarView will not get it. so I'm thinking, if I share B
to A, then I can use
https://graph.microsoft.com/v1.0/users/{accountB}/calendarView?startDateTime=...
to get the data.
I tested it, but got error message:
{"code":"ErrorItemNotFound","message":"The specified object was not found in the store."}
what could be wrong?

If i want to access the shared mailbox using Microsoft graph, i would try this:
GET graph.microsoft.com/v1.0/users{Alex-userId | Alex-userPrincipalName}/calendar/events
Please note that the sharing permissions (Calendars.Read.Shared or Calendars.ReadWrite.Shared) allow you to read or write events in a shared or delegated calendar. Before that i will make sure i have the enough permissions and follow the documentation.

Related

How to write a complex reference to objects in email templates for Salesforce

I need to create a reference in an email template. for that I need to reffer a standard Contact objecect. For that I have a Custom Object Email Info, that has a lokup to standard Accounts.
So in the email I have to have value of the custom field Email_info__c from the custom object Email_info__c(the object and it's field have the same API names) while entering the Contact.
In the end both Contacts and my custom object have the lookups to Account, but not to each other, and there is no lookup from Acount, for now.
My first guess was to refer to the first child object Email info in the header of the VF template
relatedToType="Email_Info__c"
and then refer to it in the body as
{!RelatedTo.Account_r}
but then I would need a lookup from Accounts to Email Info to be able to refer deeper
{!RelatedTo.Account_r.Email_Info__r.Email_Info__c}
but, I don't think that it'll work that way or that it meets the needed criteria. Can someone share if there is an option at all to get the Email Info to Contacts through Accounts without creating a lookup on Accounts?
The task is to have a middle referred object, not a direct lookup:
It depends a bit how you are going to use this email template. What will the send be triggered from. Account? Contact? Email Info record? Will it be fired from a workflow or user will be instructed to navigate to account record and start composing the message?
If your relatedTo is really Email_Info__c then you don't have to do anything, you have all the data hidden in {!relatedTo.Id}, {!relatedTo.Name}, {!relatedTo.Email_Info__c} (you said the field name is same as object's name)
If your email starts from "Account" and you can guarantee accounts will have 1 email info record on related list - something like this might work:
<messaging:emailTemplate subject="hi stack" recipientType="Contact" relatedToType="Account">
<messaging:plainTextEmailBody >
{!relatedTo.Opportunities[0].Id} {!relatedTo.Opportunities[0].Name} {!relatedTo.Opportunities[0].StageName} {!relatedTo.Opportunities[0].CloseDate}
</messaging:plainTextEmailBody>
</messaging:emailTemplate>
from Account (relatedTo) I'm going down to the related list of Opportunities, I'm picking 1st one (at random... but if you have just 1 record it'll be fine) and display whatever I want.
If your relatedTo and recipient both have to be Contact it starts to get bit messier, normal visualforce syntax will not allow you to go "up" (from Contact to Account) and then "down" (from Account to related list of email infos)
You'd need to start with something like https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_email_templates_with_apex.htm and then figure out how to pass the Id of account to it and run a query for email infos related to this account. https://salesforce.stackexchange.com/questions/245930/pass-id-from-visualforce-email-template-to-controller might be a good start, poke me if you're stuck.

Salesforce Email logging on custom object

could really use some serious help on this. Below is the current business case:
We have the standard accounts, contacts, and opportunities objects. We've also created a custom object, and let's call it 'Customers.'
As of now, 'customers' are related to accounts.
Our users have einstein activity capture on, so all the email interactions get logged to the 'Account' level that the contact is related to, which makes sense.
The problem is that I want those emails tracked on the 'Customer' activity feed too, not just the 'Account' or 'Contact' activity feed.
Will creating a junction object between contacts and customers allow this activity to be shown in the 'customer' field? Or is there a simpler way to do this? Thank you in advance as this is a major roadblock I am facing right now.
I haven't worked with Einstein Activity Capture yet. What does it save stuff as? EmailMessage? Task? Either allows adding custom fields so you could add lookup to your Customer__c. With Task it's even simpler, it has that mutant lookup thing, Customer should appear as available option if it has "Allow Activities" ticked in setup.
Assuming that gives you something - next step would be to maybe make a custom quick action with some fields prepopulated, maybe a trigger to go "up" to Account and then to Customer(s)... Because out of the box
https://help.salesforce.com/articleView?id=aac_limitations.htm&type=5
Custom objects aren’t supported. When emails are sent from a custom
object, the email is logged on the activity timeline of the associated
contact.
You can upvote an idea: https://trailblazer.salesforce.com/ideaView?id=0873A000000EAIiQAO

How to show ICredentialProviderCredentialv2 on more than one User tile on the other user tile

I'm trying to develop a Credentialprovider v2. I'm experimenting around with the samplecredentialproviderv2 provided by Microsoft.After installing the redistributable 2013 and compiling for the right architecture, I'd registered it and it worked.
My Problem is, it works only on the first shown user tile. If I enumerate more than one usertile, it is either shown in only one user tile, or I became an error and destroyed my Logon UI.
I know the question is quite similar to this one. Here I can say I've tried the solution stated in the mentioned Microsoft document. There is a function which indicates if the "other user" tile is shown and this function works quite good. The only thing is, the else if won't work, because if you get a legit tile getSid won't reach the else if. So if you return in getSid a null sid and hr_false the credentialprovider is shown the other user tile, but in this case not shown everywhere else. If this solution is hard coded.
I've tried to create more than one ICredentialProviderCredential, so that I have a list of interfaces, but it doesn't worked.
The document, which is provided here, says the following:
"• v2 credential providers must implement the ICredentialProviderCredential2 interface and return a valid SID on the GetUserSID function. This tells Windows which user(s) the provider should be associated with."
My problem is, how to return more than one Sid in the GetUserSid function.
It would be great if you can help.
In ICredentialProvider::GetCredentialCount() you return the number of credential tiles (one per user) that your credential provider will supply (the credential provider can learn how many users there 'are' from the user array given to SetUserArray() ). Return a different ICredentialProviderCredential2 instance in response to each call logon makes to your ICredentialProvider::GetCredentialAt(), and from each of these instances return a different SID in response to GetUserSID(). Each of your credentials should then be associated with a different user at logon.

Drupal Replacement Pattern for Entity Reference

I have a Profile Type attached to a user. In there I have a Entity Reference Field of Program Manager. I have Live Events(content-type) that people can register for. I set up a Rule to Email the Program Manager every time someone registers.
My problem is I am trying to pull information from the Profile based on the the entity reference for the Program Manager.
I have the field printing out by using this pattern...
[registration:entity:field_program_manager]
However when I try to pull the first name, email of phone I can not get it to show up.
Does anyone have any ideas to share?
Many Thanks!
Okay so I was trying to solve for sending the email to the Author of the page but was having issues. So I created a new fields hoping it would be easier. In trying to solve for this I solved the original issue.
To print the Author of a node to an email through Rules actions us this.
[registration:entity:author]
So for first name it would be:
[registration:entity:author:profile-main:field_first_name]
Hope it helps someone else.
If you're using entityform instead of a node and referencing the default user info (not the 'Main Profile' profile type), then you want to use something like
[entityform:field-staff-entity-ref:field-work-email]
In this case, 'field-staff-entity-ref' is the entity reference field in the entityform and 'field-work-email' is the field in the user's account settings.

Get a Google App Engine user by their user_id

In GAE, can you look up a User with the User object's user_id?
In other words, is there something equivalent to:
from google.appengine.api.users import User
user = User.get_by_id(user_id)
I don't think so.
... they certainly wouldn't just give you access to every holder of a google account!
The idea is that you store user ids as properties in your datastore, once they've logged in to your app.
There is a property type called UserProperty
http://code.google.com/appengine/docs/python/datastore/typesandpropertyclasses.html
So, you can query your list of users from your own datastore definition.
hth
This seems to be the only post on the internet regarding this and since I was looking for a solution, I thought I'd post what I found here.
What amir75 said about using the UserProperty is fine for storing the User object itself returned by the google.appengine.users module.
But if you need to lookup a User by the user_id field instead of the default email field, usually something like user = User(email = 'validmail#gmailorgapps.com')
You can use this to query by user_id. user = User(_user_id = 'validuserid') The valid user_id is something that you got earlier from calling user.user_id()
I'm not sure what amir75 is referring to about having access to all google accounts since the User object returned will only have the email address and nickname, and that too only if the user authorizes the application to access that information.
My use case for this is I want people to sign up on the site, but they need an administrator to confirm them for using the site. The form used by the administrator for confirming the users can use email id as the field to identify the checkbox for confirming the user, but given that it might change, the user_id seems to be a safer field to use.

Resources