Hello everyone I would like to know if it 'possible to create pfrelation inserting a chance' to accept or reject the report. P.S. I am following message destructive app thanks
Ps I'm using parse.com
This is an instance where you would need to create a join table/class manually, e.g.:
[SubmittedProjects]
SubmittedBy: relation->User
SubmittedTo: relation->User
Project: relation->Project
Status: string ("pending", "approved", "rejected")
You could then easily find all records given a number of parameters, e.g.
All projects waiting for my approval:
SubmittedTo = me
Status = "pending"
People I need to nag to approve/reject my projects:
SubmittedFrom = me
Status = "pending"
List of all approved projects:
Status = "approved"
Hmm, thinking about it now, these could just be extra fields on your Project table if you only have need of one record for each project.
Your question has very little information so please expand it if this isn't what you meant.
Related
I am attempting to build a Microsoft Teams bot using the Bot Framework Composer. What I would like to do is create an integration with ServiceNow. The goal would be that if anyone posts a record number (ex. REQ0123456, INC0123456, KB0123456) into the group or direct chat (with the bot), the bot would look up that record and provide a card or a short summary of the record to the chat.
To avoid creating a completely separate intent for each record type, I was hoping to use RegEx to gather the match into 2 capture groups; one for the tbl_code and one for the number.
Here is the entry for the user input:
> add some example phrases to trigger this intent:
- look up {conversation.sn_record.tbl_code=REQ}{conversation.sn_record.number=0123456}
- lookup {conversation.sn_record.tbl_code=REQ}{conversation.sn_record.number=0123456}
- {conversation.sn_record.tbl_code=REQ}{conversation.sn_record.number=0123456}
- lu {conversation.sn_record.tbl_code=REQ}{conversation.sn_record.number=0123456}
> entity definitions:
# regex sn_record tbl_code, number = /([a-z]{2,4})([0-9]{7})/mi
The Issue I'm Having
I don't know how to get the values back from the individual capture groups. I would like to have them separate so that I can determine which table needs to be queried. I could probably just use the entire match and the search API in ServiceNow for the whole record string, but I would still like to know how to use capture group values.
I'm currently using turn.recognized.text, but I don't think this is the best method for what I'm looking to do. This returns the entire regex match.
I'm very new to this framework, so please be gentle. :) Let me know if there is more information I can provide.
Thanks all.
Best Regards,
Josh
I was able to figure this one out using the examples in the ToDosSample bot.
The answer was to use named capture groups and then add them to a dialog property to use in the corresponding dialog.
For reference here are the changes I had to make:
New Regex
(?<sn_record>(?<tbl_code>[a-z]{2,4})(?<numbers>[0-9]{7}))
New Dialog Properties
dialog.sn_record = #sn_record
dialog.sn_tbl_code = #tbl_code
dialog.sn_numbers = #numbers
New response
- Okay, looking up ${dialog.sn_tbl_code}${dialog.sn_numbers}
I am trying to fetch a list of classes which the current user has access to, and I am getting classes returned which the user cannot access.
Using the ruby client I can call
service.list_courses(course_states: "ACTIVE")
# I have 7 courses returned
OR
service.list_courses(course_states: "ACTIVE", teacher_id: "me")
# I have 3 courses returned (just mine)
The issue is that in the first call there are 4 courses returned which the current user cannot see/access. This seems like it shouldn't be happening as the docs say Returns a list of courses that the requesting user is permitted to view, restricted to those that match the request.
Is this a bug which I should report in the issue tracker or am I misunderstanding what results can be returned in the courses list?
My use case is that I want to create a course work item in a course, but I only want to do this for courses that the teacher can access. I thought that the list courses should return exactly that list, but, it doesn't seem to (unless I specify teacher_id: "me", but then I'm worried I'll miss courses which the teacher is collaborating on (if that's even possible))
Is this a bug or am I misunderstanding something?
Edited to add
Thanks to #ziganotschka for the API details. After further testing, calling service.list_courses(course_states: "ACTIVE", teacher_id: "me") will return courses that the requesting user has created or courses that the requesting user is collaborating on. This wasn't obvious to me as the course object has an owner_id field which is a single user, so, I thought the teacher_id might be referencing that.
The issue I had been running into was that I was logged in as the super admin which according to the answer below allows me to see all the courses. However, I wasn't actually able to access the weblink of any of those courses which is what was confusing me.
The behavior of the API is following:
service.list_courses(course_states: "ACTIVE") returns for anyone all the courses in which he/she is participating - be it as teacher or student.
If an admin calls service.list_courses(course_states: "ACTIVE") he can see all the classes of the domain - this is intended behavior.
service.list_courses(course_states: "ACTIVE", teacher_id: "me") will return only the classes owned by me.
I have been searching MSDN/Google/Stackoverflow and not able to find a way to create a query where it shows all the code reviews requesting your input. This is before you accept the code review and before you might have any knowledge of it. I know we can obtain open code review work items with a query like the following:
And/Or Field Operator Value
Team Project = #Project
And Work Item Type = Code Review Request
And State <> Closed
You can also personalize reviews you have accepted with the following:
And/Or Field Operator Value
Team Project = #Project
And Work Item Type = Code Review Request
And State <> Closed
And Accepted By Contains #Me
These solution are not exactly what I am looking for, as I am trying to find a query that uses the #Me Value to find all reviews before you accept. This is to help anyone see all their pending reviews requests if in case they miss or deleted the email alert for the code review request. Any ideas, suggestion, and solutions are greatly appreciated.
Thank you for your help in advance!
Use Assigned To
AndOr Field Operator Value
Work Item Type In Group Microsoft.CodeReviewResponseCategory
And Assigned To <> #Me
And Accepted By =
I'm building a web service for a client that pulls data from the Sitefinity CMS. The problem is they want to pass in a Guid for the service and receive the info about this item. No problem except I only have been able to locate the "live" Guid for one Item (and that was by combing through the HTML in the back end).
I was going to look at the tables in SQL Server but I'm not sure which table to look at. The content items have several tables all related of course and there isn't any documentation on how to look at this. I can find plenty of documentation on querying the master Guid, but no place to find it.
Oh, and these are custom content types built by the Module Builder.
Any Help would be SOOOOO appreciated!
var master = DynamicModuleManager.GetManager().Lifecycle.GetMaster(<liveGuidHere>);
One of the biggest consumers of Sitefinity webservices is Sitefinity. The best place to start looking for that guid is to take a look at what web service calls are being made when you pull up your custom content item list in the backend. I used the chrome developer tools and check in the network tab.
One I found for a stores module made with module builder was something to the effect of http://www.testsite.com/Sitefinity/Services/DynamicModules/Data.svc/?managerType=Telerik.Sitefinity.DynamicModules.DynamicModuleManager&providerName=OpenAccessProvider&itemType=Telerik.Sitefinity.DynamicTypes.Model.Stores.Store&provider=OpenAccessProvider&sortExpression=LastModified%20DESC&skip=0&take=50
The json this returns is a list of all the masters with their ids (note in the list that the content items all have have a status of 0) http://www.sitefinity.com/documentation/documentationarticles/developers-guide/sitefinity-essentials/modules/content-lifecycle
When you go to Administration / Module Builder / Your Module, you will see a link to the API on the top right corner.
This link goes to a page full of API examples for your particular module which is kind of cool.
Basically you would have to find your item first using LINQ and the GetValue extension method.
Once you have the item you can get its ID or any other property.
using Telerik.Sitefinity.Utilities.TypeConverters;
using Telerik.Sitefinity.DynamicModules;
using Telerik.Sitefinity.Model;
....
var mgr = DynamicModuleManager.GetManager();
var countrymasters = from ctry in mgr.GetDataItems(TypeResolutionService.ResolveType("Telerik.Sitefinity.DynamicTypes.Model.Destinations.Destination"))
where ctry.GetValue<string>("culture") == siteid &&
(ctry.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live && ctry.Visible == true)
select new
{
airport_cd = ctry.GetValue<string>("airport_cd"),
country_master_cd = ctry.GetValue<string>("country_master_cd")
};
I am trying to find a .NET BusinessConnector equivalent call for the below line:
PurchId = NumberSeq::newGetNum(SalesParameters::numRefSalesId()).num();
I am manually entering purchase order information into the purchase order table, which is fine, but the problem lies in the fact that it is the PurchID that ties purchase table (PURCHTABLE) and the individual purchase order lines (PURCHLINE) is the PURCHID field, which is not automatically populated when saving a purchase order.
Currently I am:
ax.TTSBegin();
axRecord.set_Field("ORDERACCOUNT", purchaseOrder.OrderAccount);
(etc)
axRecord.Insert();
However, while this will insert a record into the database, it has no purchID, which has to be generated. You need a purchID to link the purchase line items in. I found the above code (second line) for X++, but does anyone know of a .NET BusinessConnector call that can be used instead?
Any assistance would be greatly appreciated.
Regards,
Steve
I would go for a change in the insert() method of the PurchTable table:
if (!purchTable.PurchId)
purchTable.PurchId = NumberSeq::newGetNum(purchParameters::numRefPurchId()).num();
Placed after the ttsbegin.
This to avoid complicated C# code. You probably could do it in C# code alone using CallStaticClassMethod and cousins, but it is better do put the buisness logic on the X++ side.
See How to: Call Business Logic Using .NET Business Connector.
Be sure to execute inside a TTSBegin/ TTSCommitblock, otherwise you will get error error messages like this one.
// ax is a reference to an "Axapta" business connector object
var numRef = ax.CallStaticRecordMethod("SalesParameters", "numRefSalesId");
var numSeq = (AxaptaObject)ax.CallStaticClassMethod("NumberSeq", "newGetNum", numRef);
var purchId = numSeq.Call("num");