web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Remove column from Columnset in CRM 2013

(0) ShareShare
ReportReport
Posted on by

Hi all,


I have a code in CRM 4

ColumnSet cols = new ColumnSet();
            foreach (string columnName in getAttributeList)
            {
                cols.AddColumn(columnName);
            }
            cols.RemoveColumn("new_manufacturinglocationiddsc");
            cols.RemoveColumn("new_manufacturinglocationidname");
            cols.RemoveColumn("productiddsc");
            cols.RemoveColumn("productidname");
            cols.RemoveColumn("transactioncurrencyiddsc");
            cols.RemoveColumn("transactioncurrencyidname");
            cols.RemoveColumn("uomiddsc");
            cols.RemoveColumn("uomidname");
            query.ColumnSet = cols;

But in for CRM 2013 Xrm.SDK.Query.Columnset doesn't contains the property RemoveColumn.


any suggestion ?

Thanks

*This post is locked for comments

I have the same question (0)
  • Aileen Gusni Profile Picture
    44,524 on at

    Hi Chirag,

    What if you just put condition in the foreach before you add the columns.

    if not exists in the RemoveColumns then Add the Columns.

     

  • Community Member Profile Picture
    on at

    Hi Aileen Gusni,

    I did the same thing before Guido Preite's answer.

    It works but when i execute that query it gives exception AttributePlatformNumber. :(

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans