syntax error when using 'ne' with a GUID in SDK.REST.retrieveMultipleRecords - dynamics-crm-online

I seem to be unable to use a GUID and the 'ne' operator when calling retrievemultiplerecords. The first portion of this query works fine where I lookup by ta_lead/Id...it's the second half that chokes where there is a value for thisGuid. Here's what I have tried and the results I get:
options = "$select=ta_value&$filter=ta_lead/Id eq (guid'" + leadId + "') and ta_leadallocationId/Id ne (guid'" + thisGuid + "')";
This returns Bad Request: No property 'Id' exists in type 'System.Guid'
options = "$select=ta_value&$filter=ta_lead/Id eq (guid'" + leadId + "') and ta_leadallocationId ne (guid'" + thisGuid + "')";
This returns Bad Request: Unrecognized 'Edm.Guid' literal 'guid''' in '87.
options = "$select=ta_value&$filter=ta_lead/Id eq (guid'" + leadId + "') and ta_leadallocationId ne ('" + thisGuid + "')";
This returns Bad Request: Operator 'ne' incompatible with operand types 'System.Guid' and 'System.String'
Any ideas out there??? Thx...clint

Related

Failed to get #Query Result

Hello I'm trying to read tables related with ManyToOne , i get the result when i execute the query in Navicat :
but when i try to display data in the front with angular i failed i get only the main tables
this is the query :
//like this
#Query(value = "SELECT\n" +
"\tnotification.idnotif,\n" +
"\tnotification.message,\n" +
"\tnotification.\"state\",\n" +
"\tnotification.title,\n" +
"\tnotification.\"customData\",\n" +
"\tnotification.\"date\",\n" +
"\tnotification.receiver,\n" +
"\tnotification.sender,\n" +
"\tnotification.\"type\",\n" +
"\thospital.\"name\",\n" +
"\thospital.\"siretNumber\",\n" +
"\tusers.firstname,\n" +
"\tusers.\"isActive\" \n" +
"FROM\n" +
"\tnotification\n" +
"\tINNER JOIN hospital ON notification.receiver = :reciver\n" +
"\tINNER JOIN users ON notification.sender = :sender",nativeQuery = true)
List<Notification> findNotificationCustomQuery(#Param("reciver") Long reciver,#Param("sender") Long sender);
please what can i do to resolve this problem !
You are doing inner join in the native query. Follow as below. Change the return type to Object[] from Notification.
#Query(value = "SELECT\n" +
"\tnotification.idnotif,\n" +
"\tnotification.message,\n" +
"\tnotification.\"state\",\n" +
"\tnotification.title,\n" +
"\tnotification.\"customData\",\n" +
"\tnotification.\"date\",\n" +
"\tnotification.receiver,\n" +
"\tnotification.sender,\n" +
"\tnotification.\"type\",\n" +
"\thospital.\"name\",\n" +
"\thospital.\"siretNumber\",\n" +
"\tusers.firstname,\n" +
"\tusers.\"isActive\" \n" +
"FROM\n" +
"\tnotification\n" +
"\tINNER JOIN hospital ON notification.receiver = :reciver\n" +
"\tINNER JOIN users ON notification.sender =
:sender",nativeQuery = true)
List<Object []> findNotificationCustomQuery(#Param("reciver")
Long reciver,#Param("sender") Long sender);
Then you have to loop the result as below and get the attributes.
for(Object[] obj : result){
String is = obj[0];
//Get like above
}

Cypress: Assign and access global variable in cypress

I'm new with cypress, I tried to set several global variables to use for different purposes. However, the scope of those variables are different even they are declared as global. My expectation is output 3: 0 and 4 and 1, how could I do that? Thanks everyone, my code as below:
var totalCouponCredit = []
var arrayGameCredit = []
var totalSelectedCredit, userUsedCredit, gameCredit
describe ('Testing',function(){
it('Login',function(){
cy.get('div.row.flex-lg-column.h-100>div:nth-of-type(1)>div>div>h6').then(($selectedCredit)=>{
//This is the string return "SELECTED CREDITS 0/4", userUsedCredit is 0 and totalSelectedCredit is 4 after split
totalCouponCredit = $selectedCredit.text().match(/[a-zA-Z]+|[0-9]+(?:\.[0-9]+|)/g)
userUsedCredit = parseInt(totalCouponCredit[2])
totalSelectedCredit = parseInt(totalCouponCredit[3])
cy.get('div.col>p:nth-of-type(1)>span>span').then(($gameCredit)=>{
//This is the string return "This title is worth 1 credit(s)", gameCredit is 1 after split
arrayGameCredit = $gameCredit.text().match(/[a-zA-Z]+|[0-9]+(?:\.[0-9]+|)/g)
gameCredit = parseInt(arrayGameCredit[4])
cy.log("Out put 1:" + userUsedCredit + " and " + totalSelectedCredit + " and " +gameCredit)
})
cy.log("Out put 2:" + userUsedCredit + " and " + totalSelectedCredit + " and " +gameCredit)
})
cy.log("Out put 3:" + userUsedCredit + " and " + totalSelectedCredit + " and " +gameCredit)
})
})
OUTPUT:
Output 1: 0 and 4 and 1
Output 2: 0 and 4 and undefined
Output 3: undefined and undefined and undefined

strange behaviour when xcode evaluates variables at runtime

I get the error "expression was too complex to be solved in reasonable time" for the following code.
I saw other threads regarding the error with much complexer expressions then mine and it was stated, that the compiler is buggy.
Is this also true for the following simple code ?
Problem:
let value1:Int = 1;
let value2:Int = 3;
var sql="The Number 2 is in "
+ " between " + String(iFrom) + " and " + String(iTo) + ".";
but this works
let value1:Int = 1;
let value2:Int = 3;
var sql="The Number 2 is in "
+ " between " + String(iFrom) + " and " + String(iTo);
The difference is only the "." at the end of concatenation.
If its a bug:
The process SourceKitService is running at max and slowes everything down. Can compilation at runtime be disabled ?
One thing you could try that I've had some success with is to try specifically typing your sql variable.
var sql: String ="The Number 2 is in "
+ " between " + String(iFrom) + " and " + String(iTo) + ".";

How to display fields in new line in same textBox in telerik reporting?

I am using Silverlight4 and Telerik Reporting Q3 2011. I am trying to Generate Reports of all Outlets. I used Table to display its fields. And I want to Display Full Address in same cell. How could I?
I Used following Experession to display Full Address in same cell.
= Fields.AddressLine1
+ ", " + Fields.AddressLine2
+ ", " + Fields.Suburb
+ ", " + Fields.City
+ ", " + Fields.State
+ ", " + Fields.Country
I want do display this in same cell but want output like below..
=====================
Address
=====================
15A,
xxxx xxxRoad,
xxxxxx,
xxxxxxxx
====================
But I m getting this
=====================
Address
=====================
15A, xxxx xxxRoad, xxxxxx, xxxxxxxx
=====================
How do I get Output Which I want?
made the Function NewLineFeeds() in this function I used Replace() Method to replace the specific string to newLine(\n) .
public static string NewLineFeeds(string text)
{
string result = text.Replace(", ", "\n");
result = result.Replace(", ", "\n");
result = result.Replace(", ", "\n");
return result;
}
and my Expression is
=NewLineFeeds(Fields.AddressLine1
+ ", " + Fields.AddressLine2
+ ", " + Fields.Suburb
+ ", " + Fields.City
+ ", " + Fields.State
+ ", " + Fields.Country)
This call the Function NewLineFeeds() and replace ", " to \n (new Line). Add this will work Fine..

How to concat strings in LINQ while properly dealing with NULL values

I'd like an elegant way to concatenate several columns together using LINQ, but using the + operator or concat() when any of the columns are NULL results in NULL for the value after concatenation.
Is there anything similar to concat() that handles NULL differently, or am I thinking about this in the incorrect way?
Any help is appreciated!
Here is the code I am using:
List<CustomObject> objects = (
from obj in ObjectTable
where obj.Id == Id
select new CustomObject()
{
EnteredBy = obj.EnteredBy,
EntryDate = obj.EntryDate,
WorknoteText =
obj.VchWorkNote1 +
obj.VchWorkNote2 +
obj.VchWorkNote3 +
obj.VchWorkNote4 +
obj.VchWorkNote5 +
obj.VchWorkNote6 +
obj.VchWorkNote7 +
obj.VchWorkNote8 +
obj.VchWorkNote9 +
obj.VchWorkNote10 +
obj.VchWorkNote11 +
obj.VchWorkNote12 +
obj.VchWorkNote13 +
obj.VchWorkNote14 +
obj.VchWorkNote15 +
obj.VchWorkNote16 +
obj.VchWorkNote17 +
obj.VchWorkNote18 +
obj.VchWorkNote19 +
obj.VchWorkNote20
}).ToList();
One option is to use the null coalescing operator:
List<CustomObject> objects = (from o in ObjectTable
where o.Id == Id
select new CustomObject(){
EnteredBy = o.EnteredBy,
EntryDate = o.EntryDate,
WorknoteText =
(o.VchWorkNote1 ?? "") +
(o.VchWorkNote2 ?? "") +
(o.VchWorkNote3 ?? "") +
(o.VchWorkNote4 ?? "") +
...
(o.VchWorkNote20 ?? "")
}).ToList();
Hopefully the generated SQL will use an appropriate translation.
You can use the ?? operator this way :
...
(object.VchWorkNote5 ?? "") +
(object.VchWorkNote6 ?? "") +
(object.VchWorkNote7 ?? "") +
...
How about (object.VchWorkNote1 ?? "") +.....
Can you add a new column to your database? Something like "Keywords" or "FullText"
Define it to have a calculation, that calculation is basically "ISNULL(<Field1>, '') + ISNULL(<Field2>, '')" etc.
Make sure to mark it as persisted, so it doesn't have to calculate each time.
Then you just need to pull down that one field from your table.
there's probably a cleaner way, but first thing that comes to mind would be a quick null to zero length string conversion:
List<CustomObject> objects = (from object in ObjectTable
where object.Id == Id
select new CustomObject(){
EnteredBy = object.EnteredBy,
EntryDate = object.EntryDate,
WorknoteText =
object.VchWorkNote1 ?? "" +
object.VchWorkNote2 ?? "" +
object.VchWorkNote3 ?? "" +
object.VchWorkNote4 ?? "" +
object.VchWorkNote5 ?? "" +
object.VchWorkNote6 ?? "" +
object.VchWorkNote7 ?? "" +
object.VchWorkNote8 ?? "" +
object.VchWorkNote9 ?? "" +
object.VchWorkNote10 ?? "" +
object.VchWorkNote11 ?? "" +
object.VchWorkNote12 ?? "" +
object.VchWorkNote13 ?? "" +
object.VchWorkNote14 ?? "" +
object.VchWorkNote15 ?? "" +
object.VchWorkNote16 ?? "" +
object.VchWorkNote17 ?? "" +
object.VchWorkNote18 ?? "" +
object.VchWorkNote19 ?? "" +
object.VchWorkNote20 ?? ""
}).ToList();

Resources