Announcements
I have a plugin, in which I am using a fetch query, it worked fine.
However the scope has changed and in the fetch statement, i need to update the following line, to retrieve the record where the "accountuniquenumber"'s last 7 digits match not the full value.
I know i need to update the following to sections but not sure to what, can i retrieve just the last 7 digits and then make the condition so it ends in?
Entity Target = context.InputParameters["Target"] as Entity; try { string AccountName = "", UniqueNumber = "", ZipCode = ""; if (Target.Attributes.Contains("cr011_accountname")) AccountName = Target.Attributes["cr011_accountname"].ToString(); if (Target.Attributes.Contains("cr011_accountuniquenumber")) UniqueNumber = Target.Attributes["cr011_accountuniquenumber"].ToString(); if (Target.Attributes.Contains("cr011_address1zippostalcode")) ZipCode = Target.Attributes["cr011_address1zippostalcode"].ToString(); #region FetchAccounts string AccountsFetchQuery = @" > ";
You must write string before UniqueNumber. It is a variable, so you must specify the type
Hi, i'm still getting this error, any suggestions are most welcome.
Hi, thanks for the reply, however when i try and update my code to your suggestion i get the following error when building the solution, it's probably me though, can you point out where I am messing up, please?
You could try something like this:
UniqueNumber = Target.Attributes["cr011_accountuniquenumber"].ToString();
UniqueNumberSubStr = UniqueNumber .Substring(UniqueNumber .Length - 7);
And yes, with like=%{UniqueNumberSubStr } (I am using $"" annotation) you should compare just the last 7 characters
André Arnaud de Cal... 291,359 Super User 2024 Season 2
Martin Dráb 230,370 Most Valuable Professional
nmaenpaa 101,156